我想为 s1 donut添加 dataLabels标签,为 s2 添加 dataLabels百分比或不添加标签。我该怎么做?
function drawDonut(chartId){
var s1 = [['a',6], ['b',8], ['c',14], ['d',20]];
var s2 = [['e', 6], ['f', 8], ['g', 14], ['h', 20]];
var plot = $.jqplot(chartId,[s1,s2], {
seriesDefaults: {
// make this a donut chart.
renderer:$.jqplot.DonutRenderer,
rendererOptions:{
// Donut's can be cut into slices like pies.
sliceMargin: 0,
dataLabelThreshold: 0,
// Pies and donuts can start at any arbitrary angle.
startAngle: -90,
showDataLabels: true,
// By default, data labels show the percentage of the donut/pie.
// You can show the data 'value' or data 'label' instead.
dataLabels: 'label'
}
}
}