如何在spiderweb图表中更改单点的颜色

问题描述 投票:1回答:1

我想改变其值低于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

javascript highcharts
1个回答
2
投票

其中一个选项是将Allocated Budget系列的数据更改为:

data: [83, 79, {y:40, color:'red'}, {y:35, color:'red'}, 97, 80]

检查更新的小提琴https://jsfiddle.net/mpof48nu/

© www.soinside.com 2019 - 2024. All rights reserved.