|
105 | 105 | v-for="l in yLabels" |
106 | 106 | :x1="drawingArea.left + xPadding" |
107 | 107 | :x2="drawingArea.right - xPadding" |
108 | | - :y1="l.y" |
109 | | - :y2="l.y" |
| 108 | + :y1="checkNaN(l.y)" |
| 109 | + :y2="checkNaN(l.y)" |
110 | 110 | :stroke="FINAL_CONFIG.chart.grid.stroke" |
111 | 111 | :stroke-width="0.5" |
112 | 112 | stroke-linecap="round" |
|
120 | 120 | v-for="l in grid.yLabels" |
121 | 121 | :x1="drawingArea.left + xPadding" |
122 | 122 | :x2="drawingArea.right - xPadding" |
123 | | - :y1="l.y" |
124 | | - :y2="l.y" |
| 123 | + :y1="checkNaN(l.y)" |
| 124 | + :y2="checkNaN(l.y)" |
125 | 125 | :stroke="grid.color" |
126 | 126 | :stroke-width="0.5" |
127 | 127 | stroke-linecap="round" |
|
132 | 132 | v-for="l in grid.yLabels" |
133 | 133 | :x1="drawingArea.left + xPadding" |
134 | 134 | :x2="drawingArea.right - xPadding" |
135 | | - :y1="l.y" |
136 | | - :y2="l.y" |
| 135 | + :y1="checkNaN(l.y)" |
| 136 | + :y2="checkNaN(l.y)" |
137 | 137 | :stroke="FINAL_CONFIG.chart.grid.stroke" |
138 | 138 | :stroke-width="0.5" |
139 | 139 | stroke-linecap="round" |
@@ -1593,9 +1593,12 @@ export default { |
1593 | 1593 | min: datapoint.scaleMin || Math.min(...datapoint.absoluteValues.filter(v => ![undefined,null].includes(v))) > 0 ? 0 : Math.min(...datapoint.absoluteValues.filter(v => ![null, undefined].includes(v))) |
1594 | 1594 | }; |
1595 | 1595 | const scaleSteps = datapoint.scaleSteps || this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps; |
| 1596 | +
|
| 1597 | + const corrector = 0.0000001; |
| 1598 | +
|
| 1599 | + const individualScale = this.calculateNiceScaleWithExactExtremes(individualExtremes.min, individualExtremes.max === individualExtremes.min ? individualExtremes.max * corrector : individualExtremes.max, scaleSteps); |
1596 | 1600 | |
1597 | | - const individualScale = this.calculateNiceScaleWithExactExtremes(individualExtremes.min, individualExtremes.max, scaleSteps); |
1598 | | - const autoScaleSteps = this.calculateNiceScaleWithExactExtremes(autoScale.valueMin, autoScale.valueMax, scaleSteps); |
| 1601 | + const autoScaleSteps = this.calculateNiceScaleWithExactExtremes(autoScale.valueMin, autoScale.valueMax === autoScale.valueMin ? autoScale.valueMax * corrector : autoScale.valueMax, scaleSteps); |
1599 | 1602 |
|
1600 | 1603 | const individualZero = individualScale.min >= 0 ? 0 : Math.abs(individualScale.min); |
1601 | 1604 | const autoScaleZero = 0; |
@@ -1716,9 +1719,11 @@ export default { |
1716 | 1719 |
|
1717 | 1720 | const scaleSteps = datapoint.scaleSteps || this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps |
1718 | 1721 |
|
1719 | | - const individualScale = this.calculateNiceScaleWithExactExtremes(individualExtremes.min, individualExtremes.max, scaleSteps); |
| 1722 | + const corrector = 0.0000001; |
| 1723 | +
|
| 1724 | + const individualScale = this.calculateNiceScaleWithExactExtremes(individualExtremes.min, individualExtremes.max === individualExtremes.min ? individualExtremes.max * corrector : individualExtremes.max, scaleSteps); |
1720 | 1725 | |
1721 | | - const autoScaleSteps = this.calculateNiceScaleWithExactExtremes(autoScale.valueMin, autoScale.valueMax, scaleSteps); |
| 1726 | + const autoScaleSteps = this.calculateNiceScaleWithExactExtremes(autoScale.valueMin, autoScale.valueMax === autoScale.valueMin ? autoScale.valueMax * corrector : autoScale.valueMax, scaleSteps); |
1722 | 1727 |
|
1723 | 1728 | const individualZero = (individualScale.min >= 0 ? 0 : Math.abs(individualScale.min)); |
1724 | 1729 | const autoScaleZero = 0; |
@@ -1818,9 +1823,13 @@ export default { |
1818 | 1823 | min: datapoint.scaleMin || Math.min(...datapoint.absoluteValues) > 0 ? 0 : Math.min(...datapoint.absoluteValues) |
1819 | 1824 | }; |
1820 | 1825 |
|
1821 | | - const scaleSteps = datapoint.scaleSteps || this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps |
1822 | | - const individualScale = this.calculateNiceScaleWithExactExtremes(individualExtremes.min, individualExtremes.max, scaleSteps) |
1823 | | - const autoScaleSteps = this.calculateNiceScaleWithExactExtremes(autoScale.valueMin, autoScale.valueMax, scaleSteps); |
| 1826 | + const scaleSteps = datapoint.scaleSteps || this.FINAL_CONFIG.chart.grid.labels.yAxis.commonScaleSteps; |
| 1827 | +
|
| 1828 | + const corrector = 0.0000001; |
| 1829 | +
|
| 1830 | + const individualScale = this.calculateNiceScaleWithExactExtremes(individualExtremes.min, individualExtremes.max === individualExtremes.min ? individualExtremes.max * corrector : individualExtremes.max, scaleSteps); |
| 1831 | + |
| 1832 | + const autoScaleSteps = this.calculateNiceScaleWithExactExtremes(autoScale.valueMin, autoScale.valueMax === autoScale.valueMin ? autoScale.valueMax * corrector : autoScale.valueMax, scaleSteps); |
1824 | 1833 |
|
1825 | 1834 | const individualZero = individualScale.min >= 0 ? 0 : Math.abs(individualScale.min); |
1826 | 1835 | const autoScaleZero = 0; |
@@ -2457,7 +2466,7 @@ export default { |
2457 | 2466 | return closest; |
2458 | 2467 | }, |
2459 | 2468 | ratioToMax(value) { |
2460 | | - return value / this.absoluteMax; |
| 2469 | + return value / (this.canShowValue(this.absoluteMax) ? this.absoluteMax : 1); |
2461 | 2470 | }, |
2462 | 2471 | selectX(index) { |
2463 | 2472 | this.$emit('selectX', |
|
0 commit comments