关于Highcharts饼图的颜色填充

2025-03-10 22:18:31
推荐回答(1个)
回答1:

很简单,我给你代码





Highcharts Example



$(function () {
    $('#container').highcharts({
        chart: {
            plotBackgroundColor: null,
            plotBorderWidth: null,
            plotShadow: false
        },
        colors:[
         'red',//第一个颜色,欢迎加入Highcharts学习交流群294191384
         'blue',//第二个颜色
         'yellow',//第三个颜色
        '#1aadce', //。。。。
   '#492970',
   '#f28f43', 
   '#77a1e5', 
   '#c42525', 
   '#a6c96a'
       ],
        title: {
            text: 'Browser market shares at a specific website, 2010'
        },
        tooltip: {
         pointFormat: '{series.name}: {point.percentage:.1f}%'
        },
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                dataLabels: {
                    enabled: true,
                    color: '#000000',
                    connectorColor: '#000000',
                    format: '{point.name}: {point.percentage:.1f} %'
                }
            }
        },
        series: [{
            type: 'pie',
            name: 'Browser share',
            data: [
                ['Firefox',   45.0],
                ['IE',       26.8],
                ['Opera',     6.2],
            ]
        }]
    });
});






截图

相关问答