关于 jquery:jqPlot Pie Chart – 去除数据标签背景

jqPlot Pie Chart - remove data label backgrounds

见下图;目标是删除标签的背景(即透明背景)。我一直在上下 jqPlot 文档和 API,尝试各种设置组合......甚至试图覆盖我认为是源 CSS 类的内容:

jqPlot

有一点是,这只发生在我尝试渲染饼图时……任何其他类型的图表都会自动显示没有背景的标签。这是我的代码的基本迭代,已从所有实验中清除:

相关包括:

1
2
3
4
// excanvas.js
// jquery.jqplot.min.js
// plugins/jqplot.pieRenderer.min.js
// jquery.jqplot.css

JQ:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
$.jqplot('PIE', [[["CE",14],["CNB",0],["CD",10],["BD",197],["PD.",9],["AO",68]]],
{
grid:
    {
    drawBorder:false,
    shadow:false,
    },
gridPadding:{top:0,right:0,bottom:0,left:0},
seriesColors:["#2D8659","#862D2D","#2D8686","#2D2D86","#59862D","#B4B43C"],
legend:{show:true},
seriesDefaults:
    {
    renderer:$.jqplot.PieRenderer,
    rendererOptions:
        {
        showDataLabels:true,
        dataLabelPositionFactor:.75,
        shadowOffset:0,
        lineWidth:3,
        sliceMargin:4,
        startAngle:-90,
        highlightMouseOver:false,
        padding:10
        }
    }
});

提前感谢所有有用的回复!


看这个

它有效

小提琴

代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
$.jqplot('pieChart', [[["CE",14],["CNB",0],["CD",10],["BD",197],["PD.",9],["AO",68]]],
{
grid:
    {
    drawBorder:false,
    shadow:false

    },
gridPadding:{top:0,right:0,bottom:0,left:0},
seriesColors:["#2D8659","#862D2D","#2D8686","#2D2D86","#59862D","#B4B43C"],
legend:{show:true},
seriesDefaults:
    {
    renderer:$.jqplot.PieRenderer,
    rendererOptions:
        {
        showDataLabels:true,
        dataLabelPositionFactor:.75,
        shadowOffset:0,
        lineWidth:3,
        sliceMargin:4,
        startAngle:-90,
        highlightMouseOver:false,
        padding:10
        }
    }
});