Skip to content

Commit 7bd1b33

Browse files
committed
VueUiQuickChart fixed negative bar height issue
1 parent 64254f7 commit 7bd1b33

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
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": "2.1.7",
4+
"version": "2.1.8",
55
"type": "module",
66
"description": "A user-empowering data visualization Vue components library",
77
"keywords": [

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3302,7 +3302,7 @@ const quickDatasetLine = ref([
33023302
33033303
33043304
const quickDatasetSimpleLine = ref([1, 2, 3, 5, 8, 13, 21, 34, 55, 89])
3305-
const quickDatasetSimpleBar = ref([1, 2, -3, 5, 8])
3305+
const quickDatasetSimpleBar = ref([1, 2, -10, -5, 8])
33063306
33073307
const quickDatasetBar = ref([
33083308
{

src/components/vue-ui-quick-chart.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ const bar = computed(() => {
476476
...d,
477477
coordinates: d.values.map((v,j) => {
478478
const barHeight = (((v + absoluteMin) / (extremes.max + absoluteMin)) * drawingArea.height)
479-
const barHeightNegative = (Math.abs(v) / Math.abs(extremes.min) * (drawingArea.height - absoluteZero))
479+
const barHeightNegative = (Math.abs(v) / (extremes.max + absoluteMin) * (drawingArea.height))
480480
const absoluteMinHeight = (absoluteMin / (extremes.max + absoluteMin)) * drawingArea.height;
481481
const barWidth = (slotSize / ds.filter(d => !segregated.value.includes(d.id)).length) - (quickConfig.value.barGap / ds.filter(d => !segregated.value.includes(d.id)).length);
482482

0 commit comments

Comments
 (0)