File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,14 @@ const props = defineProps({
4545 selectedIndex: {
4646 type: Number ,
4747 default: undefined
48+ },
49+ heightRatio: {
50+ type: Number ,
51+ default: 1
52+ },
53+ forcedPadding: {
54+ type: Number ,
55+ default: 30
4856 }
4957});
5058
@@ -185,7 +193,7 @@ function prepareChart() {
185193 svg .value .width = width;
186194 svg .value .height = height;
187195 svg .value .chartWidth = FINAL_CONFIG .value .style .chartWidth / 500 * width;
188- svg .value .padding = 30 / 500 * width;
196+ svg .value .padding = props . forcedPadding / 500 * width;
189197 });
190198
191199 resizeObserver .value = new ResizeObserver (handleResize);
@@ -194,10 +202,10 @@ function prepareChart() {
194202}
195203
196204const svg = ref ({
197- height: 80 ,
205+ height: 80 * props . heightRatio ,
198206 width: 500 ,
199207 chartWidth: FINAL_CONFIG .value .style .chartWidth ,
200- padding: 30
208+ padding: props . forcedPadding
201209});
202210
203211const emits = defineEmits ([' hoverIndex' , ' selectDatapoint' ])
@@ -338,7 +346,7 @@ function selectDatapoint(datapoint, index) {
338346 </script >
339347
340348<template >
341- <div ref =" sparklineChart" class =" vue-ui-sparkline" :id =" uid" :style =" `width:100%;font-family:${FINAL_CONFIG.style.fontFamily}`" >
349+ <div ref =" sparklineChart" class =" vue-ui-sparkline" :id =" uid" :style =" `width:100%;font-family:${FINAL_CONFIG.style.fontFamily}; `" >
342350 <!-- SLOT BEFORE -->
343351 <slot
344352 name =" before"
You can’t perform that action at this time.
0 commit comments