hugocxl / react-echarts

🐳 ECharts for React
https://hugocxl.github.io/react-echarts/
MIT License
79 stars 4 forks source link

Dark mode does not work #39

Closed ujjwal-iqlect closed 3 weeks ago

ujjwal-iqlect commented 1 month ago

Description

Is dark mode supported in Echarts component? The darkMode prop doesn't seem to work.

<EChart
  renderer={'svg'}
  darkMode={true}
  legend={{
    orient: 'vertical',
    right: 10,
    top: 20,
    bottom: 20
  }}
  style={{
    height: '250px',
    width: '100%'
  }}
  series={chartSeries}
/>

Version

1.2.0

Browser

No response

Operating System

Additional Information

An example of how dark mode should work : https://echarts.apache.org/examples/en/editor.html?c=pie-doughnut

hugocxl commented 1 month ago

hi @ujjwal-iqlect. You can use the prop theme={'dark'} in the component .

You can also to register your own theme (https://echarts.apache.org/handbook/en/concepts/style/#theme, https://echarts.apache.org/en/download-theme.html) and use it with the specified prop.