@oliasoft-open-source/charts-library 4.8.1 → 4.8.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/dist/index.js CHANGED
@@ -26256,6 +26256,7 @@ const useChartPlugins = ({ options, resetZoom: resetZoom2 }) => {
26256
26256
  ];
26257
26257
  }, [handleDoubleClick]);
26258
26258
  };
26259
+ const RANGE_GAP = 1;
26259
26260
  const useToggleCustomLegendVisibility = (memoState, memoOptions) => {
26260
26261
  var _a2, _b2;
26261
26262
  useEffect(() => {
@@ -26297,10 +26298,15 @@ const useUpdateAxesRanges = ({
26297
26298
  if (range && isRangeValid(range)) {
26298
26299
  const newAxes = Object.entries(range).map(([key, { min, max }]) => {
26299
26300
  const { min: minFromData = 0, max: maxFromData = 0 } = getAxisRangeByType(chartRef, key, annotationsData) ?? {};
26301
+ let finalMin = min ?? minFromData;
26302
+ let finalMax = max ?? maxFromData;
26303
+ if (finalMin === finalMax) {
26304
+ finalMax += RANGE_GAP;
26305
+ }
26300
26306
  return {
26301
26307
  id: key,
26302
- min: min ?? minFromData,
26303
- max: max ?? maxFromData
26308
+ min: finalMin,
26309
+ max: finalMax
26304
26310
  };
26305
26311
  });
26306
26312
  const mergedAxes = [...prevAxes.current ?? []].map((axis) => {