Description
Is your feature request related to a problem? Please describe.
Currently, when visualizing multiple datasets in a VueUiXy chart, enabling chart.grid.yAxis.useIndividualScales = true
assigns each series its own scale. This becomes problematic when I want to compare two distinct groups of data—such as one group representing percentages and another representing total counts—using only two separate scales. The lack of scale grouping makes it difficult to visually compare related metrics in a single chart.
Describe the solution you'd like
Introduce a "scale group" property on each dataset item that allows multiple series to share the same y-axis scale. For example, if datasets are assigned scaleGroup: "percentage"
or scaleGroup: "total"
, the chart would automatically create one y-axis for each group. This would allow, for instance, all percentage-based datasets to use one scale and all total-based datasets to use another, while still displaying all series in one cohesive chart.
Describe alternatives you've considered
Alternatives include merging datasets into a single series or rendering separate charts for each scale group. However, these approaches either reduce clarity or force a disjointed user experience. Manually adjusting each scale is also not a scalable solution.
Additional context
This feature would greatly improve readability in dashboards where different types of metrics must be visualized together—such as financial data, performance metrics, or any scenario where two distinct scales are required. Providing this functionality would allow users to easily toggle and compare data across different units while keeping the visualization clear and cohesive.
If you consider the following example of 4 or more datasets, each in a scale group, half the diagram becomes just scales eventually.
import type { VueUiXyDatasetItem } from 'vue-data-ui';
// Extended type (for demonstration purposes) with an optional scaleGroup property
interface ExtendedVueUiXyDatasetItem extends VueUiXyDatasetItem {
scaleGroup?: string;
}
// Example datasets with humorous content
// Donut Devourers series
const donutHappiness: ExtendedVueUiXyDatasetItem = {
name: 'Donut Devourers - Happiness (%)',
type: 'line',
dataLabels: true,
scaleGroup: 'percentage', // Share scale with other percentage-based series
series: [92.34, 88.37, 95.00] // Example percentages across different days
};
const donutsEaten: ExtendedVueUiXyDatasetItem = {
name: 'Donut Devourers - Donuts Eaten',
type: 'bar',
dataLabels: true,
scaleGroup: 'total', // Share scale with other total-based series
series: [12, 15, 13] // Example counts per day
};
// Pizza Party series
const pizzaDelight: ExtendedVueUiXyDatasetItem = {
name: 'Pizza Party - Cheesy Delight (%)',
type: 'line',
dataLabels: true,
scaleGroup: 'percentage',
series: [75.12, 80.50, 78.34]
};
const pizzaSlices: ExtendedVueUiXyDatasetItem = {
name: 'Pizza Party - Slices Consumed',
type: 'bar',
dataLabels: true,
scaleGroup: 'total',
series: [8, 9, 10]
};
// Combined into one array that can be fed into the VueUiXy chart
const chartDataset: ExtendedVueUiXyDatasetItem[] = [
donutHappiness,
donutsEaten,
pizzaDelight,
pizzaSlices
];
export { chartDataset };
I think this would make an outstanding addition to the already phenomenal data visualization library, as it would enable very information dense XY charts.