如何更改Highcharts中的文本颜色

ben*_*tah 12 javascript highcharts

这应该是非常简单的,但我仔细考虑了高级图表文档,似乎找不到专门处理文本颜色的选项(相比之下,背景,边框,线条等有特定的颜色选项).然后我遇到了chart.style选项.它似乎应该工作 - 但不是.

在这个jsfiddle演示中,您将看到我能够更改字体系列,而不是颜色.

我错过了什么?

mai*_*har 42

检查这个例子,我能够改变你的jsfiddle上的标签颜色.这是整个选项参数:

Highcharts.setOptions({
    chart: {
        style: {
            fontFamily: 'monospace',
            color: "#f00"
        }

    },
    title: {
      style: {
         color: '#F00',
         font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
      }
   },
    xAxis: {
      gridLineWidth: 1,
      lineColor: '#000',
      tickColor: '#000',
      labels: {
         style: {
            color: '#F00',
            font: '11px Trebuchet MS, Verdana, sans-serif'
         }
      },
      title: {
         style: {
            color: '#333',
            fontWeight: 'bold',
            fontSize: '12px',
            fontFamily: 'Trebuchet MS, Verdana, sans-serif'

         }            
      }
   },
   yAxis: {
      minorTickInterval: 'auto',
      lineColor: '#000',
      lineWidth: 1,
      tickWidth: 1,
      tickColor: '#000',
      labels: {
         style: {
            color: '#F00',
            font: '11px Trebuchet MS, Verdana, sans-serif'
         }
      },
      title: {
         style: {
            color: '#333',
            fontWeight: 'bold',
            fontSize: '12px',
            fontFamily: 'Trebuchet MS, Verdana, sans-serif'
         }            
      }
   },
});
Run Code Online (Sandbox Code Playgroud)