diff --git a/src/components/Charts/LineChart.vue b/src/components/Charts/LineChart.vue index 7d296626..2f440543 100644 --- a/src/components/Charts/LineChart.vue +++ b/src/components/Charts/LineChart.vue @@ -81,6 +81,7 @@ [] }, xLabels: { type: Array, default: () => [] }, yLabelDivisions: { type: Number, default: 4 }, - points: { type: Array, default: () => [[100, 200, 300, 400, 500]] }, + points: { type: Array, default: () => [[]] }, drawAxis: { type: Boolean, default: false }, drawXGrid: { type: Boolean, default: true }, viewBoxHeight: { type: Number, default: 500 }, @@ -141,7 +144,7 @@ export default { yLabelOffset: { type: Number, default: 5 }, gridColor: { type: String, default: 'rgba(0, 0, 0, 0.2)' }, axisColor: { type: String, default: 'rgba(0, 0, 0, 0.5)' }, - thickness: { type: Number, default: 4 }, + thickness: { type: Number, default: 5 }, axisThickness: { type: Number, default: 1 }, gridThickness: { type: Number, default: 0.5 }, yMin: { type: Number, default: null }, @@ -245,9 +248,9 @@ export default { ); }, yScalerValue(i) { - return this.formatY( - (i * (this.max - this.min)) / this.yLabelDivisions + this.min - ); + const max = this.yMax ?? this.max; + const min = this.yMin ?? this.min; + return this.formatY((i * (max - min)) / this.yLabelDivisions + min); }, getLine(i) { const [x, y] = this.xy[0];