[ui] Line charts: explicitly update X-axis whenever xScale changes (#14814)
* Explicitly update X-axis whenever xScale changes * Changelog
This commit is contained in:
parent
e516fc266f
commit
4b93a30225
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
ui: Fixed line charts to update x-axis (time) where relevant
|
||||
```
|
|
@ -350,6 +350,13 @@ export default class LineChart extends Component {
|
|||
});
|
||||
}
|
||||
|
||||
@action
|
||||
recomputeXAxis(el) {
|
||||
if (!this.isDestroyed && !this.isDestroying) {
|
||||
d3.select(el.querySelector('.x-axis')).call(this.xAxis);
|
||||
}
|
||||
}
|
||||
|
||||
mountD3Elements() {
|
||||
if (!this.isDestroyed && !this.isDestroying) {
|
||||
d3.select(this.element.querySelector('.x-axis')).call(this.xAxis);
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
...attributes
|
||||
{{did-insert this.onInsert}}
|
||||
{{did-update this.renderChart}}
|
||||
{{did-update this.recomputeXAxis this.xScale}}
|
||||
{{window-resize this.updateDimensions}}>
|
||||
<svg data-test-line-chart aria-labelledby="{{this.titleId}}" aria-describedby="{{this.descriptionId}}">
|
||||
<title id="{{this.titleId}}">{{this.title}}</title>
|
||||
|
|
Loading…
Reference in New Issue