Lightning Chart legend.autoDispose doesn't work

Viewed 80

I'm working with a Lightning Chart JS example for Blazor server app. I've tried many Lightning Chart interactive examples, but I can't run "legend.setAutoDispose" or "legend.SetAutoDisposeMode". Not much help from the documentation.

For example, this doesn't work:

legend.setAutoDisposeMode ({ type: "max-width", maxWidth: 0.20, })

Getting an error: Microsoft.JSInterop.JSException: 'U is not a function ...

Also I'm intrested to dispose some Y axes (I have three Y axes) when displaying on mobile device. Can this be done with LC js?

1 Answers

The error with setAutoDisposeMode seems to have been caused by using an older LightningChart JS version, which didn't have this feature yet.

This feature was added in v.3.1.0.

I'm not 100% sure which version your project is using, but we have updated our Blazor template to use the newest LightningChart JS version 3.3.2. I hope you can update your project via this template repository and be able to use setAutoDisposeMode as well as other new features and improvements.

If you need help with migrating from the older LightningChart JS version, here's some possibly useful links:

Related