jqplot 和图例选项问题

标签 jqplot

我的代码中有以下内容。有选择权

 legend: {show:true}  

把图表搞得一团糟。图例部分好长 而且没有图表。 我在此处粘贴了图表外观的图片: http://tinypic.com/view.php?pic=2eqgbgy&s=7

尽管没有图例选项也能正常显示,但图表当然没有图例。

在 Chrome 中我看到以下异常 Uncaught Error :INDEX_SIZE_ERR:DOM 异常 1

<script type="text/javascript"> 
        line2 = [['Living Expenses',1000], ['Loans',2000], ['Credit 
Card',500]]; 
    $j(document).ready(function() { 
        $j.jqplot.config.enablePlugins = true; 
        $j.jqplot('piechartdiv', [line2], { 
            title: 'Where is my money going?', 
            seriesDefaults:{renderer:$j.jqplot.PieRenderer, 
rendererOptions:{sliceMargin:8}}, legend:{show:true} 
        }); 
}); 

</script> 

<div style="width: 450px;margin: 0px auto;"> 
    <div id='piechartdiv'></div> 
</div> 

感谢任何帮助。

最佳答案

你在使用 Bootstrap还是其他一些 CSS 重置库?

如果您进入 Firebug ,并选择 <table class="jqplot-table-legend" ...>元素,你可能会看到有一个 width:100%默认属性设置 table元素。您可以在 CSS 布局中修复它:

#piechartdiv table.jqplot-table-legend {
    width:auto;
}

关于jqplot 和图例选项问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4181427/

相关文章:

javascript - JQPlot:如何在不同位置重新绘制

jquery - JQplot : blank chart when print IE

javascript - 当我们键入多动态数组的静态内容并创建数组数组时有什么区别

javascript - 为 Google 图表(线)中的每个列值定义标签

jqPlot垂直轴标签未垂直渲染

javascript - 通过缩放 Canvas 单击点标签

javascript - 如何使用 jQPlot 在 yaxis = 0 处画一条线?

jquery - jqplot 突出显示堆积柱形图

jquery - 如何自定义 JQPlot 周围的黑色边框

javascript - 为什么 jQPlot dateAxisRenderer 不能正常工作?