[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() {
|
mountD3Elements() {
|
||||||
if (!this.isDestroyed && !this.isDestroying) {
|
if (!this.isDestroyed && !this.isDestroying) {
|
||||||
d3.select(this.element.querySelector('.x-axis')).call(this.xAxis);
|
d3.select(this.element.querySelector('.x-axis')).call(this.xAxis);
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
...attributes
|
...attributes
|
||||||
{{did-insert this.onInsert}}
|
{{did-insert this.onInsert}}
|
||||||
{{did-update this.renderChart}}
|
{{did-update this.renderChart}}
|
||||||
|
{{did-update this.recomputeXAxis this.xScale}}
|
||||||
{{window-resize this.updateDimensions}}>
|
{{window-resize this.updateDimensions}}>
|
||||||
<svg data-test-line-chart aria-labelledby="{{this.titleId}}" aria-describedby="{{this.descriptionId}}">
|
<svg data-test-line-chart aria-labelledby="{{this.titleId}}" aria-describedby="{{this.descriptionId}}">
|
||||||
<title id="{{this.titleId}}">{{this.title}}</title>
|
<title id="{{this.titleId}}">{{this.title}}</title>
|
||||||
|
|
Loading…
Reference in New Issue