Two Vertical LinearAxis lines, one to the left and one to the right. Is this possible?

251 views Asked by At

I haven't seen this done in the docs and i can't seem to figure out if it is possible or not. I need the chart to show one vertical line to the left with values and one vertical line to the right with different values, well the values could be the same but the unit types will be different.

This is the code i'm using right now and it only gives med the one right line.

<RadCartesianChart class="chart" [ngSwitch]="" tkExampleTitle tkToggleNavButton>
<RadCartesianChartGrid tkCartesianGrid horizontalLinesVisible="true" verticalStrokeColor="#804d0026"></RadCartesianChartGrid>
<LinearAxis tkCartesianVerticalAxis horizontalLocation="Left" android:labelFormat="%.0f"></LinearAxis>
<LinearAxis tkCartesianVerticalAxis horizontalLocation="Right" android:labelFormat="%.0f"></LinearAxis>
<DateTimeContinuousAxis tkCartesianHorizontalAxis dateFormat="hh:mm" [minimum]="backwardHour" [maximum]="forwardHour"
    majorStep="Hour" labelFitMode="Rotate"></DateTimeContinuousAxis>

<LineSeries tkCartesianSeries [items]="transformedReadings" stackMode="Stack" categoryProperty="timestamp" valueProperty="value"></LineSeries>  
<LineSeries tkCartesianSeries [items]="transformedReadings2" stackMode="Stack" categoryProperty="timestamp" valueProperty="value"></LineSeries>

This is an image of the output of the template: enter image description here

1

There are 1 answers

3
Ian MacDonald On

The NativeScript chart object only has properties for one horizontal axis and one vertical axis. So, even though you can technically jam in as many axis elements as you like inside the <RadCartesianChart> ... </RadCartesianChart>, the object itself will only accept one.

An improvement could be made to the docs in this manner. Also, detection of multiple vertical or multiple horizontal axes and then posting a warning console message would be helpful.

I think most of all, the you are looking for a useful feature that allows a multiple axis specification. I recommend posting it as a feature request on the feedback GitHub page: https://github.com/telerik/nativescript-ui-feedback/