@@ -204,11 +204,11 @@ const mutableDataset = computed(() => {
204204 period: s .period ,
205205 plotValue: absoluteValue + absoluteMin .value ,
206206 toMax: ratioToMax (absoluteValue + absoluteMin .value ),
207- x: drawingArea .value .start + (i * ((drawingArea .value .width / (len .value + 1 )) > 30 ? 30 : (drawingArea .value .width / (len .value + 1 )))),
207+ x: drawingArea .value .start + (i * ((drawingArea .value .width / (len .value + 1 )) > svg . padding ? svg . padding : (drawingArea .value .width / (len .value + 1 )))),
208208 y: drawingArea .value .bottom - (drawingArea .value .height * ratioToMax (absoluteValue + absoluteMin .value )),
209209 id: ` plot_${ uid .value } _${ i} ` ,
210210 color: isBar .value ? FINAL_CONFIG .value .style .bar .color : FINAL_CONFIG .value .style .area .useGradient ? shiftHue (FINAL_CONFIG .value .style .line .color , 0.05 * ( 1 - (i / len .value ))) : FINAL_CONFIG .value .style .line .color ,
211- width: (drawingArea .value .width / (len .value + 1 )) > 30 ? 30 : (drawingArea .value .width / (len .value + 1 ))
211+ width: (drawingArea .value .width / (len .value + 1 )) > svg . padding ? svg . padding : (drawingArea .value .width / (len .value + 1 ))
212212 }
213213 })
214214});
@@ -442,10 +442,10 @@ function selectDatapoint(datapoint, index) {
442442 <rect
443443 v-for =" (plot, i) in mutableDataset"
444444 :data-cy =" `sparkline-mouse-trap-${i}`"
445- :x =" plot.x - ((drawingArea.width / (len + 1) > 30 ? 30 : drawingArea.width / (len + 1)) / 2)"
445+ :x =" plot.x - ((drawingArea.width / (len + 1) > svg.padding ? svg.padding : drawingArea.width / (len + 1)) / 2)"
446446 :y =" drawingArea.top - 6"
447447 :height =" drawingArea.height + 6"
448- :width =" (drawingArea.width / (len + 1) > 30 ? 30 : drawingArea.width / (len + 1))"
448+ :width =" (drawingArea.width / (len + 1) > svg.padding ? svg.padding : drawingArea.width / (len + 1))"
449449 fill =" transparent"
450450 @mouseenter =" selectPlot(plot, i)"
451451 @mouseleave =" unselectPlot"
0 commit comments