样式echarts - 无法修改标题颜色

Ren*_*han 3 ruby-on-rails echarts

想要使用下面的图表,但无法将标题颜色更改为白色,将轴和轴编号更改为灰色(或白色)。这应该高于深色背景。有人知道如何用echarts改变标题颜色吗?

<script type="text/javascript">
              // based on prepared DOM, initialize echarts instance
              var myChart = echarts.init(document.getElementById('main'));

              // specify chart configuration item and data
              var option = {
                  title: {
                      text: 'Total memebers of the club',
                      fontColor: 'white',
                      display: true,
                      position: 'bottom'

                  },
                  tooltip: {},
                  legend: {
                      data: ['Total member']
                  },
                  xAxis: {

                      data: ["11/2018", "12/2018", "01/2019", "02/2019", "03/2019", "04/2019"]
                  },
                  yAxis: {},
                  series: [{
                      itemStyle: {normal: {color: 'white'}},
                      name: 'Total',
                      type: 'bar',
                      data: [5, 384, 612, 2344, 4670, 9372]
                  }]
              };

              // use configuration item and data specified to show chart
              myChart.setOption(option);
          </script>
Run Code Online (Sandbox Code Playgroud)

sec*_*guy 5

尝试一下。将其添加到“文本:”下,例如:

text: 'Total memebers of the club',
textStyle: {
    color: '#ed2d2e'
    }
Run Code Online (Sandbox Code Playgroud)

  • 完美运行,谢谢 (2认同)