• 饼状图详细配置


      var chart;
    function lo(data) {
    chart = new Highcharts.Chart({
    chart: {
    renderTo: 'pie1', //饼状图关联html元素id值
    defaultSeriesType: 'pie', //默认图表类型为饼状图
    plotBackgroundColor: '#FFFFFF', //设置图表区背景色
    plotShadow: true //设置阴影
    },
    title: {
    text: '织带类别' //图表标题
    },
    credits: {
    text: ''
    },
    tooltip: {
    formatter: function() { //鼠标滑向图像提示框的格式化提示信息
    return '<b>' + this.point.name + '</b>: ' + this.y;
    }
    },
    plotOptions: {
    pie: {
    allowPointSelect: true, //允许选中,点击选中的扇形区可以分离出来显示
    cursor: 'pointer', //当鼠标指向扇形区时变为手型(可点击)
    showInLegend: true, //如果要显示图例,可将该项设置为true
    events: {
    click: function (e) {
    alert(e.point.name);
    }
    },
    dataLabels: {
    enabled: true, //设置数据标签可见,即显示每个扇形区对应的数据
    color: '#000000', //数据显示颜色
    connectorColor: '#999', //设置数据域扇形区的连接线的颜色
    style:{
    fontSize: '12px' //数据显示的大小
    },
    formatter: function() { //格式化数据
    return '<b>' + this.point.name + '</b>: ' + this.percentage + ' %';
    //return '<b>' + this.point.name + '</b>: ' + this.y ;
    },

    }
    }
    },
    series: [{ //数据列
    name: 'search engine',
    data: data,//核心数据列来源于php读取的数据并解析成JSON
    animation: true
    }]
    });
    }
  • 相关阅读:
    json批量设置DIV属性
    随机产生div背景颜色变化
    发送验证码倒计时
    购物网站倒计时
    ARC066B
    [Poi2011]Conspiracy
    CF1103E Radix Sum
    NOI2018 冒泡排序
    CometOJ 5E
    NOI2020 命运
  • 原文地址:https://www.cnblogs.com/Bhi9712/p/9608565.html
Copyright © 2020-2023  润新知