我有一个使用 JqPlot 显示的饼图。我有兴趣改变切片的实际颜色,到目前为止还没有运气。
我遇到了这个链接并尝试了解决方案,但我不确定我是否将它放在错误的位置(尝试将它插入代码中的几个位置),因为当我将它放入时,饼图没有更长的显示(实际上阻止页面上的其余图表显示)。
这是饼图的javascript代码:
$(document).ready(function () {
        var data = [['US',33], ['IE',30], ['GB',23], ['AU',7], ['CA',4], ['RoW',7]];
        var plot1 = jQuery.jqplot('Countries', [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.
                    sliceMargin: 5,
                    showDataLabels: true,
                }
            },
            legend: { show: true, border: false, /*placement: 'outsideGrid', location: 'w'*/location: 'e', border: 'none' },
            grid: {borderWidth:0, shadow:false, background: '#FFFFFF'}
        }
      );
    });
有没有人有任何想法?