@hpcc-js/chart 2.77.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 +26 -17
- package/dist/index.es6.js +2 -2
- package/dist/index.es6.js.map +1 -1
- package/dist/index.js +2 -2
- 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 +5 -5
- 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/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/Line.md +170 -0
- package/src/Pie.md +88 -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/__package__.ts +2 -2
- package/types/__package__.d.ts +2 -2
- package/types/__package__.d.ts.map +1 -1
- package/types-3.4/__package__.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hpcc-js/chart",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.78.0",
|
|
4
4
|
"description": "hpcc-js - Viz Chart",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.es6",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"update": "npx npm-check-updates -u -t minor"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@hpcc-js/api": "^2.
|
|
42
|
-
"@hpcc-js/common": "^2.
|
|
43
|
-
"@hpcc-js/util": "^2.
|
|
41
|
+
"@hpcc-js/api": "^2.10.0",
|
|
42
|
+
"@hpcc-js/common": "^2.68.0",
|
|
43
|
+
"@hpcc-js/util": "^2.47.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@hpcc-js/bundle": "^2.11.1",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"url": "https://github.com/hpcc-systems/Visualization/issues"
|
|
79
79
|
},
|
|
80
80
|
"homepage": "https://github.com/hpcc-systems/Visualization",
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "33aa52bc641400d8fb3bfa51dcd4c94a9599fc90"
|
|
82
82
|
}
|
package/src/Area.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Area
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
Area, [Line](./Line.md), [Step](./Step.md) and [Scatter](./Scatter.md) serve a similar purpose. They display continuous data along a categorical or continuous axis.
|
|
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 { Area } from "@hpcc-js/chart";
|
|
16
|
+
|
|
17
|
+
new Area()
|
|
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
|
+
|
|
33
|
+
Area supports n-number of numeric values per data row. A series is created for each column as needed.
|
|
34
|
+
|
|
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 { Area } from "@hpcc-js/chart";
|
|
42
|
+
|
|
43
|
+
new Area()
|
|
44
|
+
.target("placeholder")
|
|
45
|
+
.columns(["Category", "Value 1", "Value 2", "Value 3"])
|
|
46
|
+
.data([
|
|
47
|
+
["A", 34, 90, 82],
|
|
48
|
+
["B", 55, 50, 65],
|
|
49
|
+
["C", 89, 75, 43],
|
|
50
|
+
["D", 144, 66, 56]
|
|
51
|
+
])
|
|
52
|
+
.render()
|
|
53
|
+
;
|
|
54
|
+
</script>
|
|
55
|
+
</hpcc-vitepress>
|
|
56
|
+
</ClientOnly>
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
_pointShape_ can be used to specify the shape of each data point (see the property list below for potential values).
|
|
60
|
+
|
|
61
|
+
_pointSize_ can be used to set the size of each data point's shape.
|
|
62
|
+
|
|
63
|
+
_showValue_ specifies whether or not to display the value above each data point.
|
|
64
|
+
|
|
65
|
+
_yAxisDomainPadding_ can be used to reserve a percentage of the top and bottom edges for white space.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
<ClientOnly>
|
|
69
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
70
|
+
<div id="placeholder" style="height:400px">
|
|
71
|
+
</div>
|
|
72
|
+
<script type="module">
|
|
73
|
+
import { Area } from "@hpcc-js/chart";
|
|
74
|
+
|
|
75
|
+
new Area()
|
|
76
|
+
.target("placeholder")
|
|
77
|
+
.columns(["Category", "Value", "Value 2"])
|
|
78
|
+
.data([
|
|
79
|
+
["A", 34, 350],
|
|
80
|
+
["B", 55, 380],
|
|
81
|
+
["C", 89, 390],
|
|
82
|
+
["D", 98, 410]
|
|
83
|
+
])
|
|
84
|
+
.pointShape("circle")
|
|
85
|
+
.pointSize(2)
|
|
86
|
+
.showValue(true)
|
|
87
|
+
.yAxisDomainPadding(10)
|
|
88
|
+
.render()
|
|
89
|
+
;
|
|
90
|
+
</script>
|
|
91
|
+
</hpcc-vitepress>
|
|
92
|
+
</ClientOnly>
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
_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).
|
|
96
|
+
|
|
97
|
+
_pointDarken_ can be set to 'false' to disable the slight darkening effect applied to each data point.
|
|
98
|
+
|
|
99
|
+
_showValue_ along with _valueBaseline("central")_ places the values at the center of each data point.
|
|
100
|
+
|
|
101
|
+
_xAxisDomainPadding_ can be used to reserve a percentage of the left and right edges for white space.
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
<ClientOnly>
|
|
105
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
106
|
+
<div id="placeholder" style="height:400px">
|
|
107
|
+
</div>
|
|
108
|
+
<script type="module">
|
|
109
|
+
import { Area } from "@hpcc-js/chart";
|
|
110
|
+
|
|
111
|
+
new Area()
|
|
112
|
+
.target("placeholder")
|
|
113
|
+
.columns(["Value 1", "Value 2"])
|
|
114
|
+
.data([
|
|
115
|
+
[144, 90],
|
|
116
|
+
[89, 50],
|
|
117
|
+
[55, 75],
|
|
118
|
+
[34, 66]
|
|
119
|
+
])
|
|
120
|
+
.paletteID("FlatUI_German")
|
|
121
|
+
.xAxisType("linear")
|
|
122
|
+
.pointShape("rectangle")
|
|
123
|
+
.pointSize(20)
|
|
124
|
+
.pointDarken(false)
|
|
125
|
+
.showValue(true)
|
|
126
|
+
.valueBaseline("central")
|
|
127
|
+
.xAxisDomainPadding(5)
|
|
128
|
+
.render()
|
|
129
|
+
;
|
|
130
|
+
</script>
|
|
131
|
+
</hpcc-vitepress>
|
|
132
|
+
</ClientOnly>
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
For documentation on axis-specific properties, like those used in the below example, take a look at the [Axis Documentation](./XYAxis.md).
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
<ClientOnly>
|
|
139
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
140
|
+
<div id="placeholder" style="height:400px">
|
|
141
|
+
</div>
|
|
142
|
+
<script type="module">
|
|
143
|
+
import { Area } from "@hpcc-js/chart";
|
|
144
|
+
|
|
145
|
+
new Area()
|
|
146
|
+
.target("placeholder")
|
|
147
|
+
.columns(["Value 1", "Value 2"])
|
|
148
|
+
.data([
|
|
149
|
+
[144, 90],
|
|
150
|
+
[89, 50],
|
|
151
|
+
[55, 75],
|
|
152
|
+
[34, 66]
|
|
153
|
+
])
|
|
154
|
+
.xAxisType("linear")
|
|
155
|
+
.xAxisTitle("X-Axis Title")
|
|
156
|
+
.yAxisTitle("Y-Axis Title")
|
|
157
|
+
.xAxisTickCount(30)
|
|
158
|
+
.xAxisOverlapMode("rotate")
|
|
159
|
+
.xAxisLabelRotation(90)
|
|
160
|
+
.pointShape("circle")
|
|
161
|
+
.render()
|
|
162
|
+
;
|
|
163
|
+
</script>
|
|
164
|
+
</hpcc-vitepress>
|
|
165
|
+
</ClientOnly>
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
## API
|
|
169
|
+
|
|
170
|
+
<!--meta:Area.target
|
|
171
|
+
|
|
172
|
+
-->
|
|
173
|
+
|
|
174
|
+
## Published Properties
|
|
175
|
+
```@hpcc-js/chart:Area
|
|
176
|
+
```
|
package/src/Bar.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# Bar
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
Bar and [Column](./Column) are effectively the same class, but have one different default value - their _orientation_. 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 { Bar } from "@hpcc-js/chart";
|
|
15
|
+
|
|
16
|
+
new Bar()
|
|
17
|
+
.target("placeholder")
|
|
18
|
+
.columns(["Category", "Value"])
|
|
19
|
+
.data([
|
|
20
|
+
["A", 34],
|
|
21
|
+
["B", 55],
|
|
22
|
+
["C", 89],
|
|
23
|
+
["D", 144]
|
|
24
|
+
])
|
|
25
|
+
.yAxisDomainLow(0)
|
|
26
|
+
.render()
|
|
27
|
+
;
|
|
28
|
+
</script>
|
|
29
|
+
</hpcc-vitepress>
|
|
30
|
+
</ClientOnly>
|
|
31
|
+
|
|
32
|
+
Two or more series are commonly compared with a bar chart.
|
|
33
|
+
|
|
34
|
+
<ClientOnly>
|
|
35
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
36
|
+
<div id="placeholder" style="height:400px">
|
|
37
|
+
</div>
|
|
38
|
+
<script type="module">
|
|
39
|
+
import { Bar } from "@hpcc-js/chart";
|
|
40
|
+
|
|
41
|
+
new Bar()
|
|
42
|
+
.target("placeholder")
|
|
43
|
+
.columns(["Category", "Value 1", "Value 2"])
|
|
44
|
+
.data([
|
|
45
|
+
["A", 34, 90],
|
|
46
|
+
["B", 55, 50],
|
|
47
|
+
["C", 89, 75],
|
|
48
|
+
["D", 144, 66]
|
|
49
|
+
])
|
|
50
|
+
.xAxisOrdinalPaddingInner(0.38)
|
|
51
|
+
.xAxisOrdinalPaddingOuter(0.62)
|
|
52
|
+
.xAxisFocus(true)
|
|
53
|
+
.render()
|
|
54
|
+
;
|
|
55
|
+
</script>
|
|
56
|
+
</hpcc-vitepress>
|
|
57
|
+
</ClientOnly>
|
|
58
|
+
|
|
59
|
+
A bar chart supports n-number of numeric values per data row. A series is created for each column as needed. In the below example the series' are stacked together using the _yAxisStacked_ property.
|
|
60
|
+
|
|
61
|
+
<ClientOnly>
|
|
62
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
63
|
+
<div id="placeholder" style="height:400px">
|
|
64
|
+
</div>
|
|
65
|
+
<script type="module">
|
|
66
|
+
import { Bar } from "@hpcc-js/chart";
|
|
67
|
+
|
|
68
|
+
new Bar()
|
|
69
|
+
.target("placeholder")
|
|
70
|
+
.columns(["Category", "Value 1", "Value 2", "Value 3"])
|
|
71
|
+
.data([
|
|
72
|
+
["A", 34, 90, 82],
|
|
73
|
+
["B", 55, 50, 65],
|
|
74
|
+
["C", 89, 75, 43],
|
|
75
|
+
["D", 144, 66, 56]
|
|
76
|
+
])
|
|
77
|
+
.showValue(true)
|
|
78
|
+
.valueCentered(true)
|
|
79
|
+
.yAxisStacked(true)
|
|
80
|
+
.render()
|
|
81
|
+
;
|
|
82
|
+
</script>
|
|
83
|
+
</hpcc-vitepress>
|
|
84
|
+
</ClientOnly>
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
## API
|
|
88
|
+
|
|
89
|
+
## Published Properties
|
|
90
|
+
```@hpcc-js/chart:Bar
|
|
91
|
+
```
|
package/src/Bubble.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Bubble
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
A bubble chart represents a categorical data by displaying circles sized relative to each category's value. The circles are sized automatically to fit their target element.
|
|
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 { Bubble } from "@hpcc-js/chart";
|
|
16
|
+
|
|
17
|
+
new Bubble()
|
|
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
|
+
|
|
33
|
+
_paletteID_ can be used to assign an ordinal color palette.
|
|
34
|
+
|
|
35
|
+
_selectionGlowColor_ can be used to change the glow color when a bubble is selected.
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
<ClientOnly>
|
|
39
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
40
|
+
<div id="placeholder" style="height:400px">
|
|
41
|
+
</div>
|
|
42
|
+
<script type="module">
|
|
43
|
+
import { Bubble } from "@hpcc-js/chart";
|
|
44
|
+
|
|
45
|
+
new Bubble()
|
|
46
|
+
.target("placeholder")
|
|
47
|
+
.columns(["Category", "Value"])
|
|
48
|
+
.data([
|
|
49
|
+
["A", 34],
|
|
50
|
+
["B", 55],
|
|
51
|
+
["C", 89],
|
|
52
|
+
["D", 1440]
|
|
53
|
+
])
|
|
54
|
+
.paletteID("FlatUI_British")
|
|
55
|
+
.selectionGlowColor("#00FF00")
|
|
56
|
+
.render()
|
|
57
|
+
;
|
|
58
|
+
</script>
|
|
59
|
+
</hpcc-vitepress>
|
|
60
|
+
</ClientOnly>
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
<!-- For documentation on tooltip properties, take a look at the [Tooltip Documentation](../../common/docs/Tooltip.md) -->
|
|
64
|
+
|
|
65
|
+
## API
|
|
66
|
+
|
|
67
|
+
## Published Properties
|
|
68
|
+
```@hpcc-js/chart:Bubble
|
|
69
|
+
```
|
package/src/Bullet.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Bullet
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
The Bullet chart displays a title and subtitle along with three types of values to the right. Each row's values are placed relative to the other values in that row. Their placement is unaffected by the values in other rows.
|
|
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 { Bullet } from "@hpcc-js/chart";
|
|
16
|
+
|
|
17
|
+
new Bullet()
|
|
18
|
+
.target("placeholder")
|
|
19
|
+
.columns(["title", "subtitle", "measures"])
|
|
20
|
+
.data([
|
|
21
|
+
["Revenue", "US$, in thousands", [220, 270, 345]],
|
|
22
|
+
["Profit ", "%", [21, 23]],
|
|
23
|
+
["Order Size", "US$, average", [100, 320, 432]],
|
|
24
|
+
["New Customers", "count", [1000, 1650, 1943]],
|
|
25
|
+
["Satisfaction", "out of 5", [3.2, 4.7, 4.9]]
|
|
26
|
+
])
|
|
27
|
+
.titleColumn("title")
|
|
28
|
+
.subtitleColumn("subtitle")
|
|
29
|
+
.measuresColumn("measures")
|
|
30
|
+
.render()
|
|
31
|
+
;
|
|
32
|
+
</script>
|
|
33
|
+
</hpcc-vitepress>
|
|
34
|
+
</ClientOnly>
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
In this example "markers" have been added.
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
<ClientOnly>
|
|
41
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
42
|
+
<div id="placeholder" style="height:400px">
|
|
43
|
+
</div>
|
|
44
|
+
<script type="module">
|
|
45
|
+
import { Bullet } from "@hpcc-js/chart";
|
|
46
|
+
|
|
47
|
+
new Bullet()
|
|
48
|
+
.target("placeholder")
|
|
49
|
+
.columns(["title", "subtitle", "measures", "markers"])
|
|
50
|
+
.data([
|
|
51
|
+
["Revenue", "US$, in thousands", [220, 270], [250, 25]],
|
|
52
|
+
["Profit ", "%", [21, 23], [26]],
|
|
53
|
+
["Order Size", "US$, average", [100, 320], [150, 550]],
|
|
54
|
+
["New Customers", "count", [1000, 1650], [190, 540, 750, 850, 2100]],
|
|
55
|
+
["Satisfaction", "out of 5", [3.2, 4.7], [4.4]]
|
|
56
|
+
])
|
|
57
|
+
.titleColumn("title")
|
|
58
|
+
.subtitleColumn("subtitle")
|
|
59
|
+
.measuresColumn("measures")
|
|
60
|
+
.markersColumn("markers")
|
|
61
|
+
.render()
|
|
62
|
+
;
|
|
63
|
+
</script>
|
|
64
|
+
</hpcc-vitepress>
|
|
65
|
+
</ClientOnly>
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
In this example "ranges" have been added.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
<ClientOnly>
|
|
72
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
73
|
+
<div id="placeholder" style="height:400px">
|
|
74
|
+
</div>
|
|
75
|
+
<script type="module">
|
|
76
|
+
import { Bullet } from "@hpcc-js/chart";
|
|
77
|
+
|
|
78
|
+
new Bullet()
|
|
79
|
+
.target("placeholder")
|
|
80
|
+
.columns(["title", "subtitle", "ranges", "measures", "markers"])
|
|
81
|
+
.data([
|
|
82
|
+
["Revenue", "US$, in thousands", [150, 225, 300], [220, 270], [250, 25]],
|
|
83
|
+
["Profit ", "%", [20, 25, 30], [21, 23], [26]],
|
|
84
|
+
["Order Size", "US$, average", [350, 500, 600], [100, 320], [550]],
|
|
85
|
+
["New Customers", "count", [1400, 2000, 2500], [1000, 1650], 2100],
|
|
86
|
+
["Satisfaction", "out of 5", [3.5, 4.25, 5], [3.2, 4.7], [4.4]]
|
|
87
|
+
])
|
|
88
|
+
.titleColumn("title")
|
|
89
|
+
.subtitleColumn("subtitle")
|
|
90
|
+
.rangesColumn("ranges")
|
|
91
|
+
.measuresColumn("measures")
|
|
92
|
+
.markersColumn("markers")
|
|
93
|
+
.render()
|
|
94
|
+
;
|
|
95
|
+
</script>
|
|
96
|
+
</hpcc-vitepress>
|
|
97
|
+
</ClientOnly>
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
## API
|
|
101
|
+
|
|
102
|
+
## Published Properties
|
|
103
|
+
```@hpcc-js/chart:Bullet
|
|
104
|
+
```
|
package/src/Column.md
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Column
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
[Bar](./Bar) and Column are effectively the same class, but have one different default value - their _orientation_. 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 { Column } from "@hpcc-js/chart";
|
|
15
|
+
|
|
16
|
+
new Column()
|
|
17
|
+
.target("placeholder")
|
|
18
|
+
.columns(["Category", "Value"])
|
|
19
|
+
.data([
|
|
20
|
+
["A", 34],
|
|
21
|
+
["B", 55],
|
|
22
|
+
["C", 89],
|
|
23
|
+
["D", 144]
|
|
24
|
+
])
|
|
25
|
+
.yAxisDomainLow(0)
|
|
26
|
+
.render()
|
|
27
|
+
;
|
|
28
|
+
</script>
|
|
29
|
+
</hpcc-vitepress>
|
|
30
|
+
</ClientOnly>
|
|
31
|
+
|
|
32
|
+
Two or more series are commonly compared with a column chart.
|
|
33
|
+
|
|
34
|
+
<ClientOnly>
|
|
35
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
36
|
+
<div id="placeholder" style="height:400px">
|
|
37
|
+
</div>
|
|
38
|
+
<script type="module">
|
|
39
|
+
import { Column } from "@hpcc-js/chart";
|
|
40
|
+
|
|
41
|
+
new Column()
|
|
42
|
+
.target("placeholder")
|
|
43
|
+
.columns(["Category", "Value 1", "Value 2"])
|
|
44
|
+
.data([
|
|
45
|
+
["A", 34, 90],
|
|
46
|
+
["B", 55, 50],
|
|
47
|
+
["C", 89, 75],
|
|
48
|
+
["D", 144, 66]
|
|
49
|
+
])
|
|
50
|
+
.xAxisOrdinalPaddingInner(0.38)
|
|
51
|
+
.xAxisOrdinalPaddingOuter(0.62)
|
|
52
|
+
.xAxisFocus(true)
|
|
53
|
+
.render()
|
|
54
|
+
;
|
|
55
|
+
</script>
|
|
56
|
+
</hpcc-vitepress>
|
|
57
|
+
</ClientOnly>
|
|
58
|
+
|
|
59
|
+
A column chart supports n-number of numeric values per data row. A series is created for each column as needed. In the below example the series' are stacked together using the _yAxisStacked_ property.
|
|
60
|
+
|
|
61
|
+
<ClientOnly>
|
|
62
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
63
|
+
<div id="placeholder" style="height:400px">
|
|
64
|
+
</div>
|
|
65
|
+
<script type="module">
|
|
66
|
+
import { Column } from "@hpcc-js/chart";
|
|
67
|
+
|
|
68
|
+
new Column()
|
|
69
|
+
.target("placeholder")
|
|
70
|
+
.columns(["Category", "Value 1", "Value 2", "Value 3"])
|
|
71
|
+
.data([
|
|
72
|
+
["A", 34, 90, 82],
|
|
73
|
+
["B", 55, 50, 65],
|
|
74
|
+
["C", 89, 75, 43],
|
|
75
|
+
["D", 144, 66, 56]
|
|
76
|
+
])
|
|
77
|
+
.showValue(true)
|
|
78
|
+
.valueCentered(true)
|
|
79
|
+
.yAxisStacked(true)
|
|
80
|
+
.render()
|
|
81
|
+
;
|
|
82
|
+
</script>
|
|
83
|
+
</hpcc-vitepress>
|
|
84
|
+
</ClientOnly>
|
|
85
|
+
|
|
86
|
+
## API
|
|
87
|
+
|
|
88
|
+
## Published Properties
|
|
89
|
+
```@hpcc-js/chart:Column
|
|
90
|
+
```
|
package/src/Contour.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Contour
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
Contour and [HexBin](./HexBin.md) serve a similar purpose. They summarize high density data across two continuous axes.
|
|
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 { Contour } from "@hpcc-js/chart";
|
|
16
|
+
|
|
17
|
+
new Contour()
|
|
18
|
+
.target("placeholder")
|
|
19
|
+
.columns(["X-Value", "Y-Value"])
|
|
20
|
+
.data(randomData(1000))
|
|
21
|
+
.xAxisType("linear")
|
|
22
|
+
.render()
|
|
23
|
+
;
|
|
24
|
+
|
|
25
|
+
function randomData(count){
|
|
26
|
+
return Array(count).fill(1).map((n,x)=>{
|
|
27
|
+
const y = Math.sqrt(x) * Math.random();
|
|
28
|
+
return [x,y];
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
</hpcc-vitepress>
|
|
33
|
+
</ClientOnly>
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
_contourBandwidth_ can be used to control the standard deviation of the contour algorithm. The results can be seen in the below example.
|
|
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 { Contour } from "@hpcc-js/chart";
|
|
45
|
+
|
|
46
|
+
let bandwidth = 10;
|
|
47
|
+
|
|
48
|
+
const widget = new Contour()
|
|
49
|
+
.target("placeholder")
|
|
50
|
+
.columns(["X-Value", "Y-Value"])
|
|
51
|
+
.data(randomData(1000))
|
|
52
|
+
.xAxisType("linear")
|
|
53
|
+
.xAxisTickCount(10)
|
|
54
|
+
.contourBandwidth(bandwidth)
|
|
55
|
+
.render()
|
|
56
|
+
;
|
|
57
|
+
|
|
58
|
+
function randomData(count){
|
|
59
|
+
return Array(count).fill(1).map((n,x)=>{
|
|
60
|
+
const y = Math.sqrt(x) * Math.random();
|
|
61
|
+
return [x,y];
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
let interval = 10;
|
|
65
|
+
setInterval(function(){
|
|
66
|
+
const next = bandwidth + interval;
|
|
67
|
+
if(next > 100 || next <= 0){
|
|
68
|
+
interval *= -1;
|
|
69
|
+
}
|
|
70
|
+
bandwidth += interval;
|
|
71
|
+
widget
|
|
72
|
+
.xAxisTitle("bandwidth = " + bandwidth)
|
|
73
|
+
.contourBandwidth(bandwidth)
|
|
74
|
+
.render()
|
|
75
|
+
;
|
|
76
|
+
},1000);
|
|
77
|
+
</script>
|
|
78
|
+
</hpcc-vitepress>
|
|
79
|
+
</ClientOnly>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
For documentation on axis-specific properties take a look at the [Axis Documentation](./XYAxis.md).
|
|
83
|
+
|
|
84
|
+
## API
|
|
85
|
+
|
|
86
|
+
## Published Properties
|
|
87
|
+
```@hpcc-js/chart:Contour
|
|
88
|
+
```
|