开发者

Show a threshold line in Flex Chart

I am stuck with a requirement to display a horizo开发者_开发知识库ntal line on a ColumnChart to indicate a threshold level. I have the data to the Chart as an ArrayCollection.

Show a threshold line in Flex Chart

So my question here : Is it possible to get the location of a value that is shown on the y axis? I think I will be able to place a line or 1px high canvas on top of the Chart to achieve this. Or better, is there any built in functionality that i may have overlooked or is there some open library that can achieve something like this?


The easiest solution is to add a LineSeries to your chart which has the same value on the Y-axis for each item on the X-axis.

Your dataprovider could be produced as follows, with the column chart using "result" for its yField and the line chart using "threshold" as its yField.

<dataset>
  <dataitem>
     <time>16:00</time>
     <result>170</result>
     <threshold>350</threshold>
  </dataitem>
  <dataitem>
     <time>17:00</time>
     <result>430</result>
     <threshold>350</threshold>
  </dataitem>
  <dataitem>
     <time>18:00</time>
     <result>250</result>
     <threshold>350</threshold>
  </dataitem>
</dataset>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜