ECharts endLabel 设置字体颜色与 series 颜色一致

ECharts About 425 words

endLabel.color

默认是#fff黑色。

设置为inherit,则为视觉映射得到的颜色,如系列色。

option = {
  xAxis: {
    type: "category",
    data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]
  },
  yAxis: {},
  series: [{
    data: [820, 932, 901, 934, 1290, 1330, 1320],
    type: "line",
    endLabel: {
      show: true,
      formatter: '{b}',
      color: 'inherit',
    }
  }]
}

文档

https://echarts.apache.org/zh/option.html#series-line.endLabel.color

Views: 7 · Posted: 2026-03-05

———         Thanks for Reading         ———

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

扫描下方二维码关注公众号和小程序↓↓↓

扫描下方二维码关注公众号和小程序↓↓↓
Prev Post
Today In History
Browsing Refresh