@hpcc-js/chart 2.75.0 → 2.78.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.
- package/README.md +64 -22
- package/dist/index.es6.js +600 -603
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +603 -606
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +10 -26
- package/src/Area.md +176 -0
- package/src/Bar.md +91 -0
- package/src/Bubble.md +69 -0
- package/src/Bullet.md +104 -0
- package/src/Bullet.ts +2 -2
- package/src/Column.md +90 -0
- package/src/Contour.md +88 -0
- package/src/Gantt.md +119 -0
- package/src/Gauge.md +148 -0
- package/src/HalfPie.md +62 -0
- package/src/Heat.md +1 -0
- package/src/HexBin.md +88 -0
- package/src/HexBin.ts +2 -2
- package/src/Line.md +170 -0
- package/src/Pie.md +88 -0
- package/src/Pie.ts +23 -0
- package/src/QuarterPie.md +61 -0
- package/src/QuartileCandlestick.md +129 -0
- package/src/Radar.md +104 -0
- package/src/RadialBar.md +91 -0
- package/src/Scatter.md +163 -0
- package/src/StatChart.md +117 -0
- package/src/Step.md +163 -0
- package/src/Summary.md +219 -0
- package/src/SummaryC.md +154 -0
- package/src/WordCloud.md +144 -0
- package/src/XYAxis.md +149 -0
- package/src/XYAxis.ts +1 -2
- package/src/__package__.ts +2 -2
- package/src/test.ts +31 -0
- package/types/Pie.d.ts +3 -0
- package/types/Pie.d.ts.map +1 -1
- package/types/XYAxis.d.ts.map +1 -1
- package/types/__package__.d.ts +2 -2
- package/types/test.d.ts +6 -0
- package/types/test.d.ts.map +1 -0
- package/types-3.4/Pie.d.ts +3 -0
- package/types-3.4/__package__.d.ts +2 -2
- package/types-3.4/test.d.ts +6 -0
package/src/Pie.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Pie
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
A circular statistical graphic, which is divided into slices to illustrate numerical proportion. In a pie chart, the arc length of each slice, is proportional to the quantity it represents. (See also: [HalfPie](./HalfPie.md) and [QuarterPie](./QuarterPie.md) )
|
|
8
|
+
|
|
9
|
+
<ClientOnly>
|
|
10
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
11
|
+
<div id="placeholder" style="height:400px">
|
|
12
|
+
</div>
|
|
13
|
+
<script type="module">
|
|
14
|
+
import { Pie } from "@hpcc-js/chart";
|
|
15
|
+
|
|
16
|
+
new Pie()
|
|
17
|
+
.target("placeholder")
|
|
18
|
+
.columns(["Category", "Value"])
|
|
19
|
+
.data([
|
|
20
|
+
["A", 34],
|
|
21
|
+
["B", 55],
|
|
22
|
+
["C", 89],
|
|
23
|
+
["D", 144]
|
|
24
|
+
])
|
|
25
|
+
.render()
|
|
26
|
+
;
|
|
27
|
+
</script>
|
|
28
|
+
</hpcc-vitepress>
|
|
29
|
+
</ClientOnly>
|
|
30
|
+
|
|
31
|
+
In the below example the 'showSeriesValue' is used to display the value next to each slice label.
|
|
32
|
+
|
|
33
|
+
<ClientOnly>
|
|
34
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
35
|
+
<div id="placeholder" style="height:400px">
|
|
36
|
+
</div>
|
|
37
|
+
<script type="module">
|
|
38
|
+
import { Pie } from "@hpcc-js/chart";
|
|
39
|
+
|
|
40
|
+
new Pie()
|
|
41
|
+
.target("placeholder")
|
|
42
|
+
.columns(["Category", "Value"])
|
|
43
|
+
.data([
|
|
44
|
+
["A", 34],
|
|
45
|
+
["B", 55],
|
|
46
|
+
["C", 89],
|
|
47
|
+
["D", 144]
|
|
48
|
+
])
|
|
49
|
+
.showSeriesValue(true)
|
|
50
|
+
.render()
|
|
51
|
+
;
|
|
52
|
+
</script>
|
|
53
|
+
</hpcc-vitepress>
|
|
54
|
+
</ClientOnly>
|
|
55
|
+
|
|
56
|
+
In the below example the 'innerRadius' is used to transform the pie chart into a donut chart.
|
|
57
|
+
'showSeriesPercentage' displays the percentage next to each slice label.
|
|
58
|
+
|
|
59
|
+
<ClientOnly>
|
|
60
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
61
|
+
<div id="placeholder" style="height:400px">
|
|
62
|
+
</div>
|
|
63
|
+
<script type="module">
|
|
64
|
+
import { Pie } from "@hpcc-js/chart";
|
|
65
|
+
|
|
66
|
+
new Pie()
|
|
67
|
+
.target("placeholder")
|
|
68
|
+
.columns(["Category", "Value"])
|
|
69
|
+
.data([
|
|
70
|
+
["A", 34],
|
|
71
|
+
["B", 55],
|
|
72
|
+
["C", 89],
|
|
73
|
+
["D", 144]
|
|
74
|
+
])
|
|
75
|
+
.innerRadius(62)
|
|
76
|
+
.showSeriesPercentage(true)
|
|
77
|
+
.render()
|
|
78
|
+
;
|
|
79
|
+
</script>
|
|
80
|
+
</hpcc-vitepress>
|
|
81
|
+
</ClientOnly>
|
|
82
|
+
|
|
83
|
+
## API
|
|
84
|
+
|
|
85
|
+
## Published Properties
|
|
86
|
+
|
|
87
|
+
```@hpcc-js/chart:Pie
|
|
88
|
+
```
|
package/src/Pie.ts
CHANGED
|
@@ -112,6 +112,29 @@ export class Pie extends SVGWidget {
|
|
|
112
112
|
}
|
|
113
113
|
return label;
|
|
114
114
|
}
|
|
115
|
+
|
|
116
|
+
selection(): any[]; // any[] === single row
|
|
117
|
+
selection(_: any[]): this;
|
|
118
|
+
selection(_?: any[]): any[] | this {
|
|
119
|
+
if (!arguments.length) {
|
|
120
|
+
try {
|
|
121
|
+
return this._selection.selection2()[0]?.data;
|
|
122
|
+
} catch (e) {
|
|
123
|
+
return undefined;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// Stringify to enable a deep equal
|
|
127
|
+
const strRow = JSON.stringify(_);
|
|
128
|
+
this._selection.selection2(d => strRow === JSON.stringify(d.data));
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
selectByLabel(_: string) {
|
|
132
|
+
const row = this.data().filter(row => row[0] === _)[0];
|
|
133
|
+
if (row) {
|
|
134
|
+
this.selection(row);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
115
138
|
_slices;
|
|
116
139
|
_labels;
|
|
117
140
|
enter(_domNode, element) {
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# QuarterPie
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
[Pie](./Pie.md), [HalfPie](./HalfPie.md) and QuarterPie are effectively the same class, but have different starting and ending angles. They support all of the same properties.
|
|
8
|
+
|
|
9
|
+
<ClientOnly>
|
|
10
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
11
|
+
<div id="placeholder" style="height:400px">
|
|
12
|
+
</div>
|
|
13
|
+
<script type="module">
|
|
14
|
+
import { QuarterPie } from "@hpcc-js/chart";
|
|
15
|
+
|
|
16
|
+
new QuarterPie()
|
|
17
|
+
.columns(["Category", "Value"])
|
|
18
|
+
.data([
|
|
19
|
+
["A", 34],
|
|
20
|
+
["B", 55],
|
|
21
|
+
["C", 89],
|
|
22
|
+
["D", 144]
|
|
23
|
+
])
|
|
24
|
+
.target("placeholder")
|
|
25
|
+
.render()
|
|
26
|
+
;
|
|
27
|
+
</script>
|
|
28
|
+
</hpcc-vitepress>
|
|
29
|
+
</ClientOnly>
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
<ClientOnly>
|
|
33
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
34
|
+
<div id="placeholder" style="height:400px">
|
|
35
|
+
</div>
|
|
36
|
+
<script type="module">
|
|
37
|
+
import { QuarterPie } from "@hpcc-js/chart";
|
|
38
|
+
|
|
39
|
+
new QuarterPie()
|
|
40
|
+
.columns(["Category", "Value"])
|
|
41
|
+
.data([
|
|
42
|
+
["A", 34],
|
|
43
|
+
["B", 55],
|
|
44
|
+
["C", 89],
|
|
45
|
+
["D", 144]
|
|
46
|
+
])
|
|
47
|
+
.target("placeholder")
|
|
48
|
+
.innerRadius(62)
|
|
49
|
+
.showSeriesPercentage(true)
|
|
50
|
+
.showSeriesValue(true)
|
|
51
|
+
.render()
|
|
52
|
+
;
|
|
53
|
+
</script>
|
|
54
|
+
</hpcc-vitepress>
|
|
55
|
+
</ClientOnly>
|
|
56
|
+
|
|
57
|
+
## API
|
|
58
|
+
|
|
59
|
+
## Published Properties
|
|
60
|
+
```@hpcc-js/chart:QuarterPie
|
|
61
|
+
```
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# QuartileCandlestick
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
QuartileCandlestick displays a five number summary of a range of numeric values. The five-number summary is the minimum, first quartile, median, third quartile, and maximum.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<ClientOnly>
|
|
11
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
12
|
+
<div id="placeholder" style="height:400px">
|
|
13
|
+
</div>
|
|
14
|
+
<script type="module">
|
|
15
|
+
import { QuartileCandlestick } from "@hpcc-js/chart";
|
|
16
|
+
|
|
17
|
+
new QuartileCandlestick()
|
|
18
|
+
.target("placeholder")
|
|
19
|
+
.columns(["Min","25%","50%","75%","Max"])
|
|
20
|
+
.data([100,250,350,400,500])
|
|
21
|
+
.render()
|
|
22
|
+
;
|
|
23
|
+
</script>
|
|
24
|
+
</hpcc-vitepress>
|
|
25
|
+
</ClientOnly>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_orientation_ can be used to render this chart either vertically or horizontally.
|
|
29
|
+
|
|
30
|
+
_lineWidth_ and _candleWidth_ can be used to set the pixel width of the lines and the overall pixel width of the drawn portion of this chart respectively. _candleWidth_ also controls the height of the drawn portion while using 'horizontal' orientation.
|
|
31
|
+
|
|
32
|
+
_edgePadding_ sets the pixel padding between the edges of the containing element and the minimum/maximum lines.
|
|
33
|
+
|
|
34
|
+
_roundedCorners_ sets the pixel radius of the drawn lines.
|
|
35
|
+
|
|
36
|
+
_upperTextRotation_ and _lowerTextRotation_ sets the degrees of rotation for the column labels and column values respectively.
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
<ClientOnly>
|
|
40
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
41
|
+
<div id="placeholder" style="height:400px">
|
|
42
|
+
</div>
|
|
43
|
+
<script type="module">
|
|
44
|
+
import { QuartileCandlestick } from "@hpcc-js/chart";
|
|
45
|
+
|
|
46
|
+
new QuartileCandlestick()
|
|
47
|
+
.target("placeholder")
|
|
48
|
+
.columns(["Min","25%","50%","75%","Max"])
|
|
49
|
+
.data([100,200,300,400,500])
|
|
50
|
+
.orientation("vertical")
|
|
51
|
+
.lineWidth(2)
|
|
52
|
+
.candleWidth(80)
|
|
53
|
+
.edgePadding(20)
|
|
54
|
+
.roundedCorners(0)
|
|
55
|
+
.upperTextRotation(-90)
|
|
56
|
+
.lowerTextRotation(-90)
|
|
57
|
+
.render()
|
|
58
|
+
;
|
|
59
|
+
</script>
|
|
60
|
+
</hpcc-vitepress>
|
|
61
|
+
</ClientOnly>
|
|
62
|
+
|
|
63
|
+
_lineColor_ sets the fill color of the lines.
|
|
64
|
+
|
|
65
|
+
_textColor_ sets the fill color of the labels and values.
|
|
66
|
+
|
|
67
|
+
_innerRectColor_ sets the fill color of the inner rectangles between the first and third quartiles.
|
|
68
|
+
|
|
69
|
+
<ClientOnly>
|
|
70
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
71
|
+
<div id="placeholder" style="height:400px">
|
|
72
|
+
</div>
|
|
73
|
+
<script type="module">
|
|
74
|
+
import { QuartileCandlestick } from "@hpcc-js/chart";
|
|
75
|
+
|
|
76
|
+
new QuartileCandlestick()
|
|
77
|
+
.target("placeholder")
|
|
78
|
+
.columns(["Min","25%","50%","75%","Max"])
|
|
79
|
+
.data([100,250,350,400,500])
|
|
80
|
+
.orientation("vertical")
|
|
81
|
+
.lineColor("#999")
|
|
82
|
+
.textColor("#555")
|
|
83
|
+
.innerRectColor("#000")
|
|
84
|
+
.lineWidth(2)
|
|
85
|
+
.candleWidth(80)
|
|
86
|
+
.edgePadding(20)
|
|
87
|
+
.roundedCorners(0)
|
|
88
|
+
.upperTextRotation(-90)
|
|
89
|
+
.lowerTextRotation(-90)
|
|
90
|
+
.render()
|
|
91
|
+
;
|
|
92
|
+
</script>
|
|
93
|
+
</hpcc-vitepress>
|
|
94
|
+
</ClientOnly>
|
|
95
|
+
|
|
96
|
+
_showLabels_ and _showValues_ are true by default but can be used to hide the labels and values.
|
|
97
|
+
|
|
98
|
+
<ClientOnly>
|
|
99
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
100
|
+
<div id="placeholder" style="height:400px">
|
|
101
|
+
</div>
|
|
102
|
+
<script type="module">
|
|
103
|
+
import { QuartileCandlestick } from "@hpcc-js/chart";
|
|
104
|
+
|
|
105
|
+
new QuartileCandlestick()
|
|
106
|
+
.target("placeholder")
|
|
107
|
+
.columns(["Min","25%","50%","75%","Max"])
|
|
108
|
+
.data([1,497,498,499,500])
|
|
109
|
+
.showLabels(false)
|
|
110
|
+
.showValues(false)
|
|
111
|
+
.lineColor("#999")
|
|
112
|
+
.innerRectColor("#000")
|
|
113
|
+
.lineWidth(2)
|
|
114
|
+
.candleWidth(80)
|
|
115
|
+
.edgePadding(20)
|
|
116
|
+
.roundedCorners(0)
|
|
117
|
+
.upperTextRotation(-90)
|
|
118
|
+
.lowerTextRotation(-90)
|
|
119
|
+
.render()
|
|
120
|
+
;
|
|
121
|
+
</script>
|
|
122
|
+
</hpcc-vitepress>
|
|
123
|
+
</ClientOnly>
|
|
124
|
+
|
|
125
|
+
## API
|
|
126
|
+
|
|
127
|
+
## Published Properties
|
|
128
|
+
```@hpcc-js/chart:QuartileCandlestick
|
|
129
|
+
```
|
package/src/Radar.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Radar
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
Radar displays continuous data across n-number of categories (rows) and n-number of series (columns).
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
<ClientOnly>
|
|
11
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
12
|
+
<div id="placeholder" style="height:400px">
|
|
13
|
+
</div>
|
|
14
|
+
<script type="module">
|
|
15
|
+
import { Radar } from "@hpcc-js/chart";
|
|
16
|
+
|
|
17
|
+
new Radar()
|
|
18
|
+
.target("placeholder")
|
|
19
|
+
.columns(["Category", "Value"])
|
|
20
|
+
.data([
|
|
21
|
+
["A", 34],
|
|
22
|
+
["B", 55],
|
|
23
|
+
["C", 89],
|
|
24
|
+
["D", 144]
|
|
25
|
+
])
|
|
26
|
+
.render()
|
|
27
|
+
;
|
|
28
|
+
</script>
|
|
29
|
+
</hpcc-vitepress>
|
|
30
|
+
</ClientOnly>
|
|
31
|
+
|
|
32
|
+
_fontFamily_ and _fontSize_ can be used to control the font family and size used for the labels and guidelines.
|
|
33
|
+
|
|
34
|
+
_pointShape_ and _pointSize_ can be used to control the shape and size of the data points.
|
|
35
|
+
|
|
36
|
+
<ClientOnly>
|
|
37
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
38
|
+
<div id="placeholder" style="height:400px">
|
|
39
|
+
</div>
|
|
40
|
+
<script type="module">
|
|
41
|
+
import { Radar } from "@hpcc-js/chart";
|
|
42
|
+
|
|
43
|
+
new Radar()
|
|
44
|
+
.target("placeholder")
|
|
45
|
+
.columns(["Hour", "Value"])
|
|
46
|
+
.data([
|
|
47
|
+
["Dec", 134],
|
|
48
|
+
["Jan", 95],
|
|
49
|
+
["Feb", 80],
|
|
50
|
+
["Mar", 65],
|
|
51
|
+
["Apr", 59],
|
|
52
|
+
["May", 51],
|
|
53
|
+
["Jun", 58],
|
|
54
|
+
["Jul", 72],
|
|
55
|
+
["Aug", 79],
|
|
56
|
+
["Sep", 104],
|
|
57
|
+
["Oct", 134],
|
|
58
|
+
["Nov", 124]
|
|
59
|
+
])
|
|
60
|
+
.fontFamily("Verdana")
|
|
61
|
+
.fontSize(14)
|
|
62
|
+
.pointShape("circle")
|
|
63
|
+
.pointSize(3)
|
|
64
|
+
.render()
|
|
65
|
+
;
|
|
66
|
+
</script>
|
|
67
|
+
</hpcc-vitepress>
|
|
68
|
+
</ClientOnly>
|
|
69
|
+
|
|
70
|
+
_fillOpacity_ can be used to control the opacity of the background color created by each series.
|
|
71
|
+
|
|
72
|
+
_valueGuideRatios_ can be used to control placement, and count, of the guide lines.
|
|
73
|
+
|
|
74
|
+
_labelPaddingRatio_ shrinks the chart's visible area between its column labels.
|
|
75
|
+
|
|
76
|
+
<ClientOnly>
|
|
77
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
78
|
+
<div id="placeholder" style="height:400px">
|
|
79
|
+
</div>
|
|
80
|
+
<script type="module">
|
|
81
|
+
import { Radar } from "@hpcc-js/chart";
|
|
82
|
+
|
|
83
|
+
new Radar()
|
|
84
|
+
.target("placeholder")
|
|
85
|
+
.columns(["Category", "Value 1", "Value 2"])
|
|
86
|
+
.data([
|
|
87
|
+
["A", 34, 190],
|
|
88
|
+
["B", 55, 150],
|
|
89
|
+
["C", 89, 35],
|
|
90
|
+
["D", 144, 36]
|
|
91
|
+
])
|
|
92
|
+
.valueGuideRatios([0.5, 1.0])
|
|
93
|
+
.labelPaddingRatio(0.8)
|
|
94
|
+
.render()
|
|
95
|
+
;
|
|
96
|
+
</script>
|
|
97
|
+
</hpcc-vitepress>
|
|
98
|
+
</ClientOnly>
|
|
99
|
+
|
|
100
|
+
## API
|
|
101
|
+
|
|
102
|
+
## Published Properties
|
|
103
|
+
```@hpcc-js/chart:Radar
|
|
104
|
+
```
|
package/src/RadialBar.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# RadialBar
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
RadialBar displays one category and one numeric value per data row.
|
|
8
|
+
|
|
9
|
+
<ClientOnly>
|
|
10
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
11
|
+
<div id="placeholder" style="height:400px">
|
|
12
|
+
</div>
|
|
13
|
+
<script type="module">
|
|
14
|
+
import { RadialBar } from "@hpcc-js/chart";
|
|
15
|
+
|
|
16
|
+
new RadialBar()
|
|
17
|
+
.target("placeholder")
|
|
18
|
+
.columns(["Category", "Value"])
|
|
19
|
+
.data([
|
|
20
|
+
["A", 144],
|
|
21
|
+
["B", 89],
|
|
22
|
+
["C", 55],
|
|
23
|
+
["D", 34]
|
|
24
|
+
])
|
|
25
|
+
.render()
|
|
26
|
+
;
|
|
27
|
+
</script>
|
|
28
|
+
</hpcc-vitepress>
|
|
29
|
+
</ClientOnly>
|
|
30
|
+
|
|
31
|
+
_valueMaxAngle_ sets the maximum angle of the largest value in the data that you provide.
|
|
32
|
+
|
|
33
|
+
_tickCount_ sets the target number of ticks to display along the circular axis. The tick count may be slightly lower or higher than the provided number as the axis attempts to place the ticks in sensible intervals.
|
|
34
|
+
|
|
35
|
+
<ClientOnly>
|
|
36
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
37
|
+
<div id="placeholder" style="height:400px">
|
|
38
|
+
</div>
|
|
39
|
+
<script type="module">
|
|
40
|
+
import { RadialBar } from "@hpcc-js/chart";
|
|
41
|
+
|
|
42
|
+
new RadialBar()
|
|
43
|
+
.target("placeholder")
|
|
44
|
+
.columns(["Category", "Value 1"])
|
|
45
|
+
.data([
|
|
46
|
+
["A", 144],
|
|
47
|
+
["B", 89],
|
|
48
|
+
["C", 55],
|
|
49
|
+
["D", 34]
|
|
50
|
+
])
|
|
51
|
+
.valueMaxAngle(90)
|
|
52
|
+
.tickCount(10)
|
|
53
|
+
.render()
|
|
54
|
+
;
|
|
55
|
+
</script>
|
|
56
|
+
</hpcc-vitepress>
|
|
57
|
+
</ClientOnly>
|
|
58
|
+
|
|
59
|
+
_domainPadding_ sets the ratio of white space to bar width.
|
|
60
|
+
|
|
61
|
+
_valueDomainHigh_ sets the maximum domain axis value.
|
|
62
|
+
|
|
63
|
+
<ClientOnly>
|
|
64
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
65
|
+
<div id="placeholder" style="height:400px">
|
|
66
|
+
</div>
|
|
67
|
+
<script type="module">
|
|
68
|
+
import { RadialBar } from "@hpcc-js/chart";
|
|
69
|
+
|
|
70
|
+
new RadialBar()
|
|
71
|
+
.target("placeholder")
|
|
72
|
+
.columns(["Category", "Value 1"])
|
|
73
|
+
.data([
|
|
74
|
+
["A", 144],
|
|
75
|
+
["B", 89],
|
|
76
|
+
["C", 55],
|
|
77
|
+
["D", 34]
|
|
78
|
+
])
|
|
79
|
+
.domainPadding(0.62)
|
|
80
|
+
.valueDomainHigh(200)
|
|
81
|
+
.render()
|
|
82
|
+
;
|
|
83
|
+
</script>
|
|
84
|
+
</hpcc-vitepress>
|
|
85
|
+
</ClientOnly>
|
|
86
|
+
|
|
87
|
+
## API
|
|
88
|
+
|
|
89
|
+
## Published Properties
|
|
90
|
+
```@hpcc-js/chart:RadialBar
|
|
91
|
+
```
|
package/src/Scatter.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Scatter
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
Scatter, [Area](./Area.md), [Line](./Line.md) and [Step](./Step.md) serve a similar purpose. They display continuous data along a categorical or continuous axis.
|
|
8
|
+
|
|
9
|
+
<ClientOnly>
|
|
10
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
11
|
+
<div id="placeholder" style="height:400px">
|
|
12
|
+
</div>
|
|
13
|
+
<script type="module">
|
|
14
|
+
import { Scatter } from "@hpcc-js/chart";
|
|
15
|
+
|
|
16
|
+
new Scatter()
|
|
17
|
+
.target("placeholder")
|
|
18
|
+
.columns(["Category", "Value"])
|
|
19
|
+
.data([
|
|
20
|
+
["A", 34],
|
|
21
|
+
["B", 55],
|
|
22
|
+
["C", 89],
|
|
23
|
+
["D", 144]
|
|
24
|
+
])
|
|
25
|
+
.render()
|
|
26
|
+
;
|
|
27
|
+
</script>
|
|
28
|
+
</hpcc-vitepress>
|
|
29
|
+
</ClientOnly>
|
|
30
|
+
|
|
31
|
+
Scatter supports n-number of numeric values per data row. A series is created for each column as needed.
|
|
32
|
+
|
|
33
|
+
<ClientOnly>
|
|
34
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
35
|
+
<div id="placeholder" style="height:400px">
|
|
36
|
+
</div>
|
|
37
|
+
<script type="module">
|
|
38
|
+
import { Scatter } from "@hpcc-js/chart";
|
|
39
|
+
|
|
40
|
+
new Scatter()
|
|
41
|
+
.target("placeholder")
|
|
42
|
+
.columns(["Category", "Value 1", "Value 2", "Value 3"])
|
|
43
|
+
.data([
|
|
44
|
+
["A", 34, 90, 82],
|
|
45
|
+
["B", 55, 50, 65],
|
|
46
|
+
["C", 89, 75, 43],
|
|
47
|
+
["D", 144, 66, 56]
|
|
48
|
+
])
|
|
49
|
+
.render()
|
|
50
|
+
;
|
|
51
|
+
</script>
|
|
52
|
+
</hpcc-vitepress>
|
|
53
|
+
</ClientOnly>
|
|
54
|
+
|
|
55
|
+
_pointShape_ can be used to specify the shape of each data point (see the property list below for potential values).
|
|
56
|
+
|
|
57
|
+
_pointSize_ can be used to set the size of each data point's shape.
|
|
58
|
+
|
|
59
|
+
_showValue_ specifies whether or not to display the value above each data point.
|
|
60
|
+
|
|
61
|
+
_yAxisDomainPadding_ can be used to reserve a percentage of the top and bottom edges for white space.
|
|
62
|
+
|
|
63
|
+
<ClientOnly>
|
|
64
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
65
|
+
<div id="placeholder" style="height:400px">
|
|
66
|
+
</div>
|
|
67
|
+
<script type="module">
|
|
68
|
+
import { Scatter } from "@hpcc-js/chart";
|
|
69
|
+
|
|
70
|
+
new Scatter()
|
|
71
|
+
.target("placeholder")
|
|
72
|
+
.columns(["Category", "Value", "Value 2"])
|
|
73
|
+
.data([
|
|
74
|
+
["A", 34, 350],
|
|
75
|
+
["B", 55, 380],
|
|
76
|
+
["C", 89, 390],
|
|
77
|
+
["D", 98, 410]
|
|
78
|
+
])
|
|
79
|
+
.pointShape("circle")
|
|
80
|
+
.pointSize(2)
|
|
81
|
+
.showValue(true)
|
|
82
|
+
.yAxisDomainPadding(10)
|
|
83
|
+
.render()
|
|
84
|
+
;
|
|
85
|
+
</script>
|
|
86
|
+
</hpcc-vitepress>
|
|
87
|
+
</ClientOnly>
|
|
88
|
+
|
|
89
|
+
_interpolate_ can be used to specify which line interpolation mode is used to draw the connecting line between data points (see the property list below for potential values).
|
|
90
|
+
|
|
91
|
+
_pointDarken_ can be set to 'false' to disable the slight darkening effect applied to each data point.
|
|
92
|
+
|
|
93
|
+
_showValue_ along with _valueBaseline("central")_ places the values at the center of each data point.
|
|
94
|
+
|
|
95
|
+
_xAxisDomainPadding_ can be used to reserve a percentage of the left and right edges for white space.
|
|
96
|
+
|
|
97
|
+
<ClientOnly>
|
|
98
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
99
|
+
<div id="placeholder" style="height:400px">
|
|
100
|
+
</div>
|
|
101
|
+
<script type="module">
|
|
102
|
+
import { Scatter } from "@hpcc-js/chart";
|
|
103
|
+
|
|
104
|
+
new Scatter()
|
|
105
|
+
.target("placeholder")
|
|
106
|
+
.columns(["Value 1", "Value 2"])
|
|
107
|
+
.data([
|
|
108
|
+
[144, 90],
|
|
109
|
+
[89, 50],
|
|
110
|
+
[55, 75],
|
|
111
|
+
[34, 66]
|
|
112
|
+
])
|
|
113
|
+
.paletteID("FlatUI_German")
|
|
114
|
+
.xAxisType("linear")
|
|
115
|
+
.pointShape("rectangle")
|
|
116
|
+
.pointSize(20)
|
|
117
|
+
.pointDarken(false)
|
|
118
|
+
.showValue(true)
|
|
119
|
+
.valueBaseline("central")
|
|
120
|
+
.xAxisDomainPadding(5)
|
|
121
|
+
.render()
|
|
122
|
+
;
|
|
123
|
+
</script>
|
|
124
|
+
</hpcc-vitepress>
|
|
125
|
+
</ClientOnly>
|
|
126
|
+
|
|
127
|
+
For documentation on axis-specific properties, like those used in the below example, take a look at the [Axis Documentation](./XYAxis.md).
|
|
128
|
+
|
|
129
|
+
<ClientOnly>
|
|
130
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
131
|
+
<div id="placeholder" style="height:400px">
|
|
132
|
+
</div>
|
|
133
|
+
<script type="module">
|
|
134
|
+
import { Scatter } from "@hpcc-js/chart";
|
|
135
|
+
|
|
136
|
+
new Scatter()
|
|
137
|
+
.columns(["Value 1", "Value 2"])
|
|
138
|
+
.data([
|
|
139
|
+
[144, 90],
|
|
140
|
+
[89, 50],
|
|
141
|
+
[55, 75],
|
|
142
|
+
[34, 66]
|
|
143
|
+
])
|
|
144
|
+
.target("placeholder")
|
|
145
|
+
.xAxisType("linear")
|
|
146
|
+
.xAxisTitle("X-Axis Title")
|
|
147
|
+
.yAxisTitle("Y-Axis Title")
|
|
148
|
+
.xAxisTickCount(30)
|
|
149
|
+
.xAxisOverlapMode("rotate")
|
|
150
|
+
.xAxisLabelRotation(90)
|
|
151
|
+
.pointShape("circle")
|
|
152
|
+
.render()
|
|
153
|
+
;
|
|
154
|
+
</script>
|
|
155
|
+
</hpcc-vitepress>
|
|
156
|
+
</ClientOnly>
|
|
157
|
+
|
|
158
|
+
## API
|
|
159
|
+
|
|
160
|
+
## Published Properties
|
|
161
|
+
|
|
162
|
+
```@hpcc-js/chart:Scatter
|
|
163
|
+
```
|