@oliasoft-open-source/charts-library 2.5.24 → 2.5.25

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.5.24",
3
+ "version": "2.5.25",
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,9 @@
1
1
  # Charts Library Release Notes
2
2
 
3
+ ## 2.5.25
4
+
5
+ - Fix axis ranges updating when new chart data and ranges is passed
6
+
3
7
  ## 2.5.24
4
8
 
5
9
  - Add performance test case
@@ -129,6 +129,24 @@ const LineChart = (props) => {
129
129
  initialState,
130
130
  );
131
131
 
132
+ useEffect(() => {
133
+ const { range } = props.chart.options.additionalAxesOptions;
134
+ if (range) {
135
+ const axes = Object.entries(range).map(([key, { min, max }]) => {
136
+ return {
137
+ id: key,
138
+ min: min ?? 0,
139
+ max: max ?? 0,
140
+ };
141
+ });
142
+
143
+ dispatch({
144
+ type: UPDATE_AXES_RANGES,
145
+ payload: { axes },
146
+ });
147
+ }
148
+ }, [props.chart.options.additionalAxesOptions.range]);
149
+
132
150
  useEffect(() => {
133
151
  if (chartOptions.enablePan !== true) {
134
152
  dispatch({ type: TOGGLE_PAN });