You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With v2, this library introduces a number of breaking changes. In order to improve performance, offer new features, and improve maintainability, it was necessary to break backwards compatibility, but we aimed to do so only when worth the benefit.
Change component import path
v1:
importLinefrom'svelte-chartjs/src/Line.svelte'
v2:
import{Line}from'svelte-chartjs'
Tree-shaking
v2 of this library, just like Chart.js v3, is tree-shakable. It means that you need to import and register the controllers, elements, scales, and plugins you want to use.
For a list of all the available items to import, see Chart.js docs.
Using the "lazy way" is okay to simplify the migration, but please consider using the tree-shakable way to decrease the bundle size.
Please note that typed chart components register their controllers by default, so you don't need to register them by yourself. For example, when using the Pie component, you don't need to register PieController explicitly.