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 + ""; } });
Comments
Post a Comment