kokarn / flot-imagesymbol

Flotcharts (http://www.flotcharts.org/) plugin to enable custom images for each point
MIT License
0 stars 0 forks source link

The flot points does not have corresponding image #1

Open kokarn opened 10 years ago

kokarn commented 10 years ago

The problem right now is that each point doesn't have it's image set to it but it's just another array with corresponding indexes and images.

The problem is easy to spot if you use another plugin, such as the curvedLines one that creates a lot more points to make the curve look better.

Reduced test case: http://jsfiddle.net/dNeA7/2/

The problem is that when the flot main library calls each symbol to be draw it just does that with

series.points.symbol( ctx, x, y, radius, shadow );

which makes it hard to add additional data.

Suggestions? @gyran @jwilsson

Gyran commented 10 years ago

One solution would be to add a option to only draw the image every n'th point. Or a option to specify minimum x/y distance between two images

kokarn commented 10 years ago

Neither of those would really change the fact that it's just specific points you want to have images.

Because you don't know if another plugin will change the points and how many points they will add that doesn't really work and because the distance between a points might change the x/y alternative won't work great either.

I've also updated the fiddle so its about 3000 less lines of js.... :dancer:

http://jsfiddle.net/dNeA7/2/

Gyran commented 10 years ago

I would say that your plugin works correctly, but to get the plot you want to have I would suggest that you draw 1 series with curvedLines and one without.

http://jsfiddle.net/yg669/