Skip to content

Brush is not working on rotated charts #527

@markov00

Description

@markov00

Describe the bug
When using a rotated chart, the brush rectangle doesn't appear and the onBrushEnd listener is called with a wrong set of values.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the playground and create a chart with the following configuration:
<Chart>
  <Settings rotation={90} onBrushEnd={console.log} />
  <LineSeries
    id={'aaa'}
    xScaleType={ScaleType.Linear}
    xAccessor={0}
    yAccessors={[1]}
    data={[
      [0, 1],
      [1, 2],
      [2, 5],
      [3, 5],
      [4, 2],
      [5, 6],
    ]}
  />
</Chart>
  1. Try to click and drag the mouse over the chart to start brushing
  2. No area is rendered. When the mouse is released the values outputted in the console are not the right ones (seems to refers to the x values)

Expected behavior
Independently from the rotation, the brush should always be available on linear x charts.

Screenshots
n/a

Version (please complete the following information):

  • Elastic Charts: 16.x

Additional context
Possible regression from the #281

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

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