From 6618c434202b44176d8fc035a0dbea8fd9cdbb51 Mon Sep 17 00:00:00 2001 From: graphieros Date: Fri, 8 Mar 2024 19:26:33 +0100 Subject: [PATCH] VueUiXy layout improvements for bar types only edge cases --- package-lock.json | 4 +- package.json | 2 +- src/App.vue | 78 ++++++++++++++++++++++++++++-------- src/components/vue-ui-xy.vue | 46 +++++++++++++-------- src/default_configs.json | 9 +++++ src/lib.js | 31 ++++++++++++-- tests/lib.test.js | 29 ++++++++++++++ types/vue-data-ui.d.ts | 9 +++++ 8 files changed, 168 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index b12b1d39..51f352df 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "vue-data-ui", - "version": "2.0.10", + "version": "2.0.12", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "vue-data-ui", - "version": "2.0.10", + "version": "2.0.12", "license": "MIT", "devDependencies": { "@vitejs/plugin-vue": "^4.2.3", diff --git a/package.json b/package.json index ba50f00c..8cb6af81 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "vue-data-ui", "private": false, - "version": "2.0.11", + "version": "2.0.12", "type": "module", "description": "A user-empowering data visualization Vue components library", "keywords": [ diff --git a/src/App.vue b/src/App.vue index e229246f..62bfc2df 100644 --- a/src/App.vue +++ b/src/App.vue @@ -53,11 +53,34 @@ import { getVueDataUiConfig } from "vue-data-ui"; const dataset = ref([ { - name: "Series 1", - series: [200, 100, 125, 230, 120, 100, 90, 50, 12, 25, 100, 154, 155], - type: "line", + name: "Serie 1", + series: [200], + type: "bar", + dataLabels: true + }, + { + name: "Some long name", + series: [100], + type: "bar", + dataLabels: true + }, + { + name: "Some even longer name", + series: [150], + type: "bar", + }, + { + name: "Weird serie name", + series: [90], + type: "bar", + }, + { + name: "Another weird long name", + series: [120], + type: "bar", }, ]); + const dataset2 = ref([ { name: "Series 1", @@ -2342,13 +2365,30 @@ const donutConfig = ref({ const xyConfig = ref({ chart: { - tooltip: { - customFormat: ({ seriesIndex, datapoint, series, bars, lines, plots, config }) => { - console.log({seriesIndex, datapoint, series, bars, lines, plots, config}); - return 'TEST' - } - } - } + labels: { + fontSize: 30 + }, + // tooltip: { + // customFormat: ({ seriesIndex, datapoint, series, bars, lines, plots, config }) => { + // console.log({seriesIndex, datapoint, series, bars, lines, plots, config}); + // return 'TEST' + // } + // } + }, + bar: { + labels: { + show: false, + }, + serieName: { + show: true, + offsetY: -6, + useAbbreviation: true, + abbreviationSize: 4, + useSerieColor: true, + color: "#FF0000", + bold: true + } + }, }) const waffleConfig = ref({ @@ -2747,7 +2787,7 @@ function selectHistoDatapoint({ datapoint, index }) { - + - + + - +