Thank you in advance for any help you may be able to give me.
I am trying to dynamically create sparkline graphs using data from my database. I was able to bring in all the data and display the sparkline graph but the problem I am having is I want to add specific valueSpots to highlight certain points. If I do the following my data comes out correctly.
var range_map = $.range_map({
16.7: 'red',
81.2: 'green',
})
$('.inlinebar').sparkline('html', {type: 'line', enableTagOptions: true, fillColor: false, minSpotColor: false, maxSpotColor: false, spotRadius: '3', spotColor: false, valueSpots:range_map,} );
but, the minute I try to change the numbers into a variable so that it can be dynamic it no longer works.
This does not work.
var var4 = 16.7;
var range_map = $.range_map({
var4: 'red',
})
$('.inlinebar').sparkline('html', {type: 'line', enableTagOptions: true, fillColor: false, minSpotColor: false, maxSpotColor: false, spotRadius: '3', spotColor: false, valueSpots:range_map,} );
Any ideas on what I am doing wrong?