I’m trying to feed a Scatter plot written in JavaScript with two dimensions with decimal values. I’m taking these values from a MySQL db and I’m feeding the graph with them using Php. My db has almost 150000 entries, which corresponds to 150000 pairs of decimal inputs in the graph. After running my code, the graph is not visualised. I got the output from my Php code and pasted it into the JavaScript code, it shows something is wrong, but it doesn’t say what (I’m using Dreamweaver). If I use only 3 pairs of decimal inputs for the graph, everything is visualised normally.
My question is: is there a limit on how many values can you visualise in Scatter plots?
I’m now using the scatter plot from the Highcharts library. I also tried the Scatter plot from the Google Chart Tools API, but I get the same outcomes.
My code, feeding the graph in JS using Php is:
data: [<?php
for($j=0;$j<$i1;$j++)
{
if($females[$j]['Hour']=="00")
$females[$j]['Hour']="0";
echo "[".$females[$j]['Hour'].".".$females[$j]['Min'].",".$females[$j]['Sent']."]";
if(($j+1)!=$i1)
{
echo ",";
}
}
?>]},
What works is:
data: [[0.3,-0.1623],[0.4,-0.1840],[0.5,-0.1555]]},
Thank you.
Sure: The size of the plot. Once you have filled the full area, there is no need to draw further points. Just reduce the amoutn of data to draw, e.g. by outputting only every fifth value. You can also use some algorithms to compute the average values and only display them.
Next, there is the dynamic drawing. Especially on older clients it will last much longer to draw all points. Drawing the chart serverside and shipping an image to the client should work better, especially if the chart does not need to be interactive.
Also, you would carry the whole data set to the client. There are bandwith limitations. How many GigaBytes does your file count?
Conclusion: 150000 points is far too much.