Skip to content
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

fix(bar_chart): data typing #11734

Closed
wants to merge 1 commit into from

Conversation

Oleksii14
Copy link

@LeeLenaleee
Copy link
Collaborator

LeeLenaleee commented Apr 8, 2024

Why would the default data point need adjustment, you are able to provide your own custom data types to chart.js:

import { Chart, ChartData } from 'chart.js';

var data: ChartData<'polarArea', {x: Date, y: {foo: boolean}}[]> = {
  labels: [],
  datasets: [{
    data: [{ x: new Date(), y: {foo: false} }],
  }],
};

var ctx = document.getElementById("myChart") as HTMLCanvasElement;
var myChart = new Chart(ctx, {
    type: 'polarArea',
    data: data,
});

@LeeLenaleee LeeLenaleee added the type: types Typescript type changes label Apr 8, 2024
@Oleksii14
Copy link
Author

Why would the default data point need adjustment, you are able to provide your own custom data types to chart.js:

import { Chart, ChartData } from 'chart.js';

var data: ChartData<'polarArea', {x: Date, y: {foo: boolean}}[]> = {
  labels: [],
  datasets: [{
    data: [{ x: new Date(), y: {foo: "false"} }],
  }],
};

var ctx = document.getElementById("myChart") as HTMLCanvasElement;
var myChart = new Chart(ctx, {
    type: 'polarArea',
    data: data,
});

You're right. The original issue should be resolved directly in the Vue.js implementation of the chart components. Thanks for the reply. I am closing this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: types Typescript type changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants