鍍金池/ 問答/HTML/ echarts柱狀圖的標題顏色在哪里修改?

echarts柱狀圖的標題顏色在哪里修改?

1.echarts柱狀圖的標題顏色在哪里修改?
clipboard.png
js

        let option = {
          color: ['#003366', '#006699', '#4cabce', '#e5323e'],
          title: {
            show: true,
            textStyle: {
              fontWeight: "normal",
              color: "#fff", 
              fontSize: 14
            },
            left: "center"
          },
          tooltip: {
            trigger: 'axis',
            // 鼠標移動柱狀圖是提示文字
            show: true,
            axisPointer: {
              type: 'shadow'
            }
          },
          legend: {
            data: ['Forest', 'Steppe', 'Desert', 'Wetland']
          },
          toolbox: {
            show: true,
            orient: 'vertical',
            left: 'right',
            top: 'center',
            feature: {
              mark: {
                show: true
              },
              dataView: {
                show: true,
                readOnly: false
              },
              magicType: {
                show: true,
                type: ['line', 'bar', 'stack', 'tiled']
              },
              restore: {
                show: true
              },
              saveAsImage: {
                show: true
              }
            }
          },
          calculable: true,
          xAxis: [{
            type: 'category',
            axisLabel: {
              show: true,
              textStyle: {
                color: "#fff"
              },
            },
            axisLine: {
              lineStyle: {
                color: "#fff"
              }
            },
            axisTick: {
              show: false
            },
            data: ['2012', '2013', '2014', '2015', '2016']
          }],
          yAxis: [{
            type: 'value',
            axisLine: {
              lineStyle: {
                color: "#fff"
              }
            },
            splitLine: {
              lineStyle: {
                color: ['#fff']
              }
            },
          }],
          series: [{
              name: 'Forest',
              type: 'bar',
              barGap: 0,
              label: labelOption,
              data: [320, 332, 301, 334, 390]
            },
            {
              name: 'Steppe',
              type: 'bar',
              label: labelOption,
              data: [220, 182, 191, 234, 290]
            },
            {
              name: 'Desert',
              type: 'bar',
              label: labelOption,
              data: [150, 232, 201, 154, 190]
            },
            {
              name: 'Wetland',
              type: 'bar',
              label: labelOption,
              data: [98, 77, 101, 99, 40]
            }
          ]
        };
回答
編輯回答
蝶戀花

legend選項的textStyle里面修改標題的樣式:

legend: {
    data: ['Forest', 'Steppe', 'Desert', 'Wetland'],
    textStyle: {
        color: 'red'
    }
}
2018年6月4日 08:31