PDA

View Full Version : How to get chart to skip displaying missing data points?



JakeLatham
5 Sep 2012, 12:31 PM
All -

I have a time-based chart with several lines on it, with dates along the X-axis.

One of my series is historical, and only has data for about half of the chart. The value in each record in the store from current day forward is null. However, the chart is still drawing the point as a zero.

I would like the chart to simply not draw missing data points - is this possible? I've seen something similar in screenshots from ExtJS 3, but cannot get ExtJS 4 to behave the same way.

I've set the field up like so:


....
{ name: 'Act', type: 'float', defaultValue: null, useNull: true },
...


but I still get the chart drawing the line, despite the tooltip verifying the value for that point/field is null.

Thanks for any thoughts on how to configure the model and/or chart.

Cheers,

-Jake

JakeLatham
10 Sep 2012, 11:59 AM
Thought I'd bump this fellow back up again - I'm hoping I'm not the only guy who needs something like this :D

-Jake

scottmartin
11 Sep 2012, 8:10 AM
You can use undefined to halt the drawing. If you need a gap, then you will need to create a new series.

Scott.

JakeLatham
13 Sep 2012, 1:58 PM
Scott -

Thanks for the reply.

Is there a built-in way to get the float field converter to allow 'undefined' as a value?

For example, in the model, if I set up the field with:



{ name: 'Act', type: 'float', defaultValue: null, useNull: true },
or
{ name: 'Act', type: 'float', defaultValue: undefined, useNull: true },


a value of undefined gets converted to null. if I remove the "useNull: true", then undefined gets converted to zero.

I can configure the field like so:



{name: 'Act', type: 'float', defaultValue: undefined, useNull:true, convert: null },


which does work, but then values coming in (from JSON in this case) are not parsed from "123" to 123 (or whatever).

Should I override the convert function to get what I'm looking for?

Would be handy to have a "useUndefined" or something I guess, at least for the charting situation.

-J

scottmartin
24 Sep 2012, 1:05 PM
You would need to create an override.

Scott.