@oliasoft-open-source/charts-library 2.5.6 → 2.5.8
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/bar-chart.jsx +5 -8
- package/src/components/controls/controls.jsx +1 -1
- package/src/components/line-chart/line-chart.jsx +5 -8
- package/src/components/line-chart/line-chart.stories.jsx +9 -0
- package/src/components/pie-chart/pie-chart.jsx +6 -4
package/package.json
CHANGED
package/release-notes.md
CHANGED
|
@@ -201,17 +201,14 @@ const BarChart = (props) => {
|
|
|
201
201
|
onHover,
|
|
202
202
|
indexAxis: isVertical(options.direction) ? AxisType.X : AxisType.Y,
|
|
203
203
|
maintainAspectRatio: chartStyling.maintainAspectRatio,
|
|
204
|
-
animation:
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
animation: chartStyling.performanceMode
|
|
205
|
+
? false
|
|
206
|
+
: {
|
|
207
|
+
duration: ANIMATION_DURATION.FAST,
|
|
208
|
+
},
|
|
209
209
|
hover: {
|
|
210
210
|
mode: ChartHoverMode.Nearest,
|
|
211
211
|
intersect: true,
|
|
212
|
-
animationDuration: chartStyling.performanceMode
|
|
213
|
-
? ANIMATION_DURATION.NO
|
|
214
|
-
: ANIMATION_DURATION.SLOW,
|
|
215
212
|
},
|
|
216
213
|
elements: {
|
|
217
214
|
bar: { pointStyle: PointStyle.Circle },
|
|
@@ -37,7 +37,7 @@ const Controls = ({
|
|
|
37
37
|
return (
|
|
38
38
|
<>
|
|
39
39
|
<div className={styles.controls}>
|
|
40
|
-
|
|
40
|
+
{headerComponent || <Text bold>{chart.options.title}</Text>}
|
|
41
41
|
<div className={styles.buttons}>
|
|
42
42
|
{!showTable && (
|
|
43
43
|
<>
|
|
@@ -435,17 +435,14 @@ const LineChart = (props) => {
|
|
|
435
435
|
onHover,
|
|
436
436
|
maintainAspectRatio: chartStyling.maintainAspectRatio,
|
|
437
437
|
aspectRatio: chartStyling.squareAspectRatio ? 1 : null, // 1 equals square aspect ratio
|
|
438
|
-
animation:
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
438
|
+
animation: chartStyling.performanceMode
|
|
439
|
+
? false
|
|
440
|
+
: {
|
|
441
|
+
duration: ANIMATION_DURATION.FAST,
|
|
442
|
+
},
|
|
443
443
|
hover: {
|
|
444
444
|
mode: ChartHoverMode.Nearest,
|
|
445
445
|
intersect: true,
|
|
446
|
-
animationDuration: chartStyling.performanceMode
|
|
447
|
-
? ANIMATION_DURATION.NO
|
|
448
|
-
: ANIMATION_DURATION.SLOW,
|
|
449
446
|
},
|
|
450
447
|
elements: {
|
|
451
448
|
line: {
|
|
@@ -522,6 +522,15 @@ export const HeaderComponent = (args) => {
|
|
|
522
522
|
);
|
|
523
523
|
};
|
|
524
524
|
|
|
525
|
+
export const HeaderComponentFullWidth = Template.bind({});
|
|
526
|
+
HeaderComponentFullWidth.args = {
|
|
527
|
+
headerComponent: (
|
|
528
|
+
<div style={{ flexGrow: 1, minWidth: 150 }}>
|
|
529
|
+
<Slider max={100} min={0} onChange={() => {}} showArrows value={50} />
|
|
530
|
+
</div>
|
|
531
|
+
),
|
|
532
|
+
};
|
|
533
|
+
|
|
525
534
|
export const SubheaderComponent = Template.bind({});
|
|
526
535
|
SubheaderComponent.args = {
|
|
527
536
|
subheaderComponent: (
|
|
@@ -15,6 +15,7 @@ import zoomPlugin from 'chartjs-plugin-zoom';
|
|
|
15
15
|
import dataLabelsPlugin from 'chartjs-plugin-datalabels';
|
|
16
16
|
import { Pie } from 'react-chartjs-2';
|
|
17
17
|
|
|
18
|
+
import { ANIMATION_DURATION } from '../../helpers/chart-consts';
|
|
18
19
|
import styles from './pie-chart.module.less';
|
|
19
20
|
import { colors, generateRandomColor } from './pie-chart-utils';
|
|
20
21
|
import { getDefaultProps, PieChartPropTypes } from './pie-chart-prop-types';
|
|
@@ -404,13 +405,14 @@ const PieChart = (props) => {
|
|
|
404
405
|
onClick,
|
|
405
406
|
responsive: true, // Defaults to true, should be removed
|
|
406
407
|
maintainAspectRatio: options.chartStyling.maintainAspectRatio,
|
|
407
|
-
animation:
|
|
408
|
-
|
|
409
|
-
|
|
408
|
+
animation: options.chartStyling.performanceMode
|
|
409
|
+
? false
|
|
410
|
+
: {
|
|
411
|
+
duration: ANIMATION_DURATION.FAST,
|
|
412
|
+
},
|
|
410
413
|
hover: {
|
|
411
414
|
mode: 'nearest',
|
|
412
415
|
intersect: 'true',
|
|
413
|
-
animationDuration: options.chartStyling.performanceMode ? 0 : 400,
|
|
414
416
|
},
|
|
415
417
|
onHover,
|
|
416
418
|
elements: {
|