Skip to content

Commit 2a74c15

Browse files
committed
VueUiSparkHistogram add offsetY config property to value label
1 parent 4187b6d commit 2a74c15

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "vue-data-ui",
33
"private": false,
4-
"version": "1.9.38",
4+
"version": "1.9.39",
55
"type": "module",
66
"description": "A user-empowering data visualization Vue components library",
77
"keywords": [

src/App.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3326,7 +3326,8 @@ const histoConfig = ref({
33263326
"bold": true,
33273327
"rounding": 1,
33283328
"prefix":"",
3329-
"suffix":""
3329+
"suffix":"",
3330+
"offsetY": -6
33303331
},
33313332
"valueLabel": {
33323333
"fontSize": 14,

src/components/vue-ui-sparkhistogram.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ const selectedIndex = ref(null);
151151
:data-cy="`sparkhistogram-value-label-${i}`"
152152
text-anchor="middle"
153153
:x="val.textAnchor"
154-
:y="val.y - histoConfig.style.labels.value.fontSize / 3"
154+
:y="val.y - (histoConfig.style.labels.value.fontSize / 3) + histoConfig.style.labels.value.offsetY"
155155
:font-size="histoConfig.style.labels.value.fontSize"
156156
:font-weight="histoConfig.style.labels.value.bold ? 'bold' : 'normal'"
157157
:fill="histoConfig.style.labels.value.color"

src/default_configs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2397,7 +2397,8 @@
23972397
"bold": true,
23982398
"rounding": 1,
23992399
"prefix":"",
2400-
"suffix":""
2400+
"suffix":"",
2401+
"offsetY": 0
24012402
},
24022403
"valueLabel": {
24032404
"fontSize": 14,

types/vue-data-ui.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ declare module 'vue-data-ui' {
368368
rounding?: number;
369369
prefix?: string;
370370
suffix?: string;
371+
offsetY?: number;
371372
};
372373
valueLabel?: {
373374
fontSize?: number;

0 commit comments

Comments
 (0)