Skip to content

Handle split series with 0 as group value #288

@markov00

Description

@markov00

Describe the bug
The legend doesn't reflect the naming for a splitted series chart if the series group value is 0.

To Reproduce
Using the DataGenerator to create 4 series chart.

const dg = new DataGenerator();
const data1 = dg.generateGroupedSeries(20, 4);
<Chart size={[undefined, 200]}>
  <Settings
    legendPosition={Position.Right}
    showLegendDisplayValue={false}
  />
  <BarSeries
    id={getSpecId('status')}
    name={'Quantity'}
    data={data1}
    xAccessor={'x'}
    yAccessors={['y']}
    splitSeriesAccessors={['g']}
    stackAccessors={['g']}
  />
  <Axis
    id={getAxisId('bottom-axis')}
    position={Position.Bottom}
  />
  <Axis
    id={getAxisId('left-axis')}
    position={Position.Left}
  />
</Chart>

Expected behavior
The legend should reflect the group values. In this case the legend should be 0, 1, 2, 3.

Screenshots
Screen Shot 2019-08-05 at 16 44 39

Version (please complete the following information):

  • OS: all
  • Browser: chrome
  • Elastic Charts: master

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

No one assigned

    Labels

    :legendLegend 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