-
13 Aug 2012 9:33 AM #1
Chart with breaks
Chart with breaks
I want to draw line chart with breaks in that. The problem statement is to draw line chart after getting data from server and if any data retrieval fails, there would be a break in line and an error icon is shown just below x-axis for it.
I was thinking to break the line and put scatter on those points with image.
My y-axis is NumericAxis. Should I need to convert it to CategoryAxis as NumericAxis is not allowing to give null data point.
-
13 Aug 2012 10:36 AM #2
You may use a NumericAxis and add Double.NaN to insert a break.
Best regards,
Arkady.
-
13 Aug 2012 3:56 PM #3
The second example in this blog post is what you are looking for: http://www.sencha.com/blog/building-gxt-charts/
-
14 Aug 2012 3:31 AM #4
Thanks
I was able to solve this.
Though it didn't solve my purpose fully.
I am trying to get a chart like this:
chart-target.PNG
But I am getting chart like this:
chart.jpg
The fill is not proper and it is also appearing where there is break in line.
I have added the following line to code:
Code:series.setFill(new RGB(166, 17, 32));
I have written the following but its not helping me.
Please tell me what I am missing.Code:series.setFillRenderer(new SeriesRenderer<Data>() { @Override public void spriteRenderer(Sprite sprite, int index, ListStore<Data> store) { if(store.get(index).getData()==Double.NaN) { System.out.print(store.get(index).getData()); sprite.setFill(Color.NONE); } else sprite.setFill(new RGB(166, 17, 32)); } });
Thanks,
Abhinav


Reply With Quote