如何在Nativescript中显示两个线性轴?

时间:2018-09-24 14:17:16

标签: nativescript angular2-nativescript

我有一个LineSeries和一个BarSeries,并且我需要两个使用两个Y轴。如何在Nativescript angular中实现这一目标?

1 个答案:

答案 0 :(得分:0)

您可以通过HTML设置多个轴,如下所示:

<RadCartesianChart tkExampleTitle tkToggleNavButton>
    <LinearAxis tkCartesianVerticalAxis horizontalLocation="Left"></LinearAxis>
    <CategoricalAxis tkCartesianHorizontalAxis verticalLocation="Down"></CategoricalAxis>

    <LineSeries tkCartesianSeries seriesName="RateA" [items]="rateA" stackMode="Stack" categoryProperty="Country" valueProperty="Amount"></LineSeries>
    <LineSeries tkCartesianSeries seriesName="RateB" [items]="rateB" stackMode="Stack" categoryProperty="Country" valueProperty="Amount"></LineSeries>
    <LineSeries tkCartesianSeries seriesName="RateC" [items]="rateC" stackMode="Stack" categoryProperty="Country" valueProperty="Amount"></LineSeries>
    <BarSeries tkCartesianSeries seriesName="Total" [items]="total" stackMode="Stack" categoryProperty="Country" valueProperty="Amount">
        <LinearAxis tkBarVerticalAxis horizontalLocation="Right"></LinearAxis>
    </BarSeries>
</RadCartesianChart>

完整示例可见here