在弹性图表中使用双垂直轴有问题吗?
我在单个 LineChart 上绘制两条线系列,它们共享相同的水平轴,但在图表的左侧和右侧具有不同的垂直轴:
<mx:LineChart id="linechart1" width="100%" height="100%" showDataTips="true" seriesFilters="[]">
<mx:horizontalAxis>
<mx:DateTimeAxis displayLocalTime="true" dataUnits="seconds" labelUnits="seconds"/>
</mx:horizontalAxis>
<mx:verticalAxisRenderers>
<mx:AxisRenderer placement="left" axis="{Vaxis1}" />
<mx:AxisRenderer placement="right" axis="{Vaxis2}"/>
</mx:verticalAxisRenderers>
<mx:series>
<mx:LineSeries xField="DateTime" yField="Price1">
<mx:verticalAxis>
<mx:LinearAxis baseAtZero="false" id="Vaxis1" autoAdjust="false"/>
</mx:verticalAxis>
</mx:LineSeries>
<mx:LineSeries id="agentlegend" xField="DateTime" yField="Price2">
<mx:verticalAxis>
<mx:LinearAxis id="Vaxis2" baseAtZero="false" autoAdjust="false"/>
</mx:verticalAxis>
</mx:LineSeries>
</mx:series>
</mx:LineChart>
在第一个 Vaxis 中, Price1 在 20 到 25 之间变化。而在第二个 Vaxis 中Price2 在 20 到 25 之间变化,但偶尔会为零。当 Price2 一次跌至零时,整个图表将调整为 2 条直线,没有价格变化的细粒度视图。我希望左侧 Vaxis 的缩放与右侧 Vaxis 值的价格变化无关。
我知道您可以通过独立设置两个图表的最大值和最小值来做到这一点。但是,我有大量的实时数据进来,为我得到的每次更新动态设置图表的最小值和最大值并重新绘制它将是一个坏主意。
无论如何,是否可以在不设置 max 和 min 的情况下执行此操作,我认为默认情况下 Flex 提供了根据 http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_12.html
谢谢 三雷6
I am plotting two line series on a single LineChart which share the same horizontal axis, but have different vertical axis on the left and right of the chart:
<mx:LineChart id="linechart1" width="100%" height="100%" showDataTips="true" seriesFilters="[]">
<mx:horizontalAxis>
<mx:DateTimeAxis displayLocalTime="true" dataUnits="seconds" labelUnits="seconds"/>
</mx:horizontalAxis>
<mx:verticalAxisRenderers>
<mx:AxisRenderer placement="left" axis="{Vaxis1}" />
<mx:AxisRenderer placement="right" axis="{Vaxis2}"/>
</mx:verticalAxisRenderers>
<mx:series>
<mx:LineSeries xField="DateTime" yField="Price1">
<mx:verticalAxis>
<mx:LinearAxis baseAtZero="false" id="Vaxis1" autoAdjust="false"/>
</mx:verticalAxis>
</mx:LineSeries>
<mx:LineSeries id="agentlegend" xField="DateTime" yField="Price2">
<mx:verticalAxis>
<mx:LinearAxis id="Vaxis2" baseAtZero="false" autoAdjust="false"/>
</mx:verticalAxis>
</mx:LineSeries>
</mx:series>
</mx:LineChart>
In the first Vaxis , the Price1 varies between 20 to 25 .while , in the second Vaxis Price2 varies anywhere between 20 to 25 but occasionally has a zero value . When Price2 drops to zero for once , the whole chart adjusts into 2 straight lines with no granular view of the price changes . I want scaling on left Vaxis independent of the price change in Right Vaxis values .
I know you can do this by setting maximum and minimum for both charts independently . But , i have huge amounts of real time data coming in , setting the charts minimum and maximum dynamically for each update i get and redrawing it will be a bad idea .
Is there anyway to do this without setting the max and min , i thought by default flex provided the feature to scale the two Vaxis independently according to http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_12.html
Thanks
sanre6
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论