@tekkare/auriga 0.2.10 → 0.2.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -4,5 +4,5 @@
4
4
  "compatibility": {
5
5
  "nuxt": "^3.0.0"
6
6
  },
7
- "version": "0.2.10"
7
+ "version": "0.2.12"
8
8
  }
@@ -115,7 +115,15 @@ export default defineComponent({
115
115
  const seriesData = props.series;
116
116
  const hasPercentages = props.withPercentages;
117
117
  const compactMode = props.compactValues;
118
- const hideLegend = props.hideLegend;
118
+ const minValue = ref(0);
119
+ const allValues = props.series.map((a) => a.data).flat();
120
+ if (Math.min(...allValues) > 0) {
121
+ minValue.value = 0;
122
+ } else
123
+ minValue.value = Math.min(...allValues);
124
+ if (props.hideLegend) {
125
+ props.options["legend"] = { show: false };
126
+ }
119
127
  props.options["grid"] = {
120
128
  borderColor: "#EAEAF5",
121
129
  strokeDashArray: 7,
@@ -160,6 +168,7 @@ export default defineComponent({
160
168
  } else {
161
169
  props.options["title"] = { align: "center" };
162
170
  }
171
+ props.options["yaxis"] = { min: minValue.value, show: false };
163
172
  if (props.colors) {
164
173
  props.options["colors"] = props.colors;
165
174
  }
@@ -251,7 +260,6 @@ export default defineComponent({
251
260
  }
252
261
  }
253
262
  };
254
- props.options["yaxis"] = { min: 0, show: false };
255
263
  if (props.options["markers"] === void 0) {
256
264
  props.options["markers"] = { size: 0, showNullDataPoints: true };
257
265
  }
@@ -261,7 +269,10 @@ export default defineComponent({
261
269
  props.options["tooltip"] = {
262
270
  y: {
263
271
  formatter(value, { series, seriesIndex, dataPointIndex, w }) {
264
- return value.toFixed(1);
272
+ return value?.toLocaleString("fr-FR", {
273
+ minimumFractionDigits: 0,
274
+ maximumFractionDigits: 1
275
+ }).replace(",", ".");
265
276
  }
266
277
  },
267
278
  shared: false
@@ -325,9 +336,6 @@ export default defineComponent({
325
336
  ...defaultDataLabelFormatter
326
337
  };
327
338
  }
328
- if (props.hideLegend) {
329
- props.options["legend"] = { show: false };
330
- }
331
339
  if (props.tooltipOptions) {
332
340
  props.options["tooltip"] = props.tooltipOptions;
333
341
  }
@@ -345,7 +353,6 @@ export default defineComponent({
345
353
  }
346
354
  }
347
355
  };
348
- props.options["yaxis"] = { show: false, min: 0 };
349
356
  } else if (props.type === "bar-horizontal") {
350
357
  let predefinedColors = false;
351
358
  if (props.colors) {
@@ -401,9 +408,6 @@ export default defineComponent({
401
408
  ...defaultDataLabelFormatter
402
409
  };
403
410
  }
404
- if (props.hideLegend) {
405
- props.options["legend"] = { show: false };
406
- }
407
411
  if (props.tooltipOptions) {
408
412
  props.options["tooltip"] = props.tooltipOptions;
409
413
  }
@@ -625,12 +629,15 @@ export default defineComponent({
625
629
  }
626
630
  }
627
631
  };
628
- } else if (props.type === "pie") {
632
+ } else if (props.type === "pie" || props.type === "donut") {
629
633
  props.options["labels"] = props.categories;
630
634
  let defaultDataLabelsConfig = {
631
635
  offset: -50,
632
636
  enabled: true,
633
- style: { fontSize: "14px", colors: ["#FFFFFF"] },
637
+ style: {
638
+ fontSize: "14px",
639
+ colors: props.type === "donut" ? ["#3E3F5E"] : ["#FFFFFF"]
640
+ },
634
641
  dropShadow: { enabled: false }
635
642
  };
636
643
  if (props.options.dataLabels && props.options.dataLabels.formatter) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.2.10",
3
+ "version": "0.2.12",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",