mistercrunch commented on issue #18540:
URL: https://github.com/apache/echarts/issues/18540#issuecomment-2731348212
For Apache Superset, we're looking to also change themes dynamically as
we're moving to antd-v5 and will allow users to customize their dashboard's
theme. In our case, we assign tokens out of the antd theme into the
`echartOptions` object which seems pretty straightforward. Given we're looking
for something dynamic, registering named themes isn't ideal as the user may be
altering their theme and looking at visual changes in real time, so that would
mean registering one theme per iteration. I didn't find a way to re-register or
delete a theme.
Now I tried simply merging-in my theme object in our echartOptions, and
while this works, it creates artifacts, like x/yAxis lines on a pie chart for
instance. I'm guessing it's not a good idea to merge in the whole theme inside
`echartOptions` since there's many theme props that just don't make sense for
some chart types.
Now I'm wondering what you all use internally to apply a theme to a specific
chart type, I'm guessing there's some logic somewhere in echarts to only apply
the parts of the theme that are relevant to the given chart type (ie: no axis
theme in a Pie chart for instance) and if I could reuse this logic.
For the record, I did find the fairly new `chart.setTheme({})` method (we're
on 5.6.0) and it didn't seem to apply while calling before or after
`setOptions` but it doesn't seem to apply properly.
Looking for solutions, and happy to help if I can.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]