jquery getting x values in sparkline -


i new jquery , trying make sparkline. want when mouse points point in graph, both x-value , y-value should seen. now, y-values visible.

<script>     $(document).ready(function () {         $("#sparkline").sparkline([1, 4, 6, 6, 8, 5, 3, 5], {             type: 'line',             height: '200',             width: '240',             barwidth: 20,             barspacing: 10,             barcolor: '#615c5a',             fillcolor:"white"         });     }); </script> 

you can try this:

$('#sparkline').sparkline([1, 4, 6, 6, 8, 5, 3, 5], {         type: 'line',         height: '200',         width: '240',         barwidth: 20,         barspacing: 10,         barcolor: '#615c5a',         fillcolor:"white",                   tooltipformatter: function (sparkline, options, fields) {          return "x: " + fields.x + " y: " + fields.y + "";         }  }); 

demo


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - Chrome Extension: Interacting with iframe embedded within popup -