@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/src/Gantt.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Gantt
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
Gantt compares ranges of continuous data. Each range is represented by an array of two numeric values. The first column of each data row must contain a string or number to represent that row's category. Each additional column must contain an array of two numbers.
|
|
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 { Gantt } from "@hpcc-js/chart";
|
|
15
|
+
|
|
16
|
+
new Gantt()
|
|
17
|
+
.target("placeholder")
|
|
18
|
+
.columns(["Category", "Range"])
|
|
19
|
+
.data([
|
|
20
|
+
["A", [34, 90]],
|
|
21
|
+
["B", [55, 75]],
|
|
22
|
+
["C", [75, 89]],
|
|
23
|
+
["D", [66, 99]]
|
|
24
|
+
])
|
|
25
|
+
.render()
|
|
26
|
+
;
|
|
27
|
+
</script>
|
|
28
|
+
</hpcc-vitepress>
|
|
29
|
+
</ClientOnly>
|
|
30
|
+
|
|
31
|
+
Gantt also supports multiple ranges per data row.
|
|
32
|
+
|
|
33
|
+
The _orientation_ is set to 'horizontal' by default so _yAxisTitle_ is used to assign the horizontal axis' label.
|
|
34
|
+
|
|
35
|
+
_xAxisSeriesPaddingInner_ can be used to set the ratio between white space and bar size (per series).
|
|
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 { Gantt } from "@hpcc-js/chart";
|
|
44
|
+
|
|
45
|
+
new Gantt()
|
|
46
|
+
.target("placeholder")
|
|
47
|
+
.columns(["State Changes", "Iron", "Aluminum", "Lead", "Gold"])
|
|
48
|
+
.data([
|
|
49
|
+
["Solid", [0, 1811], [0, 933], [0, 600], [0,1337]],
|
|
50
|
+
["Liquid", [1811, 3134], [933, 2743], [600, 2022], [1337, 3243]],
|
|
51
|
+
["Gas", [3134, 5000], [2743, 5000], [2022, 5000], [3243, 5000]]
|
|
52
|
+
])
|
|
53
|
+
.xAxisSeriesPaddingInner(0.3)
|
|
54
|
+
.yAxisTitle("Kelvin")
|
|
55
|
+
.render()
|
|
56
|
+
;
|
|
57
|
+
</script>
|
|
58
|
+
</hpcc-vitepress>
|
|
59
|
+
</ClientOnly>
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
It also supports duplicate category values.
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
<ClientOnly>
|
|
66
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
67
|
+
<div id="placeholder" style="height:400px">
|
|
68
|
+
</div>
|
|
69
|
+
<script type="module">
|
|
70
|
+
import { Gantt } from "@hpcc-js/chart";
|
|
71
|
+
|
|
72
|
+
new Gantt()
|
|
73
|
+
.target("placeholder")
|
|
74
|
+
.columns(["Category", "Range"])
|
|
75
|
+
.data([
|
|
76
|
+
["A", [34, 90]],
|
|
77
|
+
["B", [55, 75]],
|
|
78
|
+
["A", [95, 120]],
|
|
79
|
+
["B", [85, 175]]
|
|
80
|
+
])
|
|
81
|
+
.render()
|
|
82
|
+
;
|
|
83
|
+
</script>
|
|
84
|
+
</hpcc-vitepress>
|
|
85
|
+
</ClientOnly>
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
For documentation on axis-specific properties, like those used in the below example, take a look at the [Axis Documentation](./XYAxis.md).
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
<ClientOnly>
|
|
92
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
93
|
+
<div id="placeholder" style="height:400px">
|
|
94
|
+
</div>
|
|
95
|
+
<script type="module">
|
|
96
|
+
import { Gantt } from "@hpcc-js/chart";
|
|
97
|
+
|
|
98
|
+
new Gantt()
|
|
99
|
+
.target("placeholder")
|
|
100
|
+
.columns(["Project", "Date Range"])
|
|
101
|
+
.data([
|
|
102
|
+
["Docs", ["2012-09-09", "2012-10-09"]],
|
|
103
|
+
["Coding", ["2011-08-09", "2012-09-09"]],
|
|
104
|
+
["Specs", ["2010-07-09", "2011-08-09"]]
|
|
105
|
+
])
|
|
106
|
+
.yAxisType("time")
|
|
107
|
+
.yAxisTypeTimePattern("%Y-%m-%d")
|
|
108
|
+
.render()
|
|
109
|
+
;
|
|
110
|
+
</script>
|
|
111
|
+
</hpcc-vitepress>
|
|
112
|
+
</ClientOnly>
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
## API
|
|
116
|
+
|
|
117
|
+
## Published Properties
|
|
118
|
+
```@hpcc-js/chart:Gantt
|
|
119
|
+
```
|
package/src/Gauge.md
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Gauge
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
A gauge chart displays a value between 0 and 1 as a percentage.
|
|
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 { Gauge } from "@hpcc-js/chart";
|
|
16
|
+
|
|
17
|
+
var gauge = new Gauge()
|
|
18
|
+
.target("placeholder")
|
|
19
|
+
.title("Example")
|
|
20
|
+
.value(.38)
|
|
21
|
+
.render()
|
|
22
|
+
;
|
|
23
|
+
</script>
|
|
24
|
+
</hpcc-vitepress>
|
|
25
|
+
</ClientOnly>
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
_tickValue_ can be used to display a point of interest. _showTick_ must be set to _true_ in order for the tick to be visible.
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
<ClientOnly>
|
|
32
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
33
|
+
<div id="placeholder" style="height:400px">
|
|
34
|
+
</div>
|
|
35
|
+
<script type="module">
|
|
36
|
+
import { Gauge } from "@hpcc-js/chart";
|
|
37
|
+
|
|
38
|
+
var gauge = new Gauge()
|
|
39
|
+
.target("placeholder")
|
|
40
|
+
.title("Gauge w/ Tick")
|
|
41
|
+
.value(.38)
|
|
42
|
+
.showTick(true)
|
|
43
|
+
.tickValue(.62)
|
|
44
|
+
.render()
|
|
45
|
+
;
|
|
46
|
+
</script>
|
|
47
|
+
</hpcc-vitepress>
|
|
48
|
+
</ClientOnly>
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
_titleDescription_, _valueDescription_ and _tickValueDescription_ can be used to specify hover text that displays while the cursor hovers the title, value or tick respectively.
|
|
52
|
+
|
|
53
|
+
<ClientOnly>
|
|
54
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
55
|
+
<div id="placeholder" style="height:400px">
|
|
56
|
+
</div>
|
|
57
|
+
<script type="module">
|
|
58
|
+
import { Gauge } from "@hpcc-js/chart";
|
|
59
|
+
|
|
60
|
+
var gauge = new Gauge()
|
|
61
|
+
.target("placeholder")
|
|
62
|
+
.title("Tick & Descriptions")
|
|
63
|
+
.titleDescription("My Title Description")
|
|
64
|
+
.value(.38)
|
|
65
|
+
.valueDescription("My Value Description")
|
|
66
|
+
.showTick(true)
|
|
67
|
+
.tickValue(.62)
|
|
68
|
+
.tickValueDescription("My Tick Description")
|
|
69
|
+
.render()
|
|
70
|
+
;
|
|
71
|
+
</script>
|
|
72
|
+
</hpcc-vitepress>
|
|
73
|
+
</ClientOnly>
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
Custom colors can be specified using two properties. _colorRange_ expects an array of valid css color style strings. _colorDomain_ expects an array of threshold values from 0 to 1. For the best results these two arrays should have the same number of elements.
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<ClientOnly>
|
|
80
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
81
|
+
<div id="placeholder" style="height:400px">
|
|
82
|
+
</div>
|
|
83
|
+
<script type="module">
|
|
84
|
+
import { Gauge } from "@hpcc-js/chart";
|
|
85
|
+
|
|
86
|
+
var gauge = new Gauge()
|
|
87
|
+
.target("placeholder")
|
|
88
|
+
.title("Custom Color Gauge")
|
|
89
|
+
.value(0)
|
|
90
|
+
.tickValue(0.5)
|
|
91
|
+
.showTick(true)
|
|
92
|
+
.colorDomain([0,0.25,0.5,0.75,1])
|
|
93
|
+
.colorRange(["#0000FF","dodgerblue","goldenrod","orange","rgb(255,0,0)"])
|
|
94
|
+
.emptyColor("#FFFFFF")
|
|
95
|
+
.tickColor("red")
|
|
96
|
+
.render()
|
|
97
|
+
;
|
|
98
|
+
|
|
99
|
+
setInterval(function () {
|
|
100
|
+
const v = gauge.value() + 0.25;
|
|
101
|
+
gauge
|
|
102
|
+
.value(v <= 1 ? v : 0)
|
|
103
|
+
.lazyRender()
|
|
104
|
+
;
|
|
105
|
+
}, 1000);
|
|
106
|
+
</script>
|
|
107
|
+
</hpcc-vitepress>
|
|
108
|
+
</ClientOnly>
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
When the values change, the gauge animates to display the new values.
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
<ClientOnly>
|
|
115
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
116
|
+
<div id="placeholder" style="height:400px">
|
|
117
|
+
</div>
|
|
118
|
+
<script type="module">
|
|
119
|
+
import { Gauge } from "@hpcc-js/chart";
|
|
120
|
+
|
|
121
|
+
var gauge = new Gauge()
|
|
122
|
+
.target("placeholder")
|
|
123
|
+
.title("My Gauge")
|
|
124
|
+
.titleDescription("@hpcc-js/chart")
|
|
125
|
+
.value(.66)
|
|
126
|
+
.valueDescription("Main")
|
|
127
|
+
.showTick(true)
|
|
128
|
+
.tickValue(.33)
|
|
129
|
+
.tickValueDescription("Average")
|
|
130
|
+
.render()
|
|
131
|
+
;
|
|
132
|
+
|
|
133
|
+
setInterval(function () {
|
|
134
|
+
gauge
|
|
135
|
+
.value(Math.random())
|
|
136
|
+
.tickValue(Math.random())
|
|
137
|
+
.lazyRender()
|
|
138
|
+
;
|
|
139
|
+
}, 3000);
|
|
140
|
+
</script>
|
|
141
|
+
</hpcc-vitepress>
|
|
142
|
+
</ClientOnly>
|
|
143
|
+
|
|
144
|
+
## API
|
|
145
|
+
|
|
146
|
+
## Published Properties
|
|
147
|
+
```@hpcc-js/chart:Gauge
|
|
148
|
+
```
|
package/src/HalfPie.md
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# HalfPie
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
[Pie](./Pie.md), HalfPie and [QuarterPie](./QuarterPie.md) 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 { HalfPie } from "@hpcc-js/chart";
|
|
15
|
+
|
|
16
|
+
new HalfPie()
|
|
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 { HalfPie } from "@hpcc-js/chart";
|
|
38
|
+
|
|
39
|
+
new HalfPie()
|
|
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
|
+
|
|
58
|
+
## API
|
|
59
|
+
|
|
60
|
+
## Published Properties
|
|
61
|
+
```@hpcc-js/chart:HalfPie
|
|
62
|
+
```
|
package/src/Heat.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# Heat
|
package/src/HexBin.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# HexBin
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
HexBin and [Contour](./Contour.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 { HexBin } from "@hpcc-js/chart";
|
|
16
|
+
|
|
17
|
+
new HexBin()
|
|
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
|
+
_binSize_ can be used to set the size of the hexagon bins. 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 { HexBin } from "@hpcc-js/chart";
|
|
45
|
+
|
|
46
|
+
let binSize = 5;
|
|
47
|
+
|
|
48
|
+
const widget = new HexBin()
|
|
49
|
+
.target("placeholder")
|
|
50
|
+
.columns(["X-Value", "Y-Value"])
|
|
51
|
+
.data(randomData(1000))
|
|
52
|
+
.xAxisType("linear")
|
|
53
|
+
.xAxisTickCount(10)
|
|
54
|
+
.binSize(binSize)
|
|
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 = 5;
|
|
65
|
+
setInterval(function(){
|
|
66
|
+
const next = binSize + interval;
|
|
67
|
+
if(next > 20 || next <= 0){
|
|
68
|
+
interval *= -1;
|
|
69
|
+
}
|
|
70
|
+
binSize += interval;
|
|
71
|
+
widget
|
|
72
|
+
.xAxisTitle("binSize = " + binSize)
|
|
73
|
+
.binSize(binSize)
|
|
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:HexBin
|
|
88
|
+
```
|
package/src/Line.md
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# Line
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
Line, [Area](./Area.md), [Scatter](./Scatter.md) and [Step](./Step.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 { Line } from "@hpcc-js/chart";
|
|
16
|
+
|
|
17
|
+
new Line()
|
|
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
|
+
Line 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 { Line } from "@hpcc-js/chart";
|
|
42
|
+
|
|
43
|
+
new Line()
|
|
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 { Line } from "@hpcc-js/chart";
|
|
74
|
+
|
|
75
|
+
new Line()
|
|
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
|
+
.render()
|
|
88
|
+
;
|
|
89
|
+
</script>
|
|
90
|
+
</hpcc-vitepress>
|
|
91
|
+
</ClientOnly>
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
_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).
|
|
95
|
+
|
|
96
|
+
_pointDarken_ can be set to 'false' to disable the slight darkening effect applied to each data point.
|
|
97
|
+
|
|
98
|
+
_xAxisDomainPadding_ can be used to reserve a percentage of the left and right edges for white space.
|
|
99
|
+
|
|
100
|
+
_showValue_ along with _valueBaseline("central")_ places the values at the center of each data point.
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
<ClientOnly>
|
|
104
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
105
|
+
<div id="placeholder" style="height:400px">
|
|
106
|
+
</div>
|
|
107
|
+
<script type="module">
|
|
108
|
+
import { Line } from "@hpcc-js/chart";
|
|
109
|
+
|
|
110
|
+
new Line()
|
|
111
|
+
.target("placeholder")
|
|
112
|
+
.columns(["Value 1", "Value 2"])
|
|
113
|
+
.data([
|
|
114
|
+
[144, 90],
|
|
115
|
+
[89, 50],
|
|
116
|
+
[55, 75],
|
|
117
|
+
[34, 66]
|
|
118
|
+
])
|
|
119
|
+
.paletteID("FlatUI_German")
|
|
120
|
+
.xAxisType("linear")
|
|
121
|
+
.xAxisDomainPadding(5)
|
|
122
|
+
.pointShape("rectangle")
|
|
123
|
+
.pointSize(20)
|
|
124
|
+
.pointDarken(false)
|
|
125
|
+
.showValue(true)
|
|
126
|
+
.valueBaseline("central")
|
|
127
|
+
.interpolate("monotone")
|
|
128
|
+
.render()
|
|
129
|
+
;
|
|
130
|
+
</script>
|
|
131
|
+
</hpcc-vitepress>
|
|
132
|
+
</ClientOnly>
|
|
133
|
+
|
|
134
|
+
For documentation on axis-specific properties, like those used in the below example, take a look at the [Axis Documentation](./XYAxis.md).
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
<ClientOnly>
|
|
138
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
139
|
+
<div id="placeholder" style="height:400px">
|
|
140
|
+
</div>
|
|
141
|
+
<script type="module">
|
|
142
|
+
import { Line } from "@hpcc-js/chart";
|
|
143
|
+
|
|
144
|
+
new Line()
|
|
145
|
+
.target("placeholder")
|
|
146
|
+
.columns(["Value 1", "Value 2"])
|
|
147
|
+
.data([
|
|
148
|
+
[144, 90],
|
|
149
|
+
[89, 50],
|
|
150
|
+
[55, 75],
|
|
151
|
+
[34, 66]
|
|
152
|
+
])
|
|
153
|
+
.xAxisType("linear")
|
|
154
|
+
.xAxisTitle("X-Axis Title")
|
|
155
|
+
.yAxisTitle("Y-Axis Title")
|
|
156
|
+
.xAxisTickCount(30)
|
|
157
|
+
.xAxisOverlapMode("rotate")
|
|
158
|
+
.xAxisLabelRotation(90)
|
|
159
|
+
.pointShape("circle")
|
|
160
|
+
.render()
|
|
161
|
+
;
|
|
162
|
+
</script>
|
|
163
|
+
</hpcc-vitepress>
|
|
164
|
+
</ClientOnly>
|
|
165
|
+
|
|
166
|
+
## API
|
|
167
|
+
|
|
168
|
+
## Published Properties
|
|
169
|
+
```@hpcc-js/chart:Line
|
|
170
|
+
```
|
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
|
+
```
|