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
{{ message }}
Repository navigation
Legend Label Options missing type def for pointStyleWidth - Typescript #11366
you could also go to your node_modules folder (or where ever your package lives) and manually update the package to have the type def, you could add it to the chart.js/dist/types/index.d.ts file with the interface LegendOptions there is the labels property where I believe it should be added to allow it to work without the any. This also causes it to be overwritten if you ever update 🤷♂️ but that would be a workaround. (I also haven't tested the implications of the second workaround and have only done a little bit of digging into the source code)
Activity
xxgunnery commentedon Jun 30, 2023
Hey any updates on solving this? I am having the same problem with 3.9.1. I wonder if there is an alternative to changing the pointStyle?
MasterCash commentedon Jun 30, 2023
@xxgunnery:
you can get around the TS compile errors by casting to any but you lose intellisense and type checking:
you could also go to your
node_modulesfolder (or where ever your package lives) and manually update the package to have the type def, you could add it to thechart.js/dist/types/index.d.tsfile with the interfaceLegendOptionsthere is thelabelsproperty where I believe it should be added to allow it to work without theany. This also causes it to be overwritten if you ever update 🤷♂️ but that would be a workaround. (I also haven't tested the implications of the second workaround and have only done a little bit of digging into the source code)etimberg commentedon Jun 30, 2023
Sent a PR to fix this for the next release