Skip to content

BarSeries shifted depending on the spec ordering #301

@markov00

Description

@markov00

Describe the bug
When adding a LineSeries with split series before a BarSeries, the bar series is then shifted as the LineSeries was a BarSeries.
The workaround is to move the BarSeries before the LineSeries declaration.

To Reproduce

const dg = new DataGenerator();
    const data1 = dg.generateGroupedSeries(20, 3);
    const data2 = dg.generateGroupedSeries(20, 1);
    
    return (
        <Chart size={[undefined, 200]}>
          <Settings
            showLegend={true}
            legendPosition={Position.Right}
            showLegendDisplayValue={false}
          />
          <LineSeries
            id={getSpecId('status')}
            name="0"
            data={data1}
            xAccessor={'x'}
            yAccessors={['y']}
            splitSeriesAccessors={['g']}
          />
          <BarSeries
            id={getSpecId('control')}
            name="Control"
            data={data2}
            xAccessor={'x'}
            yAccessors={['y']}
          />
          <Axis
            id={getAxisId('bottom-axis')}
            position={Position.Bottom}
            showGridLines
          />
          <Axis
            id={getAxisId('left-axis')}
            position={Position.Left}
            showGridLines
            gridLineStyle={gridHorizontalSettings}
          />
        </Chart>
    );

Expected behavior
Independently from the Series spec order, the bar series should respect the right shifting value.

Screenshots

Screen Shot 2019-08-07 at 09 03 26 AM

Version (please complete the following information):

  • OS: macOS
  • Browser: chrome
  • Elastic Charts: 9.0.1

Additional context
n/a

Errors in browser console
n/a

Kibana Cross Issues
n/a

Checklist

  • [ ] every related Kibana issue is listed under Kibana Cross Issues list
  • [ ] kibana cross issue tag is associated to the issue if any kibana cross issue is present

Metadata

Metadata

Assignees

Labels

:chartChart element related issue:specsChart specifications related issuebugSomething isn't workingreleasedIssue released publicly

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions