Would you like to work on this feature?
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.
Would you like to work on this feature?
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,
typedChartsis creating components which are specific to chart type. Thedataprop isChartData<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:Mix.<Mix :data="data" :options="options" />dataprops, it will acceptChartDataCustomTypesPerDatasetTTypeinput 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
ChartDataCustomTypesPerDatasettypeto thedataprop, 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
Barbut 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: