@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/StatChart.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# StatChart
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
StatChart displays a normal distribution of continuous data.
|
|
8
|
+
|
|
9
|
+
A single data row containing exactly 7 data points is required.
|
|
10
|
+
|
|
11
|
+
The _1st_ data point sets the lowest value in the set.
|
|
12
|
+
|
|
13
|
+
The _2nd_ data point sets the lower quartile (typically the average of the smallest half of values in the set).
|
|
14
|
+
|
|
15
|
+
The _3rd_ data point sets the middle quartile (typically the median value in the set).
|
|
16
|
+
|
|
17
|
+
The _4th_ data point sets the upper quartile (typically the average of the largest half of values in a set).
|
|
18
|
+
|
|
19
|
+
The _5th_ data point sets the largest value in the set.
|
|
20
|
+
|
|
21
|
+
The _6th_ data point sets the _mean_.
|
|
22
|
+
|
|
23
|
+
The _7th_ data point sets the _standardDeviation_.
|
|
24
|
+
|
|
25
|
+
<ClientOnly>
|
|
26
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
27
|
+
<div id="placeholder" style="height:400px">
|
|
28
|
+
</div>
|
|
29
|
+
<script type="module">
|
|
30
|
+
import { StatChart } from "@hpcc-js/chart";
|
|
31
|
+
|
|
32
|
+
new StatChart()
|
|
33
|
+
.data([
|
|
34
|
+
[34,55,89,144,233,90,20]
|
|
35
|
+
])
|
|
36
|
+
.target("placeholder")
|
|
37
|
+
.render()
|
|
38
|
+
;
|
|
39
|
+
</script>
|
|
40
|
+
</hpcc-vitepress>
|
|
41
|
+
</ClientOnly>
|
|
42
|
+
|
|
43
|
+
Alternatively, the _mean_ and _standardDeviation_ can be set via chained methods _AFTER_ the _data_ row has been set.
|
|
44
|
+
|
|
45
|
+
<ClientOnly>
|
|
46
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
47
|
+
<div id="placeholder" style="height:400px">
|
|
48
|
+
</div>
|
|
49
|
+
<script type="module">
|
|
50
|
+
import { StatChart } from "@hpcc-js/chart";
|
|
51
|
+
|
|
52
|
+
new StatChart()
|
|
53
|
+
.data([
|
|
54
|
+
[34,55,89,144,233]
|
|
55
|
+
])
|
|
56
|
+
.mean(90)
|
|
57
|
+
.standardDeviation(20)
|
|
58
|
+
.target("placeholder")
|
|
59
|
+
.render()
|
|
60
|
+
;
|
|
61
|
+
</script>
|
|
62
|
+
</hpcc-vitepress>
|
|
63
|
+
</ClientOnly>
|
|
64
|
+
|
|
65
|
+
_candleHeight_ controls the pixel height of the _QuartileCandlestick_ chart along the bottom.
|
|
66
|
+
|
|
67
|
+
_domainPadding_ controls the left and right padding of the interpolated _Scatter_ chart (bell curve) along the top.
|
|
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 { StatChart } from "@hpcc-js/chart";
|
|
75
|
+
|
|
76
|
+
new StatChart()
|
|
77
|
+
.data([
|
|
78
|
+
[34,55,89,144,233]
|
|
79
|
+
])
|
|
80
|
+
.mean(90)
|
|
81
|
+
.standardDeviation(20)
|
|
82
|
+
.candleHeight(50)
|
|
83
|
+
.domainPadding(100)
|
|
84
|
+
.target("placeholder")
|
|
85
|
+
.render()
|
|
86
|
+
;
|
|
87
|
+
</script>
|
|
88
|
+
</hpcc-vitepress>
|
|
89
|
+
</ClientOnly>
|
|
90
|
+
|
|
91
|
+
_tickFormat_ can be used to specify a d3 string formatting rule to be applied to the axis tick values (see: [Formatting](../../../docs/Getting%20Started/formatting.md))
|
|
92
|
+
|
|
93
|
+
<ClientOnly>
|
|
94
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
95
|
+
<div id="placeholder" style="height:400px">
|
|
96
|
+
</div>
|
|
97
|
+
<script type="module">
|
|
98
|
+
import { StatChart } from "@hpcc-js/chart";
|
|
99
|
+
|
|
100
|
+
new StatChart()
|
|
101
|
+
.target("placeholder")
|
|
102
|
+
.quartiles([34,55,89,144,233])
|
|
103
|
+
.mean(120)
|
|
104
|
+
.standardDeviation(130)
|
|
105
|
+
.tickFormat(".2s")
|
|
106
|
+
.render()
|
|
107
|
+
;
|
|
108
|
+
</script>
|
|
109
|
+
</hpcc-vitepress>
|
|
110
|
+
</ClientOnly>
|
|
111
|
+
|
|
112
|
+
## API
|
|
113
|
+
|
|
114
|
+
## Published Properties
|
|
115
|
+
|
|
116
|
+
```@hpcc-js/chart:StatChart
|
|
117
|
+
```
|
package/src/Step.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Step
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
Step, [Area](./Area.md), [Line](./Line.md) and [Scatter](./Scatter.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 { Step } from "@hpcc-js/chart";
|
|
15
|
+
|
|
16
|
+
new Step()
|
|
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
|
+
Step 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 { Step } from "@hpcc-js/chart";
|
|
39
|
+
|
|
40
|
+
new Step()
|
|
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 { Step } from "@hpcc-js/chart";
|
|
69
|
+
|
|
70
|
+
new Step()
|
|
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 { Step } from "@hpcc-js/chart";
|
|
103
|
+
|
|
104
|
+
new Step()
|
|
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 { Step } from "@hpcc-js/chart";
|
|
135
|
+
|
|
136
|
+
new Step()
|
|
137
|
+
.target("placeholder")
|
|
138
|
+
.columns(["Value 1", "Value 2"])
|
|
139
|
+
.data([
|
|
140
|
+
[144, 90],
|
|
141
|
+
[89, 50],
|
|
142
|
+
[55, 75],
|
|
143
|
+
[34, 66]
|
|
144
|
+
])
|
|
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:Step
|
|
163
|
+
```
|
package/src/Summary.md
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
# Summary
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
Summary is commonly used to emphasize significant data points within a dashboard. It requires _labelColumn_ and _valueColumn_ to be specified.
|
|
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 { Summary } from "@hpcc-js/chart";
|
|
15
|
+
|
|
16
|
+
new Summary()
|
|
17
|
+
.target("placeholder")
|
|
18
|
+
.columns(["Summary", "Score"])
|
|
19
|
+
.data([
|
|
20
|
+
["Cars", 128]
|
|
21
|
+
])
|
|
22
|
+
.labelColumn("Summary")
|
|
23
|
+
.valueColumn("Score")
|
|
24
|
+
.render()
|
|
25
|
+
;
|
|
26
|
+
</script>
|
|
27
|
+
</hpcc-vitepress>
|
|
28
|
+
</ClientOnly>
|
|
29
|
+
|
|
30
|
+
_icon_ can be set to an empty string to prevent the default icon from displaying.
|
|
31
|
+
|
|
32
|
+
_hideMoreWrapper_ can hide the 'more info' section.
|
|
33
|
+
|
|
34
|
+
_textFontSize_ can be used to set the label font size.
|
|
35
|
+
|
|
36
|
+
_headerFontSize_ can be used to set the value font size.
|
|
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 { Summary } from "@hpcc-js/chart";
|
|
44
|
+
|
|
45
|
+
new Summary()
|
|
46
|
+
.target("placeholder")
|
|
47
|
+
.columns(["Summary", "Score"])
|
|
48
|
+
.data([
|
|
49
|
+
["Cars", 128]
|
|
50
|
+
])
|
|
51
|
+
.labelColumn("Summary")
|
|
52
|
+
.valueColumn("Score")
|
|
53
|
+
.icon("")
|
|
54
|
+
.hideMoreWrapper(true)
|
|
55
|
+
.headerFontSize(120)
|
|
56
|
+
.textFontSize(20)
|
|
57
|
+
.render()
|
|
58
|
+
;
|
|
59
|
+
</script>
|
|
60
|
+
</hpcc-vitepress>
|
|
61
|
+
</ClientOnly>
|
|
62
|
+
|
|
63
|
+
_icon_ can also be used to specify a class to be given to the icon's html element. In the example below a FontAwesome class is assigned.
|
|
64
|
+
|
|
65
|
+
_colorFill_ sets the background color.
|
|
66
|
+
|
|
67
|
+
_colorStroke_ sets the text and icon color.
|
|
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 { Summary } from "@hpcc-js/chart";
|
|
75
|
+
|
|
76
|
+
new Summary()
|
|
77
|
+
.target("placeholder")
|
|
78
|
+
.columns(["Summary", "Score"])
|
|
79
|
+
.data([
|
|
80
|
+
["Users", 256]
|
|
81
|
+
])
|
|
82
|
+
.labelColumn("Summary")
|
|
83
|
+
.valueColumn("Score")
|
|
84
|
+
.icon("fa-users")
|
|
85
|
+
.colorFill("#eeeeee")
|
|
86
|
+
.colorStroke("#30336b")
|
|
87
|
+
.hideMoreWrapper(true)
|
|
88
|
+
.render()
|
|
89
|
+
;
|
|
90
|
+
</script>
|
|
91
|
+
</hpcc-vitepress>
|
|
92
|
+
</ClientOnly>
|
|
93
|
+
|
|
94
|
+
_moreIcon_ can be used to specify a class to be given to the 'more info' icon's html element. In the example below a FontAwesome class is assigned.
|
|
95
|
+
|
|
96
|
+
_moreText_ can be used to specify content for the 'more info' section.
|
|
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 { Summary } from "@hpcc-js/chart";
|
|
104
|
+
|
|
105
|
+
new Summary()
|
|
106
|
+
.target("placeholder")
|
|
107
|
+
.columns(["Summary", "Score"])
|
|
108
|
+
.data([
|
|
109
|
+
["Users", 256]
|
|
110
|
+
])
|
|
111
|
+
.labelColumn("Summary")
|
|
112
|
+
.valueColumn("Score")
|
|
113
|
+
.icon("fa-users")
|
|
114
|
+
.colorFill("#eeeeee")
|
|
115
|
+
.colorStroke("#30336b")
|
|
116
|
+
.moreIcon("fa-user-md")
|
|
117
|
+
.moreText("32 doctors")
|
|
118
|
+
.render()
|
|
119
|
+
;
|
|
120
|
+
</script>
|
|
121
|
+
</hpcc-vitepress>
|
|
122
|
+
</ClientOnly>
|
|
123
|
+
|
|
124
|
+
_moreIcon_ can also be set to an empty string to prevent the default icon from displaying.
|
|
125
|
+
|
|
126
|
+
If _moreTextHTML_ is set to _true_ then the content within _moreText_ will be rendered as HTML.
|
|
127
|
+
|
|
128
|
+
<ClientOnly>
|
|
129
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
130
|
+
<div id="placeholder" style="height:400px">
|
|
131
|
+
</div>
|
|
132
|
+
<script type="module">
|
|
133
|
+
import { Summary } from "@hpcc-js/chart";
|
|
134
|
+
|
|
135
|
+
new Summary()
|
|
136
|
+
.target("placeholder")
|
|
137
|
+
.columns(["Summary", "Score"])
|
|
138
|
+
.data([
|
|
139
|
+
["Tweets", 512]
|
|
140
|
+
])
|
|
141
|
+
.labelColumn("Summary")
|
|
142
|
+
.valueColumn("Score")
|
|
143
|
+
.icon("fa-twitter")
|
|
144
|
+
.colorFill("#eeeeee")
|
|
145
|
+
.colorStroke("#30336b")
|
|
146
|
+
.moreIcon("")
|
|
147
|
+
.moreText("<button onclick=\"alert('More info here')\">Click for more info</button>")
|
|
148
|
+
.moreTextHTML(true)
|
|
149
|
+
.render()
|
|
150
|
+
;
|
|
151
|
+
</script>
|
|
152
|
+
</hpcc-vitepress>
|
|
153
|
+
</ClientOnly>
|
|
154
|
+
|
|
155
|
+
_playInterval_ can be used to cycle through multiple data rows. In the below example the play interval is set to 2000 milliseconds (two seconds).
|
|
156
|
+
|
|
157
|
+
<ClientOnly>
|
|
158
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
159
|
+
<div id="placeholder" style="height:400px">
|
|
160
|
+
</div>
|
|
161
|
+
<script type="module">
|
|
162
|
+
import { Summary } from "@hpcc-js/chart";
|
|
163
|
+
|
|
164
|
+
new Summary()
|
|
165
|
+
.target("placeholder")
|
|
166
|
+
.columns(["Summary", "Score"])
|
|
167
|
+
.data([
|
|
168
|
+
["Cars", 128],
|
|
169
|
+
["Trucks", 64]
|
|
170
|
+
])
|
|
171
|
+
.labelColumn("Summary")
|
|
172
|
+
.valueColumn("Score")
|
|
173
|
+
.icon("")
|
|
174
|
+
.hideMoreWrapper(true)
|
|
175
|
+
.headerFontSize(120)
|
|
176
|
+
.textFontSize(20)
|
|
177
|
+
.playInterval(2000)
|
|
178
|
+
.render()
|
|
179
|
+
;
|
|
180
|
+
</script>
|
|
181
|
+
</hpcc-vitepress>
|
|
182
|
+
</ClientOnly>
|
|
183
|
+
|
|
184
|
+
_iconColumn_, _moreIconColumn_, _moreTextColumn_, _colorFillColumn_ and _colorStrokeColumn_ can be set to designate data row columns for these properties. This allows the properties to change for each data row.
|
|
185
|
+
|
|
186
|
+
<ClientOnly>
|
|
187
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
188
|
+
<div id="placeholder" style="height:400px">
|
|
189
|
+
</div>
|
|
190
|
+
<script type="module">
|
|
191
|
+
import { Summary } from "@hpcc-js/chart";
|
|
192
|
+
|
|
193
|
+
new Summary()
|
|
194
|
+
.target("placeholder")
|
|
195
|
+
.columns(["Summary", "Score", "Icon", "MoreIcon", "Details", "Background", "TextColor"])
|
|
196
|
+
.data([
|
|
197
|
+
["Cars", 128, "fa-automobile", "fa-truck", "64 Trucks", "grey", "black"],
|
|
198
|
+
["Cold days", 256, "fa-thermometer-empty", "fa-thermometer", "16 Hot days", "#30336b", "white"]
|
|
199
|
+
])
|
|
200
|
+
.labelColumn("Summary")
|
|
201
|
+
.valueColumn("Score")
|
|
202
|
+
.iconColumn("Icon")
|
|
203
|
+
.moreTextColumn("Details")
|
|
204
|
+
.moreIconColumn("MoreIcon")
|
|
205
|
+
.colorFillColumn("Background")
|
|
206
|
+
.colorStrokeColumn("TextColor")
|
|
207
|
+
.playInterval(2000)
|
|
208
|
+
.render()
|
|
209
|
+
;
|
|
210
|
+
</script>
|
|
211
|
+
</hpcc-vitepress>
|
|
212
|
+
</ClientOnly>
|
|
213
|
+
|
|
214
|
+
## API
|
|
215
|
+
|
|
216
|
+
## Published Properties
|
|
217
|
+
|
|
218
|
+
```@hpcc-js/chart:Summary
|
|
219
|
+
```
|
package/src/SummaryC.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# SummaryC
|
|
2
|
+
|
|
3
|
+
<!--meta
|
|
4
|
+
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
SummaryC is commonly used to emphasize significant data points within a dashboard. It requires _labelColumn_ and _valueColumn_ to be specified.
|
|
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 { SummaryC } from "@hpcc-js/chart";
|
|
15
|
+
|
|
16
|
+
new SummaryC()
|
|
17
|
+
.target("placeholder")
|
|
18
|
+
.columns(["Summary", "Score"])
|
|
19
|
+
.data([
|
|
20
|
+
["Cars", 128]
|
|
21
|
+
])
|
|
22
|
+
.labelColumn("Summary")
|
|
23
|
+
.valueColumn("Score")
|
|
24
|
+
.render()
|
|
25
|
+
;
|
|
26
|
+
</script>
|
|
27
|
+
</hpcc-vitepress>
|
|
28
|
+
</ClientOnly>
|
|
29
|
+
|
|
30
|
+
_icon_ can be set to an empty string to prevent the default icon from displaying.
|
|
31
|
+
|
|
32
|
+
_fontSizeRatio_ can be used to set the font size ration between the value size and the label size.
|
|
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 { SummaryC } from "@hpcc-js/chart";
|
|
40
|
+
|
|
41
|
+
new SummaryC()
|
|
42
|
+
.target("placeholder")
|
|
43
|
+
.columns(["Summary", "Score"])
|
|
44
|
+
.data([
|
|
45
|
+
["Cars", 128]
|
|
46
|
+
])
|
|
47
|
+
.labelColumn("Summary")
|
|
48
|
+
.valueColumn("Score")
|
|
49
|
+
.icon("")
|
|
50
|
+
.fontSizeRatio(0.38)
|
|
51
|
+
.render()
|
|
52
|
+
;
|
|
53
|
+
</script>
|
|
54
|
+
</hpcc-vitepress>
|
|
55
|
+
</ClientOnly>
|
|
56
|
+
|
|
57
|
+
_icon_ can also be used to assign a FontAwesome icon by class.
|
|
58
|
+
|
|
59
|
+
_iconSizeRatio_ can be used to control the icon's size relative to the overall height.
|
|
60
|
+
|
|
61
|
+
_colorFill_ sets the background color.
|
|
62
|
+
|
|
63
|
+
_colorStroke_ sets the text and icon color.
|
|
64
|
+
|
|
65
|
+
_iconBaseline_ controls the vertical placement of the icon.
|
|
66
|
+
|
|
67
|
+
<ClientOnly>
|
|
68
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
69
|
+
<div id="placeholder" style="height:400px">
|
|
70
|
+
</div>
|
|
71
|
+
<script type="module">
|
|
72
|
+
import { SummaryC } from "@hpcc-js/chart";
|
|
73
|
+
|
|
74
|
+
new SummaryC()
|
|
75
|
+
.target("placeholder")
|
|
76
|
+
.columns(["Summary", "Score"])
|
|
77
|
+
.data([
|
|
78
|
+
["Users", 256]
|
|
79
|
+
])
|
|
80
|
+
.labelColumn("Summary")
|
|
81
|
+
.valueColumn("Score")
|
|
82
|
+
.icon("fa-users")
|
|
83
|
+
.colorFill("#eeeeee")
|
|
84
|
+
.colorStroke("#30336b")
|
|
85
|
+
.iconSizeRatio(0.5)
|
|
86
|
+
.iconBaseline("middle")
|
|
87
|
+
.render()
|
|
88
|
+
;
|
|
89
|
+
</script>
|
|
90
|
+
</hpcc-vitepress>
|
|
91
|
+
</ClientOnly>
|
|
92
|
+
|
|
93
|
+
_playInterval_ can be used to cycle through multiple data rows. In the below example the play interval is set to 2000 milliseconds (two seconds).
|
|
94
|
+
|
|
95
|
+
<ClientOnly>
|
|
96
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
97
|
+
<div id="placeholder" style="height:400px">
|
|
98
|
+
</div>
|
|
99
|
+
<script type="module">
|
|
100
|
+
import { SummaryC } from "@hpcc-js/chart";
|
|
101
|
+
|
|
102
|
+
new SummaryC()
|
|
103
|
+
.target("placeholder")
|
|
104
|
+
.columns(["Summary", "Score", "Icon"])
|
|
105
|
+
.data([
|
|
106
|
+
["Cars", 128, "fa-automobile"],
|
|
107
|
+
["Trucks", 64, "fa-truck"]
|
|
108
|
+
])
|
|
109
|
+
.labelColumn("Summary")
|
|
110
|
+
.valueColumn("Score")
|
|
111
|
+
.iconColumn("Icon")
|
|
112
|
+
.playInterval(2000)
|
|
113
|
+
.render()
|
|
114
|
+
;
|
|
115
|
+
</script>
|
|
116
|
+
</hpcc-vitepress>
|
|
117
|
+
</ClientOnly>
|
|
118
|
+
|
|
119
|
+
_iconColumn_, _colorFillColumn_ and _colorStrokeColumn_ can be set to designate data row columns for these properties. This allows the properties to change for each data row.
|
|
120
|
+
|
|
121
|
+
<ClientOnly>
|
|
122
|
+
<hpcc-vitepress style="width:100%;height:600px">
|
|
123
|
+
<div id="placeholder" style="height:400px">
|
|
124
|
+
</div>
|
|
125
|
+
<script type="module">
|
|
126
|
+
import { SummaryC } from "@hpcc-js/chart";
|
|
127
|
+
|
|
128
|
+
new SummaryC()
|
|
129
|
+
.target("placeholder")
|
|
130
|
+
.columns(["Summary", "Score", "Icon", "Background", "TextColor"])
|
|
131
|
+
.data([
|
|
132
|
+
["Cold days", 56, "fa-thermometer-0", "#95a5a6", "#34495e"],
|
|
133
|
+
["Cool days", 120, "fa-thermometer-1", "white", "#2980b9"],
|
|
134
|
+
["Warm days", 130, "fa-thermometer-2", "#f1c40f", "#d35400"],
|
|
135
|
+
["Hot days", 59, "fa-thermometer-3", "#c0392b", "#ecf0f1"]
|
|
136
|
+
])
|
|
137
|
+
.labelColumn("Summary")
|
|
138
|
+
.valueColumn("Score")
|
|
139
|
+
.iconColumn("Icon")
|
|
140
|
+
.colorFillColumn("Background")
|
|
141
|
+
.colorStrokeColumn("TextColor")
|
|
142
|
+
.playInterval(2000)
|
|
143
|
+
.render()
|
|
144
|
+
;
|
|
145
|
+
</script>
|
|
146
|
+
</hpcc-vitepress>
|
|
147
|
+
</ClientOnly>
|
|
148
|
+
|
|
149
|
+
## API
|
|
150
|
+
|
|
151
|
+
## Published Properties
|
|
152
|
+
|
|
153
|
+
```@hpcc-js/chart:SummaryC
|
|
154
|
+
```
|