@oliasoft-open-source/charts-library 7.0.1-beta-1 → 7.0.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/README.md +415 -0
- package/dist/index.d.ts +115 -21
- package/dist/index.js +115 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,3 +1,418 @@
|
|
|
1
1
|
# Chart Library
|
|
2
2
|
|
|
3
3
|
Reusable charts for use in React applications.
|
|
4
|
+
|
|
5
|
+
## Usage and defaults
|
|
6
|
+
|
|
7
|
+
The component JSDoc contains usage examples with sample data, labels and an explicit height.
|
|
8
|
+
Those example values are not defaults.
|
|
9
|
+
|
|
10
|
+
The sections below show the complete library-normalized configuration for `getDefaultProps({ chart: {} })`.
|
|
11
|
+
You do not need to pass these objects: omitted options receive these values automatically.
|
|
12
|
+
|
|
13
|
+
- `undefined` means the library leaves that value unspecified; it does not mean zero or false.
|
|
14
|
+
- Empty data is the default. Supply your own DS to draw a chart.
|
|
15
|
+
- These are library defaults, not a dump of Chart.js or plugin defaults. Final rendering can also depend on
|
|
16
|
+
data, container size, theme, plugin configuration and, for LineChart, persisted control state.
|
|
17
|
+
- Compatibility fields may appear in normalized output without affecting rendering; see their public type documentation.
|
|
18
|
+
- Default unit-selector callbacks are no-ops; consumers own unit selection and data conversion.
|
|
19
|
+
- The snapshots describe the initial empty configuration. Per-item defaults for supplied annotations and DS are
|
|
20
|
+
applied separately by their normalizers and renderers.
|
|
21
|
+
|
|
22
|
+
## LineChart
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
const noop = () => {
|
|
26
|
+
// Default unit selection does not change consumer state.
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const defaultChart = {
|
|
30
|
+
persistenceId: '',
|
|
31
|
+
controlsPortalId: '',
|
|
32
|
+
testId: undefined,
|
|
33
|
+
data: {
|
|
34
|
+
datasets: [],
|
|
35
|
+
},
|
|
36
|
+
options: {
|
|
37
|
+
title: '',
|
|
38
|
+
scales: {
|
|
39
|
+
x: {},
|
|
40
|
+
y: {},
|
|
41
|
+
},
|
|
42
|
+
axes: {
|
|
43
|
+
x: [
|
|
44
|
+
{
|
|
45
|
+
label: '',
|
|
46
|
+
position: 'bottom',
|
|
47
|
+
color: '',
|
|
48
|
+
unit: {
|
|
49
|
+
options: [],
|
|
50
|
+
selectedUnit: '',
|
|
51
|
+
setSelectedUnit: noop,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
y: [
|
|
56
|
+
{
|
|
57
|
+
label: '',
|
|
58
|
+
position: 'left',
|
|
59
|
+
color: '',
|
|
60
|
+
unit: {
|
|
61
|
+
options: [],
|
|
62
|
+
selectedUnit: '',
|
|
63
|
+
setSelectedUnit: noop,
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
additionalAxesOptions: {
|
|
69
|
+
chartScaleType: 'linear',
|
|
70
|
+
reverse: false,
|
|
71
|
+
beginAtZero: false,
|
|
72
|
+
stepSize: undefined,
|
|
73
|
+
suggestedMin: undefined,
|
|
74
|
+
suggestedMax: undefined,
|
|
75
|
+
range: undefined,
|
|
76
|
+
autoAxisPadding: false,
|
|
77
|
+
},
|
|
78
|
+
chartStyling: {
|
|
79
|
+
width: undefined,
|
|
80
|
+
height: undefined,
|
|
81
|
+
maintainAspectRatio: false,
|
|
82
|
+
staticChartHeight: false,
|
|
83
|
+
performanceMode: true,
|
|
84
|
+
squareAspectRatio: false,
|
|
85
|
+
layoutPadding: {
|
|
86
|
+
top: 0,
|
|
87
|
+
bottom: 20,
|
|
88
|
+
left: 0,
|
|
89
|
+
right: 0,
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
tooltip: {
|
|
93
|
+
tooltips: true,
|
|
94
|
+
showLabelsInTooltips: false,
|
|
95
|
+
hideSimulationName: false,
|
|
96
|
+
scientificNotation: true,
|
|
97
|
+
callbacks: undefined,
|
|
98
|
+
},
|
|
99
|
+
graph: {
|
|
100
|
+
lineTension: 0.01,
|
|
101
|
+
spanGaps: false,
|
|
102
|
+
showDataLabels: false,
|
|
103
|
+
showMinorGridlines: false,
|
|
104
|
+
},
|
|
105
|
+
annotations: {
|
|
106
|
+
labelAnnotation: {
|
|
107
|
+
showLabel: false,
|
|
108
|
+
text: '',
|
|
109
|
+
position: 'bottom-right',
|
|
110
|
+
fontSize: 12,
|
|
111
|
+
xOffset: 5,
|
|
112
|
+
yOffset: 5,
|
|
113
|
+
maxWidth: 300,
|
|
114
|
+
lineHeight: 12,
|
|
115
|
+
},
|
|
116
|
+
showAnnotations: false,
|
|
117
|
+
controlAnnotation: false,
|
|
118
|
+
enableDragAnnotation: false,
|
|
119
|
+
enableCalloutAnnotation: false,
|
|
120
|
+
lineMarkersAnnotation: {
|
|
121
|
+
enabled: false,
|
|
122
|
+
itemGapPx: 4,
|
|
123
|
+
edgePaddingPx: 8,
|
|
124
|
+
horizontalLineLengthPx: undefined,
|
|
125
|
+
lineDirection: undefined,
|
|
126
|
+
labelCollisionPx: 4,
|
|
127
|
+
labelCollisionClusterXPx: 36,
|
|
128
|
+
enableLabelCollisionResolver: true,
|
|
129
|
+
stickToEdge: true,
|
|
130
|
+
stickToGroup: false,
|
|
131
|
+
stickSide: 'right',
|
|
132
|
+
reverse: false,
|
|
133
|
+
xValue: undefined,
|
|
134
|
+
yValue: undefined,
|
|
135
|
+
yStartValue: undefined,
|
|
136
|
+
yEndValue: undefined,
|
|
137
|
+
xStartValue: undefined,
|
|
138
|
+
xEndValue: undefined,
|
|
139
|
+
lengthPx: undefined,
|
|
140
|
+
color: 'rgba(20,20,20,0.9)',
|
|
141
|
+
opacity: 1,
|
|
142
|
+
lineWidth: 1,
|
|
143
|
+
lineDash: [],
|
|
144
|
+
startTick: undefined,
|
|
145
|
+
endTick: undefined,
|
|
146
|
+
items: [],
|
|
147
|
+
},
|
|
148
|
+
annotationsData: [],
|
|
149
|
+
},
|
|
150
|
+
legend: {
|
|
151
|
+
display: true,
|
|
152
|
+
position: 'bottom-left',
|
|
153
|
+
align: 'center',
|
|
154
|
+
customLegend: {
|
|
155
|
+
customLegendPlugin: null,
|
|
156
|
+
customLegendContainerID: '',
|
|
157
|
+
},
|
|
158
|
+
usePointStyle: true,
|
|
159
|
+
},
|
|
160
|
+
chartOptions: {
|
|
161
|
+
showPoints: true,
|
|
162
|
+
showLine: true,
|
|
163
|
+
enableZoom: true,
|
|
164
|
+
enablePan: false,
|
|
165
|
+
enableDragAnnotation: false,
|
|
166
|
+
closeOnOutsideClick: false,
|
|
167
|
+
},
|
|
168
|
+
interactions: {
|
|
169
|
+
onLegendClick: undefined,
|
|
170
|
+
onHover: undefined,
|
|
171
|
+
onUnhover: undefined,
|
|
172
|
+
onAnimationComplete: undefined,
|
|
173
|
+
},
|
|
174
|
+
dragData: {
|
|
175
|
+
enableDragData: false,
|
|
176
|
+
showTooltip: true,
|
|
177
|
+
roundPoints: true,
|
|
178
|
+
dragX: true,
|
|
179
|
+
dragY: true,
|
|
180
|
+
onDragStart: undefined,
|
|
181
|
+
onDrag: undefined,
|
|
182
|
+
onDragEnd: undefined,
|
|
183
|
+
},
|
|
184
|
+
depthType: {},
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## BarChart
|
|
190
|
+
|
|
191
|
+
```ts
|
|
192
|
+
const defaultChart = {
|
|
193
|
+
testId: '',
|
|
194
|
+
controlsPortalId: '',
|
|
195
|
+
data: {
|
|
196
|
+
labels: [],
|
|
197
|
+
datasets: [],
|
|
198
|
+
},
|
|
199
|
+
options: {
|
|
200
|
+
title: '',
|
|
201
|
+
direction: 'vertical',
|
|
202
|
+
axes: {
|
|
203
|
+
x: [{}],
|
|
204
|
+
y: [{}],
|
|
205
|
+
},
|
|
206
|
+
additionalAxesOptions: {
|
|
207
|
+
chartScaleType: 'linear',
|
|
208
|
+
reverse: false,
|
|
209
|
+
stacked: false,
|
|
210
|
+
beginAtZero: true,
|
|
211
|
+
stepSize: undefined,
|
|
212
|
+
suggestedMin: undefined,
|
|
213
|
+
suggestedMax: undefined,
|
|
214
|
+
min: undefined,
|
|
215
|
+
max: undefined,
|
|
216
|
+
stackedX: undefined,
|
|
217
|
+
stackedY: undefined,
|
|
218
|
+
},
|
|
219
|
+
chartStyling: {
|
|
220
|
+
width: undefined,
|
|
221
|
+
height: undefined,
|
|
222
|
+
maintainAspectRatio: false,
|
|
223
|
+
staticChartHeight: false,
|
|
224
|
+
performanceMode: true,
|
|
225
|
+
},
|
|
226
|
+
tooltip: {
|
|
227
|
+
tooltips: true,
|
|
228
|
+
showLabelsInTooltips: false,
|
|
229
|
+
scientificNotation: true,
|
|
230
|
+
},
|
|
231
|
+
graph: {
|
|
232
|
+
showDataLabels: false,
|
|
233
|
+
showMinorGridlines: false,
|
|
234
|
+
},
|
|
235
|
+
scales: {},
|
|
236
|
+
annotations: {
|
|
237
|
+
showAnnotations: true,
|
|
238
|
+
controlAnnotation: false,
|
|
239
|
+
annotationsData: [],
|
|
240
|
+
},
|
|
241
|
+
legend: {
|
|
242
|
+
display: true,
|
|
243
|
+
position: 'top-left',
|
|
244
|
+
align: 'center',
|
|
245
|
+
customLegend: {
|
|
246
|
+
customLegendPlugin: null,
|
|
247
|
+
customLegendContainerID: '',
|
|
248
|
+
},
|
|
249
|
+
},
|
|
250
|
+
chartOptions: {
|
|
251
|
+
enableZoom: false,
|
|
252
|
+
enablePan: false,
|
|
253
|
+
},
|
|
254
|
+
interactions: {
|
|
255
|
+
onLegendClick: undefined,
|
|
256
|
+
onHover: undefined,
|
|
257
|
+
onUnhover: undefined,
|
|
258
|
+
},
|
|
259
|
+
dragData: {
|
|
260
|
+
enableDragData: false,
|
|
261
|
+
showTooltip: true,
|
|
262
|
+
roundPoints: true,
|
|
263
|
+
dragX: true,
|
|
264
|
+
dragY: true,
|
|
265
|
+
onDragStart: undefined,
|
|
266
|
+
onDrag: undefined,
|
|
267
|
+
onDragEnd: undefined,
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## PieChart
|
|
274
|
+
|
|
275
|
+
```ts
|
|
276
|
+
const defaultChart = {
|
|
277
|
+
testId: null,
|
|
278
|
+
data: {
|
|
279
|
+
labels: [],
|
|
280
|
+
datasets: [],
|
|
281
|
+
},
|
|
282
|
+
options: {
|
|
283
|
+
title: '',
|
|
284
|
+
chartStyling: {
|
|
285
|
+
width: undefined,
|
|
286
|
+
height: undefined,
|
|
287
|
+
maintainAspectRatio: false,
|
|
288
|
+
staticChartHeight: false,
|
|
289
|
+
performanceMode: true,
|
|
290
|
+
},
|
|
291
|
+
tooltip: {
|
|
292
|
+
tooltips: true,
|
|
293
|
+
showLabelsInTooltips: false,
|
|
294
|
+
scientificNotation: true,
|
|
295
|
+
},
|
|
296
|
+
graph: {
|
|
297
|
+
showDataLabels: false,
|
|
298
|
+
stacked: false,
|
|
299
|
+
cutout: 0,
|
|
300
|
+
},
|
|
301
|
+
legend: {
|
|
302
|
+
display: true,
|
|
303
|
+
useDataset: false,
|
|
304
|
+
position: 'bottom',
|
|
305
|
+
align: 'center',
|
|
306
|
+
},
|
|
307
|
+
chartOptions: {
|
|
308
|
+
enableZoom: false,
|
|
309
|
+
enablePan: false,
|
|
310
|
+
},
|
|
311
|
+
interactions: {
|
|
312
|
+
onLegendClick: undefined,
|
|
313
|
+
onHover: undefined,
|
|
314
|
+
onUnhover: undefined,
|
|
315
|
+
},
|
|
316
|
+
},
|
|
317
|
+
};
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## ScatterChart
|
|
321
|
+
|
|
322
|
+
```ts
|
|
323
|
+
import { GradientDirection } from '@oliasoft-open-source/charts-library';
|
|
324
|
+
|
|
325
|
+
const defaultChart = {
|
|
326
|
+
testId: null,
|
|
327
|
+
data: {
|
|
328
|
+
labels: [],
|
|
329
|
+
datasets: [],
|
|
330
|
+
},
|
|
331
|
+
options: {
|
|
332
|
+
title: '',
|
|
333
|
+
axes: {
|
|
334
|
+
x: [{}],
|
|
335
|
+
y: [{}],
|
|
336
|
+
},
|
|
337
|
+
additionalAxesOptions: {
|
|
338
|
+
chartScaleType: 'linear',
|
|
339
|
+
reverse: false,
|
|
340
|
+
stacked: false,
|
|
341
|
+
beginAtZero: true,
|
|
342
|
+
stepSize: undefined,
|
|
343
|
+
suggestedMin: undefined,
|
|
344
|
+
suggestedMax: undefined,
|
|
345
|
+
min: undefined,
|
|
346
|
+
max: undefined,
|
|
347
|
+
},
|
|
348
|
+
direction: 'vertical',
|
|
349
|
+
chartStyling: {
|
|
350
|
+
width: 'auto',
|
|
351
|
+
height: 'auto',
|
|
352
|
+
maintainAspectRatio: false,
|
|
353
|
+
staticChartHeight: false,
|
|
354
|
+
performanceMode: true,
|
|
355
|
+
gradient: {
|
|
356
|
+
display: false,
|
|
357
|
+
gradientColors: [
|
|
358
|
+
{
|
|
359
|
+
offset: 0,
|
|
360
|
+
color: 'rgba(144,238,144,0.8)',
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
offset: 0.6,
|
|
364
|
+
color: 'rgba(255,255,224,0.8)',
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
offset: 0.8,
|
|
368
|
+
color: 'rgba(255,255,224,0.8)',
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
offset: 0.92,
|
|
372
|
+
color: 'rgba(255,182,193,0.5)',
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
offset: 0.99,
|
|
376
|
+
color: 'rgba(255,182,193,0.8)',
|
|
377
|
+
},
|
|
378
|
+
],
|
|
379
|
+
direction: GradientDirection.BottomLeftToTopRight,
|
|
380
|
+
},
|
|
381
|
+
},
|
|
382
|
+
tooltip: {
|
|
383
|
+
enabled: true,
|
|
384
|
+
tooltips: true,
|
|
385
|
+
showLabelsInTooltips: false,
|
|
386
|
+
backgroundColor: '#333',
|
|
387
|
+
displayColors: false,
|
|
388
|
+
scientificNotation: true,
|
|
389
|
+
},
|
|
390
|
+
graph: {
|
|
391
|
+
showMinorGridlines: false,
|
|
392
|
+
showDataLabels: false,
|
|
393
|
+
},
|
|
394
|
+
scales: {},
|
|
395
|
+
legend: {
|
|
396
|
+
display: true,
|
|
397
|
+
useDataset: false,
|
|
398
|
+
position: 'bottom-left',
|
|
399
|
+
align: 'center',
|
|
400
|
+
},
|
|
401
|
+
annotations: {
|
|
402
|
+
showAnnotations: true,
|
|
403
|
+
controlAnnotation: false,
|
|
404
|
+
annotationsData: [],
|
|
405
|
+
},
|
|
406
|
+
chartOptions: {
|
|
407
|
+
enableZoom: false,
|
|
408
|
+
enablePan: false,
|
|
409
|
+
},
|
|
410
|
+
interactions: {
|
|
411
|
+
onLegendClick: undefined,
|
|
412
|
+
onHover: undefined,
|
|
413
|
+
onUnhover: undefined,
|
|
414
|
+
onAnimationComplete: undefined,
|
|
415
|
+
},
|
|
416
|
+
},
|
|
417
|
+
};
|
|
418
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -33,15 +33,41 @@ export declare enum AxisType {
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
|
-
* Renders
|
|
36
|
+
* Renders vertical or horizontal bars with optional stacking, annotations and a legend.
|
|
37
37
|
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
38
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
39
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* Defaults: vertical bars, a top-left legend, zero included in automatic scale bounds, and annotations enabled.
|
|
43
|
+
* Zoom, pan, stacking and data labels are disabled. No fixed width or height is assigned.
|
|
44
|
+
* Performance mode is enabled by default, disabling animations.
|
|
45
|
+
* The linked reference lists the complete normalized default configuration.
|
|
46
|
+
*
|
|
47
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#barchart
|
|
48
|
+
*
|
|
49
|
+
* @param props - Chart data and options.
|
|
50
|
+
* @returns The chart canvas and its associated UI.
|
|
40
51
|
* @example
|
|
41
52
|
* ```tsx
|
|
42
53
|
* <BarChart chart={{
|
|
43
|
-
* data: {
|
|
44
|
-
*
|
|
54
|
+
* data: {
|
|
55
|
+
* labels: ['A', 'B', 'C'],
|
|
56
|
+
* datasets: [{
|
|
57
|
+
* label: 'DS A',
|
|
58
|
+
* data: [{ x: 'A', y: 10 }, { x: 'B', y: 20 }, { x: 'C', y: 15 }],
|
|
59
|
+
* }],
|
|
60
|
+
* },
|
|
61
|
+
* options: {
|
|
62
|
+
* direction: 'vertical',
|
|
63
|
+
* axes: {
|
|
64
|
+
* x: [{ label: 'Category', position: 'bottom' }],
|
|
65
|
+
* y: [{ label: 'Value', position: 'left' }],
|
|
66
|
+
* },
|
|
67
|
+
* chartStyling: { height: 320 },
|
|
68
|
+
* legend: { display: true, position: 'top-left' },
|
|
69
|
+
* graph: { showDataLabels: false },
|
|
70
|
+
* },
|
|
45
71
|
* }} />
|
|
46
72
|
* ```
|
|
47
73
|
*/
|
|
@@ -1774,19 +1800,40 @@ export declare enum Key {
|
|
|
1774
1800
|
}
|
|
1775
1801
|
|
|
1776
1802
|
/**
|
|
1777
|
-
* Renders an interactive
|
|
1803
|
+
* Renders an interactive line chart with multiple axes, annotations, a legend and chart controls.
|
|
1778
1804
|
*
|
|
1779
1805
|
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
1780
|
-
* The
|
|
1781
|
-
* The other coordinate is displayed beside the DS name. Custom callbacks override those defaults.
|
|
1806
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
1782
1807
|
*
|
|
1783
|
-
* @
|
|
1784
|
-
*
|
|
1808
|
+
* @remarks
|
|
1809
|
+
* Defaults: bottom X axis, left Y axis, visible lines and points, bottom-left legend, and zoom enabled.
|
|
1810
|
+
* Pan, data labels, minor grid lines and annotations are disabled. No fixed width or height is assigned.
|
|
1811
|
+
* Performance mode is enabled by default, disabling animations.
|
|
1812
|
+
* The linked reference lists the complete normalized default configuration.
|
|
1813
|
+
*
|
|
1814
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#linechart
|
|
1815
|
+
*
|
|
1816
|
+
* @param props - Chart data and options, plus optional header, subheader and table content.
|
|
1817
|
+
* @returns The chart canvas and its associated UI.
|
|
1785
1818
|
* @example
|
|
1786
1819
|
* ```tsx
|
|
1787
1820
|
* <LineChart chart={{
|
|
1788
|
-
* data: {
|
|
1789
|
-
*
|
|
1821
|
+
* data: {
|
|
1822
|
+
* datasets: [{
|
|
1823
|
+
* label: 'DS A',
|
|
1824
|
+
* data: [{ x: 0, y: 10 }, { x: 1, y: 20 }, { x: 2, y: 15 }],
|
|
1825
|
+
* }],
|
|
1826
|
+
* },
|
|
1827
|
+
* options: {
|
|
1828
|
+
* axes: {
|
|
1829
|
+
* x: [{ label: 'X', position: 'bottom' }],
|
|
1830
|
+
* y: [{ label: 'Y', position: 'left' }],
|
|
1831
|
+
* },
|
|
1832
|
+
* chartStyling: { height: 320 },
|
|
1833
|
+
* legend: { display: true, position: 'bottom-left' },
|
|
1834
|
+
* graph: { lineTension: 0.01, showDataLabels: false },
|
|
1835
|
+
* chartOptions: { showLine: true, showPoints: true },
|
|
1836
|
+
* },
|
|
1790
1837
|
* }} />
|
|
1791
1838
|
* ```
|
|
1792
1839
|
*/
|
|
@@ -1829,15 +1876,37 @@ export declare enum PanZoomMode {
|
|
|
1829
1876
|
}
|
|
1830
1877
|
|
|
1831
1878
|
/**
|
|
1832
|
-
* Renders
|
|
1879
|
+
* Renders pie segments with optional data labels, a legend and an inner cutout.
|
|
1880
|
+
*
|
|
1881
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
1882
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
1883
|
+
*
|
|
1884
|
+
* @remarks
|
|
1885
|
+
* Defaults: a full pie (cutout 0), a bottom legend, and no fixed width or height.
|
|
1886
|
+
* Data labels, stacking, zoom and pan are disabled. Pie charts do not have Cartesian axes.
|
|
1887
|
+
* Performance mode is enabled by default, disabling animations.
|
|
1888
|
+
* The linked reference lists the complete normalized default configuration.
|
|
1833
1889
|
*
|
|
1834
|
-
* @
|
|
1835
|
-
*
|
|
1890
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#piechart
|
|
1891
|
+
*
|
|
1892
|
+
* @param props - Chart data and options.
|
|
1893
|
+
* @returns The chart canvas and its associated UI.
|
|
1836
1894
|
* @example
|
|
1837
1895
|
* ```tsx
|
|
1838
1896
|
* <PieChart chart={{
|
|
1839
|
-
* data: {
|
|
1840
|
-
*
|
|
1897
|
+
* data: {
|
|
1898
|
+
* labels: ['A', 'B', 'C'],
|
|
1899
|
+
* datasets: [{
|
|
1900
|
+
* label: 'DS A',
|
|
1901
|
+
* data: [10, 20, 15],
|
|
1902
|
+
* backgroundColor: ['#3366cc', '#dc3912', '#ff9900'],
|
|
1903
|
+
* }],
|
|
1904
|
+
* },
|
|
1905
|
+
* options: {
|
|
1906
|
+
* chartStyling: { height: 320 },
|
|
1907
|
+
* legend: { display: true, position: 'bottom' },
|
|
1908
|
+
* graph: { cutout: 0, showDataLabels: false },
|
|
1909
|
+
* },
|
|
1841
1910
|
* }} />
|
|
1842
1911
|
* ```
|
|
1843
1912
|
*/
|
|
@@ -1878,14 +1947,39 @@ export declare enum ScaleType {
|
|
|
1878
1947
|
}
|
|
1879
1948
|
|
|
1880
1949
|
/**
|
|
1881
|
-
* Renders Cartesian
|
|
1950
|
+
* Renders Cartesian points with a legend, optional annotations and a background gradient.
|
|
1951
|
+
*
|
|
1952
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
1953
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
1954
|
+
*
|
|
1955
|
+
* @remarks
|
|
1956
|
+
* Defaults: automatic width and height, a bottom-left legend, zero included in automatic scale bounds,
|
|
1957
|
+
* and annotations enabled. Zoom, pan, data labels, minor grid lines and the background gradient are disabled.
|
|
1958
|
+
* Performance mode is enabled by default, disabling animations.
|
|
1959
|
+
* The linked reference lists the complete normalized default configuration.
|
|
1960
|
+
*
|
|
1961
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#scatterchart
|
|
1882
1962
|
*
|
|
1883
|
-
* @param props - Chart data and
|
|
1884
|
-
* @returns The chart canvas and
|
|
1963
|
+
* @param props - Chart data and options.
|
|
1964
|
+
* @returns The chart canvas and its associated UI.
|
|
1885
1965
|
* @example
|
|
1886
1966
|
* ```tsx
|
|
1887
1967
|
* <ScatterChart chart={{
|
|
1888
|
-
* data: {
|
|
1968
|
+
* data: {
|
|
1969
|
+
* datasets: [{
|
|
1970
|
+
* label: 'DS A',
|
|
1971
|
+
* data: [{ x: 1, y: 10 }, { x: 2, y: 20 }, { x: 3, y: 15 }],
|
|
1972
|
+
* }],
|
|
1973
|
+
* },
|
|
1974
|
+
* options: {
|
|
1975
|
+
* axes: {
|
|
1976
|
+
* x: [{ label: 'X', position: 'bottom' }],
|
|
1977
|
+
* y: [{ label: 'Y', position: 'left' }],
|
|
1978
|
+
* },
|
|
1979
|
+
* chartStyling: { height: 320 },
|
|
1980
|
+
* legend: { display: true, position: 'bottom-left' },
|
|
1981
|
+
* graph: { showDataLabels: false, showMinorGridlines: false },
|
|
1982
|
+
* },
|
|
1889
1983
|
* }} />
|
|
1890
1984
|
* ```
|
|
1891
1985
|
*/
|
package/dist/index.js
CHANGED
|
@@ -24709,19 +24709,40 @@ var LineChart = (props) => {
|
|
|
24709
24709
|
}, getChartKey(state, languageKey));
|
|
24710
24710
|
};
|
|
24711
24711
|
/**
|
|
24712
|
-
* Renders an interactive
|
|
24712
|
+
* Renders an interactive line chart with multiple axes, annotations, a legend and chart controls.
|
|
24713
24713
|
*
|
|
24714
24714
|
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
24715
|
-
* The
|
|
24716
|
-
* The other coordinate is displayed beside the DS name. Custom callbacks override those defaults.
|
|
24715
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
24717
24716
|
*
|
|
24718
|
-
* @
|
|
24719
|
-
*
|
|
24717
|
+
* @remarks
|
|
24718
|
+
* Defaults: bottom X axis, left Y axis, visible lines and points, bottom-left legend, and zoom enabled.
|
|
24719
|
+
* Pan, data labels, minor grid lines and annotations are disabled. No fixed width or height is assigned.
|
|
24720
|
+
* Performance mode is enabled by default, disabling animations.
|
|
24721
|
+
* The linked reference lists the complete normalized default configuration.
|
|
24722
|
+
*
|
|
24723
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#linechart
|
|
24724
|
+
*
|
|
24725
|
+
* @param props - Chart data and options, plus optional header, subheader and table content.
|
|
24726
|
+
* @returns The chart canvas and its associated UI.
|
|
24720
24727
|
* @example
|
|
24721
24728
|
* ```tsx
|
|
24722
24729
|
* <LineChart chart={{
|
|
24723
|
-
* data: {
|
|
24724
|
-
*
|
|
24730
|
+
* data: {
|
|
24731
|
+
* datasets: [{
|
|
24732
|
+
* label: 'DS A',
|
|
24733
|
+
* data: [{ x: 0, y: 10 }, { x: 1, y: 20 }, { x: 2, y: 15 }],
|
|
24734
|
+
* }],
|
|
24735
|
+
* },
|
|
24736
|
+
* options: {
|
|
24737
|
+
* axes: {
|
|
24738
|
+
* x: [{ label: 'X', position: 'bottom' }],
|
|
24739
|
+
* y: [{ label: 'Y', position: 'left' }],
|
|
24740
|
+
* },
|
|
24741
|
+
* chartStyling: { height: 320 },
|
|
24742
|
+
* legend: { display: true, position: 'bottom-left' },
|
|
24743
|
+
* graph: { lineTension: 0.01, showDataLabels: false },
|
|
24744
|
+
* chartOptions: { showLine: true, showPoints: true },
|
|
24745
|
+
* },
|
|
24725
24746
|
* }} />
|
|
24726
24747
|
* ```
|
|
24727
24748
|
*/
|
|
@@ -25018,15 +25039,37 @@ var PieChart = (props) => {
|
|
|
25018
25039
|
});
|
|
25019
25040
|
};
|
|
25020
25041
|
/**
|
|
25021
|
-
* Renders
|
|
25042
|
+
* Renders pie segments with optional data labels, a legend and an inner cutout.
|
|
25043
|
+
*
|
|
25044
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
25045
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
25022
25046
|
*
|
|
25023
|
-
* @
|
|
25024
|
-
*
|
|
25047
|
+
* @remarks
|
|
25048
|
+
* Defaults: a full pie (cutout 0), a bottom legend, and no fixed width or height.
|
|
25049
|
+
* Data labels, stacking, zoom and pan are disabled. Pie charts do not have Cartesian axes.
|
|
25050
|
+
* Performance mode is enabled by default, disabling animations.
|
|
25051
|
+
* The linked reference lists the complete normalized default configuration.
|
|
25052
|
+
*
|
|
25053
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#piechart
|
|
25054
|
+
*
|
|
25055
|
+
* @param props - Chart data and options.
|
|
25056
|
+
* @returns The chart canvas and its associated UI.
|
|
25025
25057
|
* @example
|
|
25026
25058
|
* ```tsx
|
|
25027
25059
|
* <PieChart chart={{
|
|
25028
|
-
* data: {
|
|
25029
|
-
*
|
|
25060
|
+
* data: {
|
|
25061
|
+
* labels: ['A', 'B', 'C'],
|
|
25062
|
+
* datasets: [{
|
|
25063
|
+
* label: 'DS A',
|
|
25064
|
+
* data: [10, 20, 15],
|
|
25065
|
+
* backgroundColor: ['#3366cc', '#dc3912', '#ff9900'],
|
|
25066
|
+
* }],
|
|
25067
|
+
* },
|
|
25068
|
+
* options: {
|
|
25069
|
+
* chartStyling: { height: 320 },
|
|
25070
|
+
* legend: { display: true, position: 'bottom' },
|
|
25071
|
+
* graph: { cutout: 0, showDataLabels: false },
|
|
25072
|
+
* },
|
|
25030
25073
|
* }} />
|
|
25031
25074
|
* ```
|
|
25032
25075
|
*/
|
|
@@ -39388,15 +39431,41 @@ var BarChart = (props) => {
|
|
|
39388
39431
|
}, languageKey);
|
|
39389
39432
|
};
|
|
39390
39433
|
/**
|
|
39391
|
-
* Renders
|
|
39434
|
+
* Renders vertical or horizontal bars with optional stacking, annotations and a legend.
|
|
39435
|
+
*
|
|
39436
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
39437
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
39438
|
+
*
|
|
39439
|
+
* @remarks
|
|
39440
|
+
* Defaults: vertical bars, a top-left legend, zero included in automatic scale bounds, and annotations enabled.
|
|
39441
|
+
* Zoom, pan, stacking and data labels are disabled. No fixed width or height is assigned.
|
|
39442
|
+
* Performance mode is enabled by default, disabling animations.
|
|
39443
|
+
* The linked reference lists the complete normalized default configuration.
|
|
39392
39444
|
*
|
|
39393
|
-
* @
|
|
39394
|
-
*
|
|
39445
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#barchart
|
|
39446
|
+
*
|
|
39447
|
+
* @param props - Chart data and options.
|
|
39448
|
+
* @returns The chart canvas and its associated UI.
|
|
39395
39449
|
* @example
|
|
39396
39450
|
* ```tsx
|
|
39397
39451
|
* <BarChart chart={{
|
|
39398
|
-
* data: {
|
|
39399
|
-
*
|
|
39452
|
+
* data: {
|
|
39453
|
+
* labels: ['A', 'B', 'C'],
|
|
39454
|
+
* datasets: [{
|
|
39455
|
+
* label: 'DS A',
|
|
39456
|
+
* data: [{ x: 'A', y: 10 }, { x: 'B', y: 20 }, { x: 'C', y: 15 }],
|
|
39457
|
+
* }],
|
|
39458
|
+
* },
|
|
39459
|
+
* options: {
|
|
39460
|
+
* direction: 'vertical',
|
|
39461
|
+
* axes: {
|
|
39462
|
+
* x: [{ label: 'Category', position: 'bottom' }],
|
|
39463
|
+
* y: [{ label: 'Value', position: 'left' }],
|
|
39464
|
+
* },
|
|
39465
|
+
* chartStyling: { height: 320 },
|
|
39466
|
+
* legend: { display: true, position: 'top-left' },
|
|
39467
|
+
* graph: { showDataLabels: false },
|
|
39468
|
+
* },
|
|
39400
39469
|
* }} />
|
|
39401
39470
|
* ```
|
|
39402
39471
|
*/
|
|
@@ -39799,14 +39868,39 @@ var ScatterChart = (props) => {
|
|
|
39799
39868
|
});
|
|
39800
39869
|
};
|
|
39801
39870
|
/**
|
|
39802
|
-
* Renders Cartesian
|
|
39871
|
+
* Renders Cartesian points with a legend, optional annotations and a background gradient.
|
|
39872
|
+
*
|
|
39873
|
+
* Pass partial configuration through `chart`; omitted settings receive component defaults.
|
|
39874
|
+
* The example uses sample data, labels and a height of 320 pixels; these are not default values.
|
|
39875
|
+
*
|
|
39876
|
+
* @remarks
|
|
39877
|
+
* Defaults: automatic width and height, a bottom-left legend, zero included in automatic scale bounds,
|
|
39878
|
+
* and annotations enabled. Zoom, pan, data labels, minor grid lines and the background gradient are disabled.
|
|
39879
|
+
* Performance mode is enabled by default, disabling animations.
|
|
39880
|
+
* The linked reference lists the complete normalized default configuration.
|
|
39881
|
+
*
|
|
39882
|
+
* @see https://gitlab.com/oliasoft-open-source/charts-library/-/blob/master/README.md#scatterchart
|
|
39803
39883
|
*
|
|
39804
|
-
* @param props - Chart data and
|
|
39805
|
-
* @returns The chart canvas and
|
|
39884
|
+
* @param props - Chart data and options.
|
|
39885
|
+
* @returns The chart canvas and its associated UI.
|
|
39806
39886
|
* @example
|
|
39807
39887
|
* ```tsx
|
|
39808
39888
|
* <ScatterChart chart={{
|
|
39809
|
-
* data: {
|
|
39889
|
+
* data: {
|
|
39890
|
+
* datasets: [{
|
|
39891
|
+
* label: 'DS A',
|
|
39892
|
+
* data: [{ x: 1, y: 10 }, { x: 2, y: 20 }, { x: 3, y: 15 }],
|
|
39893
|
+
* }],
|
|
39894
|
+
* },
|
|
39895
|
+
* options: {
|
|
39896
|
+
* axes: {
|
|
39897
|
+
* x: [{ label: 'X', position: 'bottom' }],
|
|
39898
|
+
* y: [{ label: 'Y', position: 'left' }],
|
|
39899
|
+
* },
|
|
39900
|
+
* chartStyling: { height: 320 },
|
|
39901
|
+
* legend: { display: true, position: 'bottom-left' },
|
|
39902
|
+
* graph: { showDataLabels: false, showMinorGridlines: false },
|
|
39903
|
+
* },
|
|
39810
39904
|
* }} />
|
|
39811
39905
|
* ```
|
|
39812
39906
|
*/
|
package/package.json
CHANGED