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
However when I attempted to add data to my chart this way it did not work.
The charts I am using show time series data, I belive the issue is that when the scale type is set to "time" chart.js does not store the scale values in chart.data.labels. To get around this I had to change the format of the data I was passing in to look like {x:Date, y:number}. This was not mentioned anywhere in the docs and I had to discover it through trial and error.
Documentation Is:
Please Explain in Detail...
The docs show this example for updating the data in a chart
However when I attempted to add data to my chart this way it did not work.
The charts I am using show time series data, I belive the issue is that when the scale type is set to
"time"
chart.js does not store the scale values inchart.data.labels
. To get around this I had to change the format of the data I was passing in to look like{x:Date, y:number}
. This was not mentioned anywhere in the docs and I had to discover it through trial and error.Your Proposal for Changes
I am not sure on where the best place to mention this in the docs would be but my first guess would be the https://www.chartjs.org/docs/latest/developers/updates.html page.
Example
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgYQBYENZwL5wGZQQhwDkAxhrAHQBWAziQNwCwAUAG6ZwAm6M6cALxwA2gEYATABo4YgJwyAzDICsM6XEUBdNgHpde3XACScDOwCmcAHYQ4wbhYHA8cAOYXrFqH2DW3cDCoFnRWvDAhgajAdHAA7ugAnvHAADap8dAA1ilBEACu8ALhVui8YBFQhmycUHBkMAAeQjwQZPkgnjBUHjAAoqkWndYwAEKJxtwAFABEIIlomDAzAJRw6LEAEgAqALIAMsjo1px0A0NdLKz6hnAAIhCRtvBx2dUcXPOLWMJecSiUGBTBqNGQINhwSGBRJgCwALlIqT8FhIUghUPC6AR4NYULxcFS6AARhZUnQEZiqCB0GAplMAPpSYArQQAPnufAsVFscSmKyonFS+QsAHk8Hy4ABaOBTYBwABUcAAbAAGNVrFZo3H4yGY0IwcmiHE6nWEkmpBEkADEcAgrgAahAIgwtSb8ZiKXx0K6TdgdNrIdgfZCIBVgBBrIbjfi6GR0IMo+idY1sUmTTAYfC4DMYKALDNg+m86mA264PlrMAYAiZqgClAC2mddgm1Cg63IYkS2W4B2cK2W6XB9gVldbgB1bIWbj4aBwTq9j51L6AiQtP4ApbAppgtMZ2GWpFeVFpj2IPtm0mGwt4vUWA0IkTRnuXi2kG12uCO50n0tus+UtStJTOwTIsuyCBQPe+RQNYiApncnLchAvL8oKwpihK0qygqypqiqmpwF27A4CON5tv6eLtqWoa5hGiZ-nAsbxiE3Ymim56MXi+5ZjmeaNlxUK5p0bE9hWVY1nWMECT2g5utRbpdpxPZ9nJ+JqYGbAjowQA
The text was updated successfully, but these errors were encountered: