【问题标题】:jqPlot Pie Chart - remove data label backgroundsjqPlot 饼图 - 删除数据标签背景
【发布时间】:2013-02-27 10:50:43
【问题描述】:

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

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

相关包括:

// excanvas.js
// jquery.jqplot.min.js
// plugins/jqplot.pieRenderer.min.js
// jquery.jqplot.css

JQ:

$.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
        }
    }
});

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

【问题讨论】:

    标签: jquery jqplot


    【解决方案1】:

    看到这个

    有效

    FIDDLE

    代码

    $.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
            }
        }
    });
    

    【讨论】:

    • 确实可以。谢谢先生-您间接帮助我解决了问题!我们以前的编辑器将所有 DIV 全局设置为具有#FFF 背景...直到我查看了您示例中的 CSS,我才弄清楚这一点。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-05-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多