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

Mix chart component #1027

Open
1 task done
palsingh opened this issue May 2, 2023 · 0 comments
Open
1 task done

Mix chart component #1027

palsingh opened this issue May 2, 2023 · 0 comments

Comments

@palsingh
Copy link

palsingh commented May 2, 2023

Would you like to work on this feature?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

What problem are you trying to solve?

Currently, developers cannot create a mix chart without breaking typescript, or users have to implement their custom solutions. This is not a good developer experience.
There should be a component which should create a mix chart with typescript compatibility.

Related issues:

Describe the solution you'd like

Currently, typedCharts is creating components which are specific to chart type. The data prop is ChartData<TType, TData, TLabel> type.
In order to support mix chart type, Chartjs exposes another type, i.e. ChartDataCustomTypesPerDataset<TType, TData, TLabel>.

I would like to create an alternate mixTypedChart, which will:

  • Export a component named Mix. <Mix :data="data" :options="options" />
  • For data props, it will accept ChartDataCustomTypesPerDataset
  • Support all types of charts.
  • Does not require TType input from the developer.

If you allow, I would like to create a PR for this as well.

Describe alternatives you've considered

I tried to add ChartDataCustomTypesPerDataset type to the data prop, but it will not be suitable because developers will have to use the existing chart components in order to render the mix chart, for example:
<Bar :data="mixChartData" :options="options" />

It is confusing because the component says Bar but the chart rendered will be mixed.
However, I was not able to make it work without typescript issues.

Documentation, Adoption, Migration Strategy

We should create:

  • Documentation, similar to existing charts.
  • Stackblitz demo
  • Storybook.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant