无法更改Highchart线条颜色的Spiderweb

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

我正在研究this demo。为什么我无法更改蜘蛛网的线条颜色?如你所见,我已将lineColor: '#FFF000'添加到xAxisyAxis

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

yAxis: {
    gridLineInterpolation: 'polygon',
    lineWidth: 1,
    min: 0, 
        lineColor: '#FFF000'
},
highcharts
1个回答
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'

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