创建图表对象后如何设置主题?

how to set theme after creat a chartXY object?

我这样创建图表:

this.chart = lightningChart().ChartXY({container: `${this.chartId}`,theme:Themes.dark})

有谁知道如何在不再次使用 lightningChart().Chart XY() 的情况下将主题更改为 Themes.light?

图表的主题在图表创建后无法更改。

唯一的选择是用不同的主题重新创建图表。

const lc = lightningChart()

let chart = lc.ChartXY({theme:Themes.dark})

...

// delete the old chart, also ensure that no references to the old chart is left in application code
chart.dispose()
chart = undefined

// recreate the chart
chart = lc.ChartXY({theme:Themes.light})