@oliasoft-open-source/charts-library 2.9.0 → 2.9.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oliasoft-open-source/charts-library",
3
- "version": "2.9.0",
3
+ "version": "2.9.2",
4
4
  "description": "React Chart Library (based on Chart.js and react-chart-js-2)",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/release-notes.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Charts Library Release Notes
2
2
 
3
+ ## 2.9.2
4
+
5
+ - Fix missing axis scale when in dataset is one point with negative values ([OW-10616](https://oliasoft.atlassian.net/browse/OW-10616))
6
+
7
+ ## 2.9.1
8
+
9
+ - Fix decimal values in BarChart in tooltips for locales with comma decimal ([OW-10632](https://oliasoft.atlassian.net/browse/OW-10632))
10
+
3
11
  ## 2.9.0
4
12
 
5
13
  - Add double-click event on chart area, change reset chart ranges from one click to double click ([OW-10412](https://oliasoft.atlassian.net/browse/OW-10412))
@@ -46,7 +46,8 @@ const getBarChartToolTips = (options) => {
46
46
 
47
47
  const getTooltipItemValue = () => {
48
48
  const { formattedValue } = tooltipItem;
49
- const labelNumber = Number(formattedValue);
49
+ const formattedValueWithDotSeparator = formattedValue.replace(',', '.');
50
+ const labelNumber = Number(formattedValueWithDotSeparator);
50
51
 
51
52
  let labelNumberFormatted;
52
53
  if (Math.abs(labelNumber) < 1) {
@@ -54,9 +54,11 @@ export const getSuggestedAxisRange = ({
54
54
  const padding = point * whiteSpacePercentage;
55
55
  const minAxisValue = beginAtZero && !isNegative ? 0 : point - padding;
56
56
  const maxAxisValue = beginAtZero && isNegative ? 0 : point + padding;
57
+ const roundedMinAxisValue = round(maxAxisValue);
58
+ const roundedMaxAxisValue = round(minAxisValue);
57
59
  return {
58
- min: round(minAxisValue),
59
- max: round(maxAxisValue),
60
+ min: roundedMinAxisValue < 0 ? roundedMinAxisValue : roundedMaxAxisValue,
61
+ max: roundedMaxAxisValue < 0 ? roundedMaxAxisValue : roundedMinAxisValue,
60
62
  };
61
63
  }
62
64