Plotting missing values

363 views
Skip to first unread message

rp

unread,
Jul 12, 2010, 4:29:51 PM7/12/10
to jqplot-users
We have a lot of time series data with missing values. We can't
substitute zeroes for these values since zero can be a valid value and
it doesn't mean null/NULL/missing. Besides, the line graphs go zooming
to the bottom of the Y axis.

Instead, what we would want to do is to not plot the line between two
points if either of them have missing or empty data.

I've noticed that jqPlot can deal with one missing item in a series
but if there are more than one (and perhaps if they are contiguous), I
started getting faults (An invalid or illegal string was specified"
code: "12 http://fir/js/jquery.jqplot.js Line 4314 [this is in
ShapeRenderer.prototype.draw])

After fooling around for a bit, I think I see how these missing values
can cause errors in the code. There are at least three points where
data items are being used to construct lines on the canvas drawing
object (ctx). If I comment out these three lines my graphs will be
completed (without the connectors, of course.)

I'm thinking of putting a simple test in front of the line drawing
calls to make sure all items are present and just skipping the line
drawing when any of them are missing. Is this a good direction to go?

Chris Leonello

unread,
Aug 4, 2010, 6:44:35 PM8/4/10
to jqplot-users
Hi rp,

I apologize for not responding sooner. I saw the post a couple weeks
ago and have started integrating this functionality.

It is somewhat more involved than a test. There are plugin
compatibility issues and conversion of raw data to plotted data arrays
that need to be considered. In any case, I should have this working
for line charts in the next week or so. I don't plan to handle area
or bar charts presently, there are other complexities with the
stacking.

On Jul 12, 4:29 pm, rp <twobe...@gmail.com> wrote:
> We have a lot of time series data with missing values. We can't
> substitute zeroes for these values since zero can be a valid value and
> it doesn't mean null/NULL/missing. Besides, the line graphs go zooming
> to the bottom of the Y axis.
>
> Instead, what we would want to do is to not plot the line between two
> points if either of them have missing or empty data.
>
> I've noticed that jqPlot can deal with one missing item in a series
> but if there are more than one (and perhaps if they are contiguous), I
> started getting faults (An invalid or illegal string was specified"
> code: "12http://fir/js/jquery.jqplot.jsLine 4314 [this is in
Reply all
Reply to author
Forward
0 new messages