如何更改蜘蛛网图表中单点的颜色

时间:2019-03-12 03:56:41

标签: javascript highcharts

我想更改其值低于60%的单个点的颜色。

(例如,将粉红色区域中的两个点的蓝色变成红色。)

这可能吗?

谢谢!

Javascript:

Highcharts.chart('container', {

  chart: {
    polar: true,
    type: 'line'
  },

  title: {
    text: 'Budget vs spending',
    x: -80
  },

  pane: {
    size: '80%'
  },

  xAxis: {
    categories: ['Sales', 'Marketing', 'Development', 'Customer Support',
      'Information Technology', 'Administration'],
    tickmarkPlacement: 'on',
    lineWidth: 0
  },

  yAxis: {
     gridLineInterpolation: 'polygon',
     lineWidth: 0,
     min: 0,
     max: 100
  },

  tooltip: {
    shared: true,
    pointFormat: '<span style="color:{series.color}">{series.name}: <b>${point.y:,.0f}</b><br/>'
  },

  legend: {
    align: 'right',
    verticalAlign: 'top',
    y: 70,
    layout: 'vertical'
  },

  series: [{
    name: 'Allocated Budget',
    color: 'blue',
    pointPlacement: 'on',
    data: [83, 79, 40, 35, 97, 80],
    pointPlacement:'on',

  }, {
    name: 'lower than 60%',
    data: [60,60,60,60,60,60],
    pointPlacement: 'on',
    lineWidth: 2,
    type: 'area',
    color: '#ffbce6',
    dashStyle: 'shortdash',
  }]

});

JS Fiddle

0 个答案:

没有答案