@oliasoft-open-source/charts-library 2.5.15 → 2.5.16-0

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.
@@ -1,199 +0,0 @@
1
- import React from 'react';
2
- import { PieChart } from './pie-chart';
3
-
4
- const labels1 = ['label 1', 'label 2', 'label 3'];
5
- const dataset1 = { label: 'data1', data: [3, 8, 7] };
6
- const dataset2 = { label: 'data2', data: [1, 2, 3] };
7
- const dataset3 = { label: 'data3', data: [5, 0, 4] };
8
-
9
- const offsetDataset = {
10
- label: 'spacing data',
11
- offset: 40,
12
- data: [3, 8, 7],
13
- };
14
-
15
- const hoverOffsetDataset = {
16
- label: 'hover data',
17
- data: [3, 8, 7],
18
- hoverOffset: 40,
19
- };
20
-
21
- const datasetDatalabels = {
22
- label: 'data',
23
- data: [
24
- {
25
- value: 210,
26
- label: 'label',
27
- },
28
- {
29
- value: 333,
30
- label: 'labal',
31
- },
32
- {
33
- value: 248,
34
- label: 'lebel',
35
- },
36
- ],
37
- };
38
- const datasetNoDataLabels = {
39
- label: 'data',
40
- data: [210, 333, 248],
41
- };
42
-
43
- const singleChart = {
44
- data: {
45
- labels: labels1,
46
- datasets: [dataset1],
47
- },
48
- };
49
-
50
- const multiplePieData = {
51
- data: {
52
- labels: labels1,
53
- datasets: [dataset1, dataset2, dataset3],
54
- },
55
- };
56
- const stackedMultiplePieData = {
57
- data: {
58
- labels: labels1,
59
- datasets: [dataset1, dataset2, dataset3],
60
- },
61
- options: {
62
- title: 'Stacked',
63
- graph: { stacked: true },
64
- },
65
- };
66
-
67
- const dataLabelsChart = {
68
- data: {
69
- labels: labels1,
70
- datasets: [datasetDatalabels],
71
- },
72
- options: {
73
- title: 'With custom datalabels',
74
- graph: {
75
- showDataLabels: true,
76
- },
77
- },
78
- };
79
- const dataLabelsNumberChart = {
80
- data: {
81
- labels: labels1,
82
- datasets: [datasetNoDataLabels],
83
- },
84
- options: {
85
- title: 'With value as datalabels',
86
- graph: {
87
- showDataLabels: true,
88
- },
89
- },
90
- };
91
-
92
- const dataLabelssTooltips = {
93
- data: {
94
- labels: labels1,
95
- datasets: [datasetDatalabels],
96
- },
97
- options: {
98
- title: 'With datalabels in tooltips',
99
- tooltip: {
100
- showLabelsInTooltips: true,
101
- },
102
- },
103
- };
104
-
105
- const hoverOffsetChart = {
106
- data: {
107
- labels: labels1,
108
- datasets: [hoverOffsetDataset],
109
- },
110
- options: { title: 'Hover offset' },
111
- };
112
-
113
- const offsetChart = {
114
- data: {
115
- labels: labels1,
116
- datasets: [offsetDataset],
117
- },
118
- options: { title: 'Segment offset' },
119
- };
120
-
121
- const animatedChart = {
122
- data: {
123
- labels: labels1,
124
- datasets: [dataset1],
125
- },
126
- options: {
127
- chartStyling: { performanceMode: false },
128
- },
129
- };
130
-
131
- const doughnutPercentage = {
132
- data: {
133
- labels: labels1,
134
- datasets: [dataset1],
135
- },
136
- options: {
137
- title: 'Cutout 50%',
138
- graph: { cutout: '50%' },
139
- },
140
- };
141
-
142
- const doughnutNumber = {
143
- data: {
144
- labels: labels1,
145
- datasets: [dataset1],
146
- },
147
- options: {
148
- title: 'Cutout 20 pixels',
149
- graph: { cutout: 20 },
150
- },
151
- };
152
-
153
- export default {
154
- title: 'PieChart',
155
- component: PieChart,
156
- args: {
157
- chart: singleChart,
158
- },
159
- };
160
-
161
- const Template = (args) => {
162
- return (
163
- <PieChart
164
- // eslint-disable-next-line react/jsx-props-no-spreading
165
- {...args}
166
- />
167
- );
168
- };
169
- export const Default = Template.bind({});
170
-
171
- export const MultipleSets = Template.bind({});
172
- MultipleSets.args = { chart: multiplePieData };
173
-
174
- export const MultipleSetsStacked = Template.bind({});
175
- MultipleSetsStacked.args = { chart: stackedMultiplePieData };
176
-
177
- export const Datalabels = Template.bind({});
178
- Datalabels.args = { chart: dataLabelsChart };
179
-
180
- export const DatalabelsValues = Template.bind({});
181
- DatalabelsValues.args = { chart: dataLabelsNumberChart };
182
-
183
- export const DatalabelsInTooltips = Template.bind({});
184
- DatalabelsInTooltips.args = { chart: dataLabelssTooltips };
185
-
186
- export const Animated = Template.bind({});
187
- Animated.args = { chart: animatedChart };
188
-
189
- export const Doughnut = Template.bind({});
190
- Doughnut.args = { chart: doughnutPercentage };
191
-
192
- export const DoughnutFixedCutout = Template.bind({});
193
- DoughnutFixedCutout.args = { chart: doughnutNumber };
194
-
195
- export const HoverOffset = Template.bind({});
196
- HoverOffset.args = { chart: hoverOffsetChart };
197
-
198
- export const SegmentOffset = Template.bind({});
199
- HoverOffset.args = { chart: offsetChart };
@@ -1,142 +0,0 @@
1
- import React from 'react';
2
- import ScatterChart from './scatter-chart';
3
-
4
- const style = {
5
- colorOrange: '#ED9860',
6
- colorLightGray: '#C8C8C8',
7
- colorDarkGray: '#595959',
8
- };
9
-
10
- const dataPoints = [
11
- { x: 15.5, y: 0, label: '' },
12
- { x: 75, y: 13, label: '' },
13
- { x: 110, y: 85, label: '' },
14
- { x: 212.5, y: 100, label: '' },
15
- ];
16
-
17
- const dataPoints2 = [
18
- { x: 0, y: 15, label: '' },
19
- { x: 90, y: 15, label: '' },
20
- { x: 130, y: 75, label: '' },
21
- { x: 212.5, y: 115, label: '' },
22
- ];
23
-
24
- const dataPoints3 = [
25
- { x: 0, y: 0, label: '' },
26
- { x: 120, y: 75, label: '' },
27
- { x: 155, y: 50, label: '' },
28
- { x: 250, y: 115, label: '' },
29
- ];
30
-
31
- const datasetMultiLines = [
32
- {
33
- label: 'Line 1',
34
- data: dataPoints,
35
- borderColor: style.colorOrange,
36
- backgroundColor: style.colorOrange,
37
- showLine: true,
38
- },
39
- {
40
- label: 'Line 2',
41
- data: dataPoints2,
42
- borderColor: style.colorLightGray,
43
- backgroundColor: style.colorLightGray,
44
- showLine: true,
45
- },
46
- {
47
- label: 'Line 3',
48
- data: dataPoints3,
49
- borderColor: style.colorDarkGray,
50
- backgroundColor: style.colorDarkGray,
51
- showLine: true,
52
- },
53
- ];
54
-
55
- const chartDefault = {
56
- data: {
57
- datasets: [
58
- {
59
- label: 'Default chart',
60
- data: dataPoints,
61
- borderColor: style.colorOrange,
62
- backgroundColor: style.colorOrange,
63
- },
64
- ],
65
- },
66
- };
67
-
68
- const chartWithLine = {
69
- data: {
70
- datasets: [
71
- {
72
- label: 'Default chart',
73
- data: dataPoints,
74
- borderColor: style.colorOrange,
75
- backgroundColor: style.colorOrange,
76
- showLine: true,
77
- },
78
- ],
79
- },
80
- };
81
-
82
- const multiLines = {
83
- data: {
84
- datasets: datasetMultiLines,
85
- },
86
- };
87
-
88
- const chartReverse = {
89
- data: {
90
- datasets: datasetMultiLines,
91
- },
92
- options: {
93
- scales: { y: { reverse: true } },
94
- },
95
- };
96
-
97
- const chartLegendRight = {
98
- data: {
99
- datasets: datasetMultiLines,
100
- },
101
- options: {
102
- plugins: {
103
- legend: {
104
- position: 'right',
105
- },
106
- title: {
107
- display: true,
108
- text: name || '',
109
- },
110
- },
111
- },
112
- };
113
-
114
- export default {
115
- title: 'ScatterChart',
116
- component: ScatterChart,
117
- args: {
118
- chart: chartDefault,
119
- },
120
- };
121
-
122
- const Template = (args) => {
123
- return (
124
- <ScatterChart
125
- // eslint-disable-next-line react/jsx-props-no-spreading
126
- {...args}
127
- />
128
- );
129
- };
130
- export const Default = Template.bind({});
131
-
132
- export const Linear = Template.bind({});
133
- Linear.args = { chart: chartWithLine };
134
-
135
- export const MultiLines = Template.bind({});
136
- MultiLines.args = { chart: multiLines };
137
-
138
- export const Reverse = Template.bind({});
139
- Reverse.args = { chart: chartReverse };
140
-
141
- export const LegendRight = Template.bind({});
142
- LegendRight.args = { chart: chartLegendRight };