Properties of Theme that are optional, and officially only used in LightningChart JS Online Examples and projects.
These are guaranteed to be included in all official Library Themes provided by LightningChart, but not required in custom Themes defined by users.
If you want to use example theme properties in your application, then make sure to do these two things:
Use an official Theme supplied by LightningChart.
If your project requires type safety, then add a sanity check that throws an error if the Theme.examples property is undefined, like this:
// Example, ensure official LightningChart JS theme is in use. consttheme = chart.getTheme() if (!theme.examples) { thrownewError(`LightningChart JS Theme.examples is undefined. You are probably using an unofficial theme and attempting to access example theme properties!`) }
Properties of Theme that are optional, and officially only used in LightningChart JS Online Examples and projects.
These are guaranteed to be included in all official Library Themes provided by LightningChart, but not required in custom Themes defined by users.
If you want to use example theme properties in your application, then make sure to do these two things:
Theme.examples
property isundefined
, like this: