Scatter plots - the suggestions
Ok, continuing from
viewtopic.php?f=1&t=64 :
I've done a few experiments with the scatter plot in 1.27, which does seem to fit my data pretty well, at least in theory. The 1.27 scatter plots are the only ones I've used, and I will base my suggestions on my experiments with them.
My data is very sparse. It has minute resolution, and span at least 24 hours, up to one week; that's between 1440 and 10080 points, of which the count of actual values are in the tens or so. The rest is VOID.
If you use a line chart, a data set of
25 => 3,
1087 => 5,
9967 => 2
would have to be expanded to
<24 x VOID>,
25 => 3,
<1061 x VOID>,
1087 => 5,
<8879 x VOID>,
9967 => 2,
<112 x VOID>
to cover all 10080 points for one week. That takes time to fill and draw. With a scatter plot, one could simply feed the minutes into the X axis, and the values into the Y axis, have three data points drawn, and be done with it.
I ran into a few limitations with the 1.27 version, and thought I'd share a few thoughts on how it could be expanded. My apologies if any of these points already have been taken care of or already is planned:
1) setFixedScale() is nice. It allows me to, for example, set the X scale to 0-1440, allowing for exactly 24 hours of data to be shown. If I set the X scale to 0-24 and divide the minutes by 24, I automatically get labels for 0-24, still with minute resolution when plotting.
This lead to the first suggestion: Formatting support for the labels. Hours ranging from 00 to 24, with %02d, would look better.
If I wanted to show a whole week in this way, I'd get an X axis ranging from 0 to 168. Modulo 24 would be useful here, giving labels ranging from 00-23, repeating seven times.
2) The line plot supports an array containing axis labels. If the scatter plot supported the same mechanism, point 1 above would probably become irrelevant, as one could pre-compute all the labels before drawing the chart.
Provided, of course, that the label array could be "scatter plotted", much in the same way a scatter plot works.
array(0 => "00\nDay 1", 60 => "01", 120 => "02", 180 => "03", 240 => "04", ...)
could create an X axis with minute resolution and one label every hour.
3) I thought I had more suggestions... Oh well, it would be nice if it supported lines, splines, dots and all that, too, obviously.