Topic: Chart destroy method

neocheck premium asked 2 months ago

Although the chart documentation says that dispose function removes the chart instance, it is not possible to create a new chart on the same canvas after calling the dispose method. The JavaScript error indicates that the chart must be destroyed before it can be reused. This is only possible with the destroy method from chartjs....

The destroy function is not available in MDB.

JavaScript error calling new mdb.Chart(...) after chartInstance.dispose():

Uncaught Error: Canvas is already in use. Chart with ID '0' must be destroyed before the canvas with ID 'DocumentCheckTransactionsChart' can be reused.

JavaScript error calling new chart.destroy() or chartInstance.destroy():

Uncaught TypeError: chart[0].destroy is not a function

kpienkowska staff answered 2 months ago

We are aware of that bug. We are working on the fix.

Until then please destroy the chart before dispose. Example of how to do that:

neocheck premium commented 2 months ago

Thank you for the workaround.

neocheck premium commented 1 month ago

Is this bug fixed in the new MDB update? Thank you.

neocheck premium answered 1 month ago

Is this bug fixed in the new MDB update 6.0.0? Thank you.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • User: Premium
  • Premium support: Yes
  • Technology: MDB Standard
  • MDB Version: MDB5 5.0.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No