Jquery sparklines: Possible to have different tooltips? -


i'm using jquery sparklines (http://omnipotent.net/jquery.sparkline) display line graph each tick in graph corresponds hour interval of current day. i've formatted tooltip such:

<span style=\"color: {{color}}\">&#9679;</span> {{offset:names}} - {{y}}{{suffix}}</span> 

where offset:names corresponds hour of day (0 = 00:00, 1 = 01:00) etc.

the graph updates live data. problem if point in future, don't want display {{y}} value in tooltip - time of day. possible this? if not there way same effect?

found it! using tooltipformatter, did this:

sparkopts.currenttimegroup = currenttimegroup;   sparkopts.tooltipformatter = function(sparklines, options, point)   {     if(point.x <= options.mergedoptions.currenttimegroup)       return "<div class=\"jqsfield\"><span style=\"color: " + point.color + "\">&#9679;</span>" + options.get("tooltipvaluelookups").names[point.x] + " - " + point.y + options.get("tooltipsuffix") + "</div>";     else       return "<div class=\"jqsfield\"><span style=\"color: " + point.color + "\">&#9679;</span>" + options.get("tooltipvaluelookups").names[point.x] + "</div>";   }; 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -