niyaz18 / flot

Automatically exported from code.google.com/p/flot
MIT License
0 stars 0 forks source link

Support for discontinuous index of array #686

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
ex1) array index: 1,2,3,4,5,6,7,8,,,
graph is not broken.

ex2) array index: 1,2,3,5,6,7,8,,,,
graph is broken.

If we delete some elements of array, graph is broken. So I fixed it in the flot 
version 0.7.

Please see my attached files.

Original issue reported on code.google.com by pandaz...@gmail.com on 12 Apr 2012 at 4:34

Attachments:

GoogleCodeExporter commented 8 years ago
example code of the zooming.html

var startData = getData(0, 3 * Math.PI);

delete startData[0]['data'][11];
delete startData[0]['data'][12];
delete startData[0]['data'][13];

var plot = $.plot($("#placeholder"), startData, options);

Original comment by pandaz...@gmail.com on 12 Apr 2012 at 4:38

GoogleCodeExporter commented 8 years ago
The problem is that you're using JavaScript's 'delete', which doesn't actually 
remove the array element; it just sets it to null.  Flot, by design, treats 
nulls as gaps in the line.

So this isn't a bug in Flot; you should use 'splice' instead of delete, so the 
unwanted elements are actually removed.

Original comment by dnsch...@gmail.com on 9 May 2012 at 1:00

GoogleCodeExporter commented 8 years ago

Original comment by dnsch...@gmail.com on 4 Jun 2012 at 2:38