Flex: Showing one data point on a line chart

(first one)
i had a requirement for a line chart:
show a point when you have only one data point.

now… this may sound logically wrong as (we all know) a line must have at least 2 point to be drawn: start point and end point.
but in our application even if the chart have only 1 data point it is vitally important, so it must be seen on the screen.

here is what i did (with much respect to the help of Kyle from Adobe):

demo is here
source is here

p.s. sdk is 2.0.1 hotfix 3… not working (yet) with sdk 3 – i will fix it when i’ll have the time.

12 Responses to Flex: Showing one data point on a line chart

  1. jahman says:

    very nice!
    good work

  2. Kyle says:

    Good to see you have a blog up and running. I am sure your input will be great for the community!

  3. shemesh says:

    Kyle: TNX.
    that is a real compliment when it comes from genuine Senior Engineer on the Adobe Flex team.

  4. urckle says:

    any sign of a solution using sdk 3.0.0?

  5. kenkc says:

    In sdk 3.1.0, there’s no need for a custom lineSegmentRenderer. Just set an itemRenderer …..

    I’m not certain, but I suspect 3.0.0 is similar

  6. shemesh says:

    lineSegmentRenderer and itemRenderer are renderers for two different components!

  7. kenkc says:

    Sorry shemesh – should have explained better.

    In SDK 3.1.0, if you replace your code for the LineSeries with something like ….

    then you should get pretty much the same result.

  8. kenkc says:

    Sorry again – the code I’m posting isn’t coming out – just replace

    lineSegmentRenderer=”components.MyRenderer”

    with

    itemRenderer=”mx.charts.renderers.CircleItemRenderer”

  9. Yogesh says:

    Any work around for SDK 3.0?

  10. nash says:

    Thanks, man!

  11. Kumar says:

    Hi

    I’m Getting the following error, Any ideas??

    Implicit coercion of a value of type Class to an unrelated type mx.core:IFactory

    • Ranjith Ramasamy says:

      With one data point, how can we see the datatip. Right now, it not showing the data tips in demo. Another stuff we have (i.e) x-axis label place away from its actual place of its data points. It displayed left most position. How can we fix those problems.

Leave a reply to urckle Cancel reply