我有javascript代码:
var plot1 = jQuery.jqplot ('chartdiv', [data],
{
seriesDefaults: {
// Make this a pie chart.
renderer: jQuery.jqplot.PieRenderer,
rendererOptions: {
// Put data labels on the pie slices.
// By default, labels show the percentage of the slice.
showDataLabels: true,
dataLabels: 'value'
}
},
legend: { show:true, location:'e'}
});
var handler = function(ev, gridpos, datapos, neighbor, plot) {
if (neighbor) {
alert('x:' + neighbor.data[0] + ' y:' + neighbor.data[1]);
}
};
$.jqplot.eventListenerHooks.push(['jqplotClick', handler]);
Run Code Online (Sandbox Code Playgroud)
现在通过使用dataLabels:'value'我能够显示值,但显示的值是51而不是50.667.Value是舍入的.但我需要显示确切的值.如何?
我的第二个问题是,当我在图表的任何区域上有鼠标指针时,我想要显示一些东西.那将使用jqplotDataMouseOver完成但是如何使用它?在此先感谢.Plz紧急回应.