lightningchart - 创建chartXY对象后如何设置主题?
问题描述
我像这样创建了chartXY:
this.chart = lightningChart().ChartXY({container: `${this.chartId}`,theme:Themes.dark})
有谁知道如何在不使用 LightningChart().ChartXY() 的情况下将主题更改为 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})
推荐阅读
- android - TextView 在从不同的活动中获取 Intent 时显示相同的文本
- css - Webpack Dev 与 Prod 的样式差异
- mysql - 选择带有存储过程的查询
- angular - Angular 6 与 AWS ElasticSearch 连接
- selenium - TestNg DataProvider 没有同时运行所有测试,而是作为批处理
- tensorflow - 在 tensorflow js 中重新训练图像分类器
- django - 有没有办法在启动 Django 应用程序时提及数据库设置?
- ruby-on-rails - Rails Active Storage ActiveStorage::IntegrityError (ActiveStorage::IntegrityError):尝试上传时
- javascript - 如何使用变量查询
- php - PHP 扩展和私有