Skip to content

Stacked area charts render with gaps when the X coordinates are not continuous #388

@wylieconlon

Description

@wylieconlon

Describe the bug
Gaps appear in the rendering when you skip an X coordinate in your stacked area chart. It only appears in stacked areas, since stacked bars render correctly.

Screenshot 2019-09-23 14 08 34

To Reproduce
This is an example of discontinuous data:

      <AreaSeries
        splitSeriesAccessors={['split']}
        stackAccessors={['x']}
        id={getSpecId('y')}
        xAccessor={'x'}
        yAccessors={['y']}
        data={[
          {
            x: 5,
            y: 10,
            split: 'a',
          },
          {
            x: 5,
            y: 30,
            split: 'b',
          },
          {
            x: 10,
            y: 2,
            split: 'a',
          },
          // {
          //   x: 10,
          //   y: 3,
          //   split: 'b',
          // },
          {
            x: 20,
            y: 30,
            split: 'a',
          },
          {
            x: 20,
            y: 20,
            split: 'b',
          },
        ]}
        xScaleType={ScaleType.Linear}
        yScaleType={ScaleType.Linear}
      />

Expected behavior
With the data above, I would expect the chart library to insert an extra vertex at the missing X coordinates.

Metadata

Metadata

Labels

bugSomething isn't workingreleasedIssue released publicly

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions