Is your feature request related to a problem? Please describe.
Ensure a correct chart configuration for the developer
Describe the solution you'd like
Add a warning message on console if the chart doesn't respect a set of basic rules like:
- avoid adding axes that are not related to configured series
- avoid mixing series with different scale types
- don't add a piechart together with a barseries
- invalid accessors (for example,
xAccessor={'foo'} when the data has no foo fields)
Prevent chart from not showing when config is bad, such as...
import React from 'react';
import { Chart, LineSeries, ScaleType, Position, Settings, Axis } from '../src';
import { SeededDataGenerator } from '../src/mocks/utils';
export class Playground extends React.Component<{}, { isSunburstShown: boolean }> {
render() {
const dg = new SeededDataGenerator();
const data = dg.generateGroupedSeries(10, 2).map((item) => ({
...item,
y1: item.y + 100,
}));
return (
<>
<div className="chart">
<Chart>
<Settings showLegend />
<Axis id="y1" groupId="g1" position={Position.Left} title={'y1'} />
<Axis id="y2" groupId="g2" position={Position.Left} title={'y2'} />
<Axis id="x" position={Position.Bottom} title={'x'} />
<LineSeries
id={'aaa'}
xScaleType={ScaleType.Linear}
xAccessor={'x'}
yAccessors={['y', 'y1']}
splitSeriesAccessors={['g']}
data={data}
/>
</Chart>
</div>
</>
);
}
}
Describe alternatives you've considered
n/a
Additional context
n/a
Kibana Cross Issues
n/a
Checklist
Is your feature request related to a problem? Please describe.
Ensure a correct chart configuration for the developer
Describe the solution you'd like
Add a warning message on console if the chart doesn't respect a set of basic rules like:
xAccessor={'foo'}when the data has nofoofields)Prevent chart from not showing when config is bad, such as...
Describe alternatives you've considered
n/a
Additional context
n/a
Kibana Cross Issues
n/a
Checklist
Kibana Cross Issueslistkibana cross issuetag is associated to the issue if any kibana cross issue is present