Flex: Showing one data point on a line chart
March 18, 2008 12 Comments
(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):
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.
very nice!
good work
Good to see you have a blog up and running. I am sure your input will be great for the community!
Kyle: TNX.
that is a real compliment when it comes from genuine Senior Engineer on the Adobe Flex team.
any sign of a solution using sdk 3.0.0?
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
lineSegmentRenderer and itemRenderer are renderers for two different components!
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.
Sorry again – the code I’m posting isn’t coming out – just replace
lineSegmentRenderer=”components.MyRenderer”
with
itemRenderer=”mx.charts.renderers.CircleItemRenderer”
Any work around for SDK 3.0?
Thanks, man!
Hi
I’m Getting the following error, Any ideas??
Implicit coercion of a value of type Class to an unrelated type mx.core:IFactory
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.