Add valueSpots to my Line graph

266 views
Skip to first unread message

Joseph Nammour

unread,
Feb 19, 2013, 10:50:17 AM2/19/13
to jquery-s...@googlegroups.com
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?

Scott Carpenter

unread,
Mar 31, 2017, 11:20:50 AM3/31/17
to jQuery Sparkline
I'm having a similar issue, anyone have suggestions

I'm implementing the valuespots either at the html tag level or at the jquery level and each one seems to do nothing
Reply all
Reply to author
Forward
0 new messages