@oliasoft-open-source/charts-library 2.8.0 → 2.9.1
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 +1 -1
- package/release-notes.md +8 -0
- package/src/components/bar-chart/get-bar-chart-tooltips.js +2 -1
- package/src/components/controls/axes-options/axes-options.jsx +1 -1
- package/src/components/controls/drag-options.jsx +2 -2
- package/src/components/line-chart/line-chart.jsx +22 -3
package/package.json
CHANGED
package/release-notes.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Charts Library Release Notes
|
|
2
2
|
|
|
3
|
+
## 2.9.1
|
|
4
|
+
|
|
5
|
+
- Fix decimal values in BarChart in tooltips for locales with comma decimal ([OW-10632](https://oliasoft.atlassian.net/browse/OW-10632))
|
|
6
|
+
|
|
7
|
+
## 2.9.0
|
|
8
|
+
|
|
9
|
+
- 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))
|
|
10
|
+
|
|
3
11
|
## 2.8.0
|
|
4
12
|
|
|
5
13
|
- Simplify dist-tag strategy for beta version releases (to reduce cleanup effort) ([OW-10003](https://oliasoft.atlassian.net/browse/OW-10003))
|
|
@@ -46,7 +46,8 @@ const getBarChartToolTips = (options) => {
|
|
|
46
46
|
|
|
47
47
|
const getTooltipItemValue = () => {
|
|
48
48
|
const { formattedValue } = tooltipItem;
|
|
49
|
-
const
|
|
49
|
+
const formattedValueWithDotSeparator = formattedValue.replace(',', '.');
|
|
50
|
+
const labelNumber = Number(formattedValueWithDotSeparator);
|
|
50
51
|
|
|
51
52
|
let labelNumberFormatted;
|
|
52
53
|
if (Math.abs(labelNumber) < 1) {
|
|
@@ -23,7 +23,7 @@ export const DragOptions = ({
|
|
|
23
23
|
Hold shift to change axis
|
|
24
24
|
</Text> */}
|
|
25
25
|
<Text small muted>
|
|
26
|
-
|
|
26
|
+
Double click on canvas to reset
|
|
27
27
|
</Text>
|
|
28
28
|
</Flex>
|
|
29
29
|
),
|
|
@@ -42,7 +42,7 @@ export const DragOptions = ({
|
|
|
42
42
|
Hold shift to change axis
|
|
43
43
|
</Text> */}
|
|
44
44
|
<Text small muted>
|
|
45
|
-
|
|
45
|
+
Double click on canvas to reset
|
|
46
46
|
</Text>
|
|
47
47
|
</Flex>
|
|
48
48
|
),
|
|
@@ -295,7 +295,8 @@ const LineChart = (props) => {
|
|
|
295
295
|
chartInstance.update();
|
|
296
296
|
};
|
|
297
297
|
|
|
298
|
-
const
|
|
298
|
+
const resetZoom = () => {
|
|
299
|
+
const chartInstance = chartRef.current;
|
|
299
300
|
chartInstance.resetZoom();
|
|
300
301
|
dispatch({ type: RESET_AXES_RANGES });
|
|
301
302
|
};
|
|
@@ -459,7 +460,6 @@ const LineChart = (props) => {
|
|
|
459
460
|
datasets: generatedDatasets,
|
|
460
461
|
}}
|
|
461
462
|
options={{
|
|
462
|
-
onClick,
|
|
463
463
|
onHover,
|
|
464
464
|
maintainAspectRatio: chartStyling.maintainAspectRatio,
|
|
465
465
|
aspectRatio: chartStyling.squareAspectRatio ? 1 : null, // 1 equals square aspect ratio
|
|
@@ -517,8 +517,27 @@ const LineChart = (props) => {
|
|
|
517
517
|
borderColor: BORDER_COLOR,
|
|
518
518
|
},
|
|
519
519
|
},
|
|
520
|
+
events: [
|
|
521
|
+
'mousemove',
|
|
522
|
+
'mouseout',
|
|
523
|
+
'click',
|
|
524
|
+
'touchstart',
|
|
525
|
+
'touchmove',
|
|
526
|
+
'dblclick',
|
|
527
|
+
],
|
|
520
528
|
}}
|
|
521
|
-
plugins={
|
|
529
|
+
plugins={[
|
|
530
|
+
...getPlugins(graph, legend, state),
|
|
531
|
+
{
|
|
532
|
+
id: 'customEventCatcher',
|
|
533
|
+
beforeEvent(chart, args, pluginOptions) {
|
|
534
|
+
const { event } = args;
|
|
535
|
+
if (event.type === 'dblclick') {
|
|
536
|
+
resetZoom();
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
},
|
|
540
|
+
]}
|
|
522
541
|
/>
|
|
523
542
|
</div>
|
|
524
543
|
)}
|