@tekkare/auriga 0.2.11 → 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.11"
7
+ "version": "0.2.12"
8
8
  }
@@ -115,6 +115,12 @@ export default defineComponent({
115
115
  const seriesData = props.series;
116
116
  const hasPercentages = props.withPercentages;
117
117
  const compactMode = props.compactValues;
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);
118
124
  if (props.hideLegend) {
119
125
  props.options["legend"] = { show: false };
120
126
  }
@@ -162,6 +168,7 @@ export default defineComponent({
162
168
  } else {
163
169
  props.options["title"] = { align: "center" };
164
170
  }
171
+ props.options["yaxis"] = { min: minValue.value, show: false };
165
172
  if (props.colors) {
166
173
  props.options["colors"] = props.colors;
167
174
  }
@@ -253,7 +260,6 @@ export default defineComponent({
253
260
  }
254
261
  }
255
262
  };
256
- props.options["yaxis"] = { min: 0, show: false };
257
263
  if (props.options["markers"] === void 0) {
258
264
  props.options["markers"] = { size: 0, showNullDataPoints: true };
259
265
  }
@@ -263,7 +269,10 @@ export default defineComponent({
263
269
  props.options["tooltip"] = {
264
270
  y: {
265
271
  formatter(value, { series, seriesIndex, dataPointIndex, w }) {
266
- return value.toFixed(1);
272
+ return value?.toLocaleString("fr-FR", {
273
+ minimumFractionDigits: 0,
274
+ maximumFractionDigits: 1
275
+ }).replace(",", ".");
267
276
  }
268
277
  },
269
278
  shared: false
@@ -344,7 +353,6 @@ export default defineComponent({
344
353
  }
345
354
  }
346
355
  };
347
- props.options["yaxis"] = { show: false, min: 0 };
348
356
  } else if (props.type === "bar-horizontal") {
349
357
  let predefinedColors = false;
350
358
  if (props.colors) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tekkare/auriga",
3
- "version": "0.2.11",
3
+ "version": "0.2.12",
4
4
  "description": "Aurgia is a UI kit developped by Tekkare",
5
5
  "license": "MIT",
6
6
  "type": "module",