无法更改Highchart线条颜色的Spiderweb

时间:2018-08-28 17:43:22

标签: highcharts

我正在研究this demo。为什么我不能更改Spider web的线条颜色?如您所见,我已经向var textarea = document.getElementById('textarea'); textarea.onkeydown = function () { if (textarea.value.length === 9) { textarea.rows = 2; } else if (textarea.value.length === 18) { textarea.rows = 3; }; lineColor: '#FFF000'都添加了xAxis

yAxis

1 个答案:

答案 0 :(得分:1)

Highcharts.chart('container', {

  chart: {
    polar: true,
    type: 'line',
    color: '#FF0000'
  },

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

  pane: {
    size: '80%'
  },

  xAxis: {
    categories: ['Sales', 'Marketing', 'Development', 'Customer Support',
      'Information Technology', 'Administration'
    ],
    tickmarkPlacement: 'on',
    gridLineWidth: 1,
    gridLineColor: '#FFA123',

    lineColor: '#22FFAA',
    tickColor: '#FF00FF',
  },

  yAxis: {
    gridLineInterpolation: 'polygon',
    gridLineColor: '#123FFF',
    lineWidth: 1,
    min: 0,

  },

  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',
    data: [43000, 19000, 60000, 35000, 17000, 10000],
    pointPlacement: 'on',
    color: '#FF0000'
  }, {
    name: 'Actual Spending',
    data: [50000, 39000, 42000, 31000, 26000, 14000],
    pointPlacement: 'on',
    color: '#0000FF'
  }]

});
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>

<div id="container" style="min-width: 400px; max-width: 600px; height: 400px; margin: 0 auto"></div>

您可以使用gridLineColor更改轴线和内部网格线的颜色。

  

gridLineColor:'#123FFF'