关于highchart 的一些总结

1.纵向柱状图

var chart = {
  type: 'column',
  inverted:true(默认false)
};

 

2.设置颜色

plotOptions: {

    pie: {
      allowPointSelect: true,
      cursor: 'pointer',
      format: '<b>{point.name}</b>: {point.percentage:.1f} %',
      dataLabels: {
        enabled: true, 
        formatter: function() {
        if(this.point.name == '初级'){
          return '<span style="color:#4dd3b9">['+ this.point.name +' '+ Highcharts.numberFormat(this.percentage, 2)+'%]</span>';
        }else if(this.point.name == '中级'){
          return '<span style="color:#fdd67f">['+ this.point.name +' '+ Highcharts.numberFormat(this.percentage, 2)+'%]</span>';
        }else if(this.point.name == '高级'){
          return '<span style="color:#ffaca8">['+ this.point.name +' '+Highcharts.numberFormat(this.percentage, 2)+'%]</span>';
        }else if(this.point.name == '不分等级'){
          return '<span style="color:#64bcec">['+ this.point.name +' '+ Highcharts.numberFormat(this.percentage, 2)+'%]</span>';
          } 
        }
      }
    }
  }

  

posted @ 2017-08-04 09:30  李元夕cool  阅读(153)  评论(0编辑  收藏  举报