let dataValue1=['香蕉', 8], ['猕猴桃', 3], ['桃子', 1], ['橘子', 6], ['苹果', 8], ['梨', 4], ['柑橘', 4], ['橙子', 1], ['葡萄', 1]
	    let option = {
            chart: {
                type: 'pie',
                options3d: {
                    enabled: true,
                    alpha: 60,
                    beta: 0
                },
                backgroundColor: 'none'
            },
            title: {
                floating: true,
                verticalAlign: 'middle',
                x: -50,
                useHTML: true,
                text: ''
            },
            tooltip: {
                pointFormat: '{point.percentage:.1f}%',
                style: {
                    textOutline: "0px 0px contrast",
                    fontSize: 14,
                    color: "#000",
                    fontFamily: "SourceHanSansCN-Normal"
                }
            },
            legend: {
                enabled: true,
                layout: 'vertical',
                verticalAlign: 'middle',
                align: 'right',
                useHTML: true,
                itemStyle: {
                    color: "#fff",
                    fontWeight: 'normal',
                    fontFamily: '宋体'
                },
            },
            colors: ['#76F3A5', '#0080F8', '#1B51FF', '#2A00FF', '#518DDF', '#FFD074', '#FFD75B', '#FF5168'],
            credits: {
                enabled: false //禁用版权url    此处不设置,会显示highecharts.com
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    // size: 240,
                    depth: 25, //饼图厚度
                    color: 'red',
                    center: ['50%', '55%'],
                    showInLegend: true
                }
            },
            series: [{
                type: 'pie',
                name: '',
                startAngle: 0, //调整饼图的角度   方向:顺时针
                dataLabels: {
                    enabled: true,
                    inside: false,
                    distance: '10%',
                    // format : '{point.name}{series.name}<br><span style="color:#FF8040">{point.y} </span>% ' ,
                    useHTML: true,
                },
                data: dataValue1
            }]
        };
        $('#zuozhongpie').highcharts(option);
Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐