[英]How can I add a drop-down menu to change the theme of sci chart using html and js?
您可以通过调用 sciChartSurface.applyTheme 更新 sciChartSurface 的主题。 这方面的文档在这里
如果您的 select 的 ID 为“主题”:
document.querySelector("#theme").onchange = (ev) => {
const value = ev.target.value;
let theme = new SciChart.SciChartJSDarkv2Theme();
if (value === "Light") {
theme = new SciChart.SciChartJSLightTheme();
} else if (value === "Custom") {
theme.lineSeriesColor = "red";
theme.sciChartBackground = `radial-gradient(circle, #615EFF 0%, #C4DFFF 100%)`;
theme.axisBandsFill = "#AACDFF33";
theme.tickTextBrush = "#0C0C63";
}
sciChartSurface.applyTheme(theme);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.