New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Floating bar chart data type & parsing of custom objects #9328
Comments
Both of these work with typescript 4.1.6, but not with 4.2.x or 4.3.x. |
i have a similar issue for bubble chart, where i want to store custom data to dataset. datasets: [
{
data: [
{
x: 1,
y: 1,
r: 11,
//@ts-ignore
data: [
{ test1: "my custom data" },
{ test2: { nested: true } }
]
}
] public chartClicked(event: any) {
const activeElements = event.active;
if (activeElements.length > 0) {
const elem = activeElements[0];
console.log(elem);
const customdata = elem.element.$context.raw.data;
console.log("custom data from bubble", customdata);
}
} parsing did not work for me, i still get typescript error:
using |
I upgraded locally to typescript 4.3.5. The test added in #9348 passes fine, however the existing https://github.com/chartjs/Chart.js/blob/master/types/tests/test_instance_assignment.ts fails |
It feels like this might be related to microsoft/TypeScript#41886 Same with microsoft/TypeScript#42421 |
Expected Behavior
ChartData should allow for the types (number[][]) mentioned in the documentation for floating bar charts or parsing of objects.
Current Behavior
Using arrays:
Using parsing:
Steps to Reproduce
I was trying to use floating bar charts in my Angular project but the types do not allow me to assign number[][] to the data property.
I also tried using the parsing option example from the documentation but it also doesn't allow me to do that either:
Environment
The text was updated successfully, but these errors were encountered: