|
612 | 612 |
|
613 | 613 | <!-- AXIS LABELS --> |
614 | 614 | <g> |
615 | | - <text data-cy="xy-axis-yLabel" v-if="chartConfig.chart.grid.labels.axis.yLabel" :font-size="chartConfig.chart.grid.labels.axis.fontSize" :fill="chartConfig.chart.grid.labels.color" id="yAxisLabel" text-anchor="middle" style="transition: none"> |
| 615 | + <text |
| 616 | + data-cy="xy-axis-yLabel" |
| 617 | + v-if="chartConfig.chart.grid.labels.axis.yLabel && ! chartConfig.chart.grid.labels.yAxis.useIndividualScale" |
| 618 | + :font-size="chartConfig.chart.grid.labels.axis.fontSize" |
| 619 | + :fill="chartConfig.chart.grid.labels.color" |
| 620 | + :transform="`translate(${chartConfig.chart.grid.labels.axis.fontSize + chartConfig.chart.grid.labels.axis.yLabelOffsetX}, ${drawingArea.top + drawingArea.height / 2}) rotate(-90)`" |
| 621 | + text-anchor="middle" |
| 622 | + style="transition: none" |
| 623 | + > |
616 | 624 | {{ chartConfig.chart.grid.labels.axis.yLabel }} |
617 | 625 | </text> |
618 | 626 | <text |
619 | 627 | data-cy="xy-axis-xLabel" |
620 | 628 | v-if="chartConfig.chart.grid.labels.axis.xLabel" |
621 | 629 | text-anchor="middle" |
622 | 630 | :x="chartConfig.chart.width / 2" |
623 | | - :y="drawingArea.bottom + chartConfig.chart.grid.labels.axis.fontSize + chartConfig.chart.grid.labels.xAxisLabels.fontSize * 1.3" |
| 631 | + :y="drawingArea.bottom + chartConfig.chart.grid.labels.axis.fontSize + (chartConfig.chart.grid.labels.xAxisLabels.fontSize * 1.3) + chartConfig.chart.grid.labels.axis.xLabelOffsetY" |
624 | 632 | :font-size="chartConfig.chart.grid.labels.axis.fontSize" |
625 | 633 | :fill="chartConfig.chart.grid.labels.color" |
626 | 634 | > |
@@ -1498,18 +1506,6 @@ export default { |
1498 | 1506 | }) |
1499 | 1507 | } |
1500 | 1508 |
|
1501 | | - const that = this; |
1502 | | - const yLabel = document.getElementById("yAxisLabel"); |
1503 | | - if(yLabel) { |
1504 | | - const bboxY = yLabel.getBBox(); |
1505 | | - const xPosition = bboxY.height / 2 + this.chartConfig.chart.padding.left / 5; |
1506 | | - const yPosition = this.chartConfig.chart.height / 2; |
1507 | | - yLabel.setAttributeNS(null, "transform", `rotate(-90, ${xPosition}, ${yPosition})`); |
1508 | | - yLabel.setAttributeNS(null, "x", xPosition); |
1509 | | - yLabel.setAttributeNS(null, "y", yPosition); |
1510 | | - yLabel.setAttributeNS(null, "font-size", this.chartConfig.chart.grid.labels.axis.fontSize); |
1511 | | - } |
1512 | | -
|
1513 | 1509 | if(this.chartConfig.showWarnings) { |
1514 | 1510 | this.dataset.forEach((datapoint) => { |
1515 | 1511 | datapoint.series.forEach((s, j) => { |
|
0 commit comments