@hpcc-js/chart 2.77.0 → 2.79.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.
@@ -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
+ ```
@@ -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
+ ```
@@ -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
+ ```