|
|
@@ -227,15 +227,19 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
generateCurvePath(values, type) {
|
|
|
- const points = values.map((value, i) => ({
|
|
|
- x: this.getPointX(i),
|
|
|
- y: this.getPointY2(value, type)
|
|
|
- }))
|
|
|
-
|
|
|
- let path = `M ${points[0].x} ${points[0].y}`
|
|
|
+ let path = ''
|
|
|
+ if (values.length > 0) {
|
|
|
+ const points = values.map((value, i) => ({
|
|
|
+ x: this.getPointX(i),
|
|
|
+ y: this.getPointY2(value, type)
|
|
|
+ }))
|
|
|
|
|
|
- path += this.generateCurveSegment(points)
|
|
|
+ path = `M ${points[0]?.x} ${points[0]?.y}`
|
|
|
|
|
|
+ path += this.generateCurveSegment(points)
|
|
|
+ } else {
|
|
|
+ path = 'M 0 0'
|
|
|
+ }
|
|
|
return path
|
|
|
},
|
|
|
generateCurveSegment(points) {
|