flex LineChart怎么实现两个Y轴不同单位的曲线
1个回答
展开全部
<mx:LineChart id="roomChart" dataProvider="{chartDataList}" showDataTips="true" width="90%" top="40" horizontalCenter="0" fontSize="14">
<mx:horizontalAxis>
<mx:CategoryAxis id="hor" categoryField="updateTime" title="时间" padding="0.5"/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderers>
<mx:AxisRenderer axis="{hor}" canDropLabels="true"/>
</mx:horizontalAxisRenderers>
<mx:verticalAxisRenderers>
<mx:AxisRenderer placement="left" axis="{v1}"/>
<mx:AxisRenderer placement="right" axis="{v2}"/>
</mx:verticalAxisRenderers>
<mx:series>
<mx:LineSeries yField="tempData" displayName="时间/温度(℃)" horizontalAxis="{hor}">
<mx:verticalAxis>
<mx:LinearAxis id="v1" title="温度" baseAtZero="false" maximum="40" minimum="-10"/>
</mx:verticalAxis>
</mx:LineSeries>
<mx:LineSeries yField="humiData" displayName="时间/湿度(%)" horizontalAxis="{hor}">
<mx:verticalAxis>
<mx:LinearAxis id="v2" title="湿度" baseAtZero="true" maximum="100" minimum="0"/>
</mx:verticalAxis>
</mx:LineSeries>
</mx:series>
</mx:LineChart>
------------------------------
对象数组,里面的对象是:
public var updateTime:String;
public var tempData:String;
public var humiData:String;
<mx:horizontalAxis>
<mx:CategoryAxis id="hor" categoryField="updateTime" title="时间" padding="0.5"/>
</mx:horizontalAxis>
<mx:horizontalAxisRenderers>
<mx:AxisRenderer axis="{hor}" canDropLabels="true"/>
</mx:horizontalAxisRenderers>
<mx:verticalAxisRenderers>
<mx:AxisRenderer placement="left" axis="{v1}"/>
<mx:AxisRenderer placement="right" axis="{v2}"/>
</mx:verticalAxisRenderers>
<mx:series>
<mx:LineSeries yField="tempData" displayName="时间/温度(℃)" horizontalAxis="{hor}">
<mx:verticalAxis>
<mx:LinearAxis id="v1" title="温度" baseAtZero="false" maximum="40" minimum="-10"/>
</mx:verticalAxis>
</mx:LineSeries>
<mx:LineSeries yField="humiData" displayName="时间/湿度(%)" horizontalAxis="{hor}">
<mx:verticalAxis>
<mx:LinearAxis id="v2" title="湿度" baseAtZero="true" maximum="100" minimum="0"/>
</mx:verticalAxis>
</mx:LineSeries>
</mx:series>
</mx:LineChart>
------------------------------
对象数组,里面的对象是:
public var updateTime:String;
public var tempData:String;
public var humiData:String;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询