jqplot饼图无法正确呈现.

Jus*_*tin 4 jquery jquery-plugins jqplot

获取日志消息:饼的直径太小,无法渲染.

然后,当我在页面内悬停或点击时,我得到:未捕获的TypeError:无法读取未定义的属性"0"

    <link href="/Content/jqPlot/jquery.jqplot.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery.jqplot.js" type="text/javascript"></script>
    <script src="/Scripts/jqplot.pieRenderer.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(function () {
            //GetWeeklyProjectSummary();
            Test();
        });

        function Test() {
            var data = [["987 Project",74],["ABC Project",68],["XYZ project",26]];
            var plot1 = jQuery.jqplot('weeklyProjectSummary', [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
                        }
                    },
                    legend: { show: true, location: 'e' }
                }
              );
        }
    </script>
Run Code Online (Sandbox Code Playgroud)

这是它进入的div:

<div id="weeklyProjectSummary"></div>
Run Code Online (Sandbox Code Playgroud)

这是我在页面上得到的内容: 页面输出

如果您需要更多详细信息,请与我们联系.

ots*_*tso 11

当使用jqplot和blueprintcss时我有类似的问题 - 基于你的屏幕截图我相信你正在使用blueprintcss.

尝试删除以下行:

legend: { show: true, location: 'e' }
Run Code Online (Sandbox Code Playgroud)

并查看它是否正确呈现.

(编辑:更多信息:

https://bitbucket.org/cleonello/jqplot/issue/48/legends-doesnt-look-nice-when-using)