gwatts / jquery.sparkline

A plugin for the jQuery javascript library to generate small sparkline charts directly in the browser
http://omnipotent.net/jquery.sparkline/
1.24k stars 278 forks source link

valueSpots option does not work in HTML tag #194

Closed pjd25 closed 7 years ago

pjd25 commented 7 years ago

I have the following code:

$('.sparklines').sparkline('html', { enableTagOptions: true});

But this does not display the valueSpots.

However if I include the valuespots option in the function, they do work:

$('.sparklines').sparkline('html', { enableTagOptions: true, valueSpots: '{'0': '#ffffff'}'});

I believe this is a bug that valueSpots option does not work when in a tag option.

gwatts commented 7 years ago

Works fine for me: https://jsfiddle.net/gwatts/wdhkLgds/2/

pjd25 commented 7 years ago

Seems only for single values like in your example. How can we get this to work for say all values > 50?

In the normal options it would be {'50:': 'red'} which when converting to your example format would be {50::red} (note the double ::) but this doesn't work.