7
我的JavaScript代码的区域值:如何显示在jqplot图表,而不是百分比
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]);
现在通过使用dataLabels:“值”我能显示值,但显示值51而不是50.667。价值圆了。但我需要显示确切的价值。如何?
我的第二个问题是,当我在图表的任何区域上有鼠标指针时,我想显示一些东西。这就是使用jqplotDataMouseOver完成的,但是如何使用它? 在此先感谢。Plz紧急响应。
请给我一些想法。 – ryan 2012-04-04 14:07:01