playbook_ui 15.1.0.pre.rc.3 → 15.1.0.pre.rc.4
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.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +2 -0
- data/app/pb_kits/playbook/pb_card/_card.scss +12 -4
- data/app/pb_kits/playbook/pb_card/_card.tsx +3 -3
- data/app/pb_kits/playbook/pb_card/_card_mixin.scss +10 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.html.erb +3 -0
- data/app/pb_kits/playbook/pb_card/docs/_card_highlight.jsx +8 -0
- data/app/pb_kits/playbook/pb_icon_button/_icon_button.tsx +1 -0
- data/app/pb_kits/playbook/pb_icon_button/icon_button.html.erb +2 -1
- data/app/pb_kits/playbook/pb_nav/_item.tsx +19 -5
- data/app/pb_kits/playbook/pb_nav/item.html.erb +6 -2
- data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.scss +3 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/_pb_circle_chart.tsx +62 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.html.erb +31 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_block_content.jsx +81 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.html.erb +25 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.jsx +40 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_color_overrides.md +5 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.html.erb +27 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.jsx +39 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_custom_tooltip.md +5 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.html.erb +93 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.jsx +131 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_legend_position.md +14 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.html.erb +42 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_labels.jsx +58 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.html.erb +24 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_data_with_legend.jsx +38 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.html.erb +22 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_default.jsx +33 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.html.erb +118 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_inner_sizes.jsx +144 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_live_data.jsx +60 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.html.erb +24 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_rounded.jsx +42 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.html.erb +38 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_pb_circle_chart_with_title.jsx +52 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/example.yml +29 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/index.js +11 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/pbCircleChartTheme.ts +88 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.html.erb +1 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.rb +28 -0
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx +51 -0
- data/dist/chunks/{_line_graph-BBny-YYZ.js → _line_graph-CUfJ7E4h.js} +1 -1
- data/dist/chunks/{_typeahead-CeyJ6-GF.js → _typeahead-DCp1lVJx.js} +1 -1
- data/dist/chunks/{_weekday_stacked-CUUNTwVc.js → _weekday_stacked-YwRTPuBs.js} +2 -2
- data/dist/chunks/vendor.js +1 -1
- data/dist/menu.yml +6 -0
- data/dist/playbook-doc.js +2 -2
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/forms/builder/form_field_builder.rb +28 -1
- data/lib/playbook/version.rb +1 -1
- metadata +37 -5
@@ -0,0 +1,131 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { PbCircleChart, Title } from "playbook-ui";
|
3
|
+
|
4
|
+
const dataFirst = [
|
5
|
+
{
|
6
|
+
name: 'Waiting for Calls',
|
7
|
+
y: 41,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
name: 'On Call',
|
11
|
+
y: 49,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
name: 'After Call',
|
15
|
+
y: 10,
|
16
|
+
},
|
17
|
+
]
|
18
|
+
|
19
|
+
const dataSecond = [{
|
20
|
+
name: 'Bugs',
|
21
|
+
y: 8,
|
22
|
+
},
|
23
|
+
{
|
24
|
+
name: 'Chores',
|
25
|
+
y: 1,
|
26
|
+
},
|
27
|
+
{
|
28
|
+
name: 'Stories',
|
29
|
+
y: 12,
|
30
|
+
}]
|
31
|
+
|
32
|
+
const dataThird = [
|
33
|
+
{
|
34
|
+
name: 'Queued',
|
35
|
+
y: 7,
|
36
|
+
},
|
37
|
+
{
|
38
|
+
name: 'In Progress',
|
39
|
+
y: 6,
|
40
|
+
},
|
41
|
+
{
|
42
|
+
name: 'Validation',
|
43
|
+
y: 3,
|
44
|
+
},
|
45
|
+
{
|
46
|
+
name: 'Done',
|
47
|
+
y: 6,
|
48
|
+
},
|
49
|
+
]
|
50
|
+
|
51
|
+
|
52
|
+
const PbCircleChartDataLegendPosition = (props) => {
|
53
|
+
const chartOptionsFirst = {
|
54
|
+
title: { text: "Alignment of Legend" },
|
55
|
+
series: [{ data: dataFirst }],
|
56
|
+
legend: {
|
57
|
+
align: 'right',
|
58
|
+
verticalAlign: 'top'
|
59
|
+
},
|
60
|
+
plotOptions: {
|
61
|
+
pie: {
|
62
|
+
showInLegend: true
|
63
|
+
}
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
const chartOptionsSecond = {
|
68
|
+
title: { text: "Layout of Legend" },
|
69
|
+
series: [{ data: dataSecond }],
|
70
|
+
legend: {
|
71
|
+
layout: 'vertical'
|
72
|
+
},
|
73
|
+
plotOptions: {
|
74
|
+
pie: {
|
75
|
+
showInLegend: true
|
76
|
+
}
|
77
|
+
}
|
78
|
+
}
|
79
|
+
|
80
|
+
const chartOptionsThird = {
|
81
|
+
title: { text: "Offset of Legend" },
|
82
|
+
series: [{ data: dataThird }],
|
83
|
+
legend: {
|
84
|
+
layout: 'vertical',
|
85
|
+
x: 100,
|
86
|
+
y: 10
|
87
|
+
},
|
88
|
+
plotOptions: {
|
89
|
+
pie: {
|
90
|
+
showInLegend: true
|
91
|
+
}
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
return (
|
96
|
+
<div>
|
97
|
+
<Title
|
98
|
+
paddingY="sm"
|
99
|
+
size={4}
|
100
|
+
tag="h4"
|
101
|
+
text="align | verticalAlign"
|
102
|
+
/>
|
103
|
+
<PbCircleChart
|
104
|
+
options={chartOptionsFirst}
|
105
|
+
{...props}
|
106
|
+
/>
|
107
|
+
<Title
|
108
|
+
paddingY="sm"
|
109
|
+
size={4}
|
110
|
+
tag="h4"
|
111
|
+
text="layout"
|
112
|
+
/>
|
113
|
+
<PbCircleChart
|
114
|
+
options={chartOptionsSecond}
|
115
|
+
{...props}
|
116
|
+
/>
|
117
|
+
<Title
|
118
|
+
paddingY="sm"
|
119
|
+
size={4}
|
120
|
+
tag="h4"
|
121
|
+
text="x | y"
|
122
|
+
/>
|
123
|
+
<PbCircleChart
|
124
|
+
options={chartOptionsThird}
|
125
|
+
{...props}
|
126
|
+
/>
|
127
|
+
</div>
|
128
|
+
);
|
129
|
+
}
|
130
|
+
|
131
|
+
export default PbCircleChartDataLegendPosition;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Layout options from Highcharts:
|
2
|
+
|
3
|
+
`align` **Type**: String | **Values**: left | center | right (defaults to center)
|
4
|
+
`verticalAlign` **Type**: String | **Values**: top | middle | bottom (defaults to bottom)
|
5
|
+
`layout` **Type**: String | **Values**: horizontal | vertical | proximate (defaults to horizontal)
|
6
|
+
`x` **Type**: Number (defaults to 0)
|
7
|
+
`y` **Type**: Number (defaults to 0)
|
8
|
+
|
9
|
+
`layout` determines the position of the legend items
|
10
|
+
`layout: proximate` will place the legend items as close as possible to the graphs they're representing. It will also determine whether to place the legend above/below or on the side of the plot area, if the legend is in a corner.
|
11
|
+
|
12
|
+
`x` offsets the legend relative to its horizontal alignment. Negative x moves it to the left, positive x moves it to the right
|
13
|
+
|
14
|
+
`y` offsets the legend relative to its vertical alignment. Negative y moves it up, positive y moves it down.
|
@@ -0,0 +1,42 @@
|
|
1
|
+
<% data = [
|
2
|
+
{
|
3
|
+
name: "Facebook",
|
4
|
+
y: 2498,
|
5
|
+
},
|
6
|
+
{
|
7
|
+
name: "YouTube",
|
8
|
+
y: 2000,
|
9
|
+
},
|
10
|
+
{
|
11
|
+
name: "WhatsApp",
|
12
|
+
y: 2000,
|
13
|
+
},
|
14
|
+
{
|
15
|
+
name: "Facebook Messenger",
|
16
|
+
y: 1300,
|
17
|
+
},
|
18
|
+
{
|
19
|
+
name: "WeChat",
|
20
|
+
y: 1165,
|
21
|
+
},
|
22
|
+
{
|
23
|
+
name: "Instagram",
|
24
|
+
y: 1000,
|
25
|
+
},
|
26
|
+
{
|
27
|
+
name: "Tik Tok",
|
28
|
+
y: 800,
|
29
|
+
},] %>
|
30
|
+
|
31
|
+
<% chart_options = {
|
32
|
+
series: [{ data: data }],
|
33
|
+
plotOptions: {
|
34
|
+
pie: {
|
35
|
+
dataLabels: {
|
36
|
+
enabled: true,
|
37
|
+
},
|
38
|
+
},
|
39
|
+
},
|
40
|
+
} %>
|
41
|
+
|
42
|
+
<%= pb_rails("pb_circle_chart", props: { options: chart_options }) %>
|
@@ -0,0 +1,58 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { PbCircleChart } from "playbook-ui";
|
3
|
+
|
4
|
+
const data = [
|
5
|
+
{
|
6
|
+
name: "Facebook",
|
7
|
+
y: 2498,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
name: "YouTube",
|
11
|
+
y: 2000,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
name: "WhatsApp",
|
15
|
+
y: 2000,
|
16
|
+
},
|
17
|
+
{
|
18
|
+
name: "Facebook Messenger",
|
19
|
+
y: 1300,
|
20
|
+
},
|
21
|
+
{
|
22
|
+
name: "WeChat",
|
23
|
+
y: 1165,
|
24
|
+
},
|
25
|
+
{
|
26
|
+
name: "Instagram",
|
27
|
+
y: 1000,
|
28
|
+
},
|
29
|
+
{
|
30
|
+
name: "Tik Tok",
|
31
|
+
y: 800,
|
32
|
+
},
|
33
|
+
];
|
34
|
+
|
35
|
+
|
36
|
+
const PbCircleChartDataWithLabels = (props) => {
|
37
|
+
const chartOptions = {
|
38
|
+
series: [{ data: data }],
|
39
|
+
plotOptions: {
|
40
|
+
pie: {
|
41
|
+
dataLabels: {
|
42
|
+
enabled: true,
|
43
|
+
},
|
44
|
+
},
|
45
|
+
},
|
46
|
+
};
|
47
|
+
|
48
|
+
return (
|
49
|
+
<div>
|
50
|
+
<PbCircleChart
|
51
|
+
options={chartOptions}
|
52
|
+
{...props}
|
53
|
+
/>
|
54
|
+
</div>
|
55
|
+
);
|
56
|
+
}
|
57
|
+
|
58
|
+
export default PbCircleChartDataWithLabels;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<% data = [
|
2
|
+
{
|
3
|
+
name: 'Bugs',
|
4
|
+
y: 8,
|
5
|
+
},
|
6
|
+
{
|
7
|
+
name: 'Chores',
|
8
|
+
y: 1,
|
9
|
+
},
|
10
|
+
{
|
11
|
+
name: 'Stories',
|
12
|
+
y: 12,
|
13
|
+
}] %>
|
14
|
+
|
15
|
+
<% chart_options = {
|
16
|
+
series: [{ data: data }],
|
17
|
+
plotOptions: {
|
18
|
+
pie: {
|
19
|
+
showInLegend: true,
|
20
|
+
},
|
21
|
+
},
|
22
|
+
} %>
|
23
|
+
|
24
|
+
<%= pb_rails("pb_circle_chart", props: { options: chart_options }) %>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { PbCircleChart } from "playbook-ui";
|
3
|
+
|
4
|
+
const data = [{
|
5
|
+
name: 'Bugs',
|
6
|
+
y: 8,
|
7
|
+
},
|
8
|
+
{
|
9
|
+
name: 'Chores',
|
10
|
+
y: 1,
|
11
|
+
},
|
12
|
+
{
|
13
|
+
name: 'Stories',
|
14
|
+
y: 12,
|
15
|
+
}]
|
16
|
+
|
17
|
+
|
18
|
+
const PbCircleChartDataWithLegend = (props) => {
|
19
|
+
const chartOptions = {
|
20
|
+
series: [{ data: data }],
|
21
|
+
plotOptions: {
|
22
|
+
pie: {
|
23
|
+
showInLegend: true,
|
24
|
+
},
|
25
|
+
},
|
26
|
+
};
|
27
|
+
|
28
|
+
return (
|
29
|
+
<div>
|
30
|
+
<PbCircleChart
|
31
|
+
options={chartOptions}
|
32
|
+
{...props}
|
33
|
+
/>
|
34
|
+
</div>
|
35
|
+
);
|
36
|
+
}
|
37
|
+
|
38
|
+
export default PbCircleChartDataWithLegend;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
<% chart_options = {
|
2
|
+
series: [
|
3
|
+
{
|
4
|
+
data: [
|
5
|
+
{
|
6
|
+
name: "Waiting for Calls",
|
7
|
+
y: 41,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
name: "On Call",
|
11
|
+
y: 49,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
name: "After Call",
|
15
|
+
y: 10,
|
16
|
+
},
|
17
|
+
],
|
18
|
+
},
|
19
|
+
],
|
20
|
+
} %>
|
21
|
+
|
22
|
+
<%= pb_rails("pb_circle_chart", props: { options: chart_options }) %>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { PbCircleChart } from "playbook-ui";
|
3
|
+
|
4
|
+
const chartOptions = {
|
5
|
+
series: [
|
6
|
+
{
|
7
|
+
data: [
|
8
|
+
{
|
9
|
+
name: "Waiting for Calls",
|
10
|
+
y: 41,
|
11
|
+
},
|
12
|
+
{
|
13
|
+
name: "On Call",
|
14
|
+
y: 49,
|
15
|
+
},
|
16
|
+
{
|
17
|
+
name: "After Call",
|
18
|
+
y: 10,
|
19
|
+
},
|
20
|
+
],
|
21
|
+
},
|
22
|
+
],
|
23
|
+
};
|
24
|
+
const PbCircleChartDefault = (props) => (
|
25
|
+
<div>
|
26
|
+
<PbCircleChart
|
27
|
+
options={chartOptions}
|
28
|
+
{...props}
|
29
|
+
/>
|
30
|
+
</div>
|
31
|
+
);
|
32
|
+
|
33
|
+
export default PbCircleChartDefault;
|
@@ -0,0 +1,118 @@
|
|
1
|
+
<% data_first = [
|
2
|
+
{
|
3
|
+
name: 'Bugs',
|
4
|
+
y: 8,
|
5
|
+
},
|
6
|
+
{
|
7
|
+
name: 'Chores',
|
8
|
+
y: 1,
|
9
|
+
},
|
10
|
+
{
|
11
|
+
name: 'Stories',
|
12
|
+
y: 12,
|
13
|
+
},
|
14
|
+
] %>
|
15
|
+
|
16
|
+
<% data_second = [
|
17
|
+
{
|
18
|
+
name: 'Queued',
|
19
|
+
y: 7,
|
20
|
+
},
|
21
|
+
{
|
22
|
+
name: 'In Progress',
|
23
|
+
y: 6,
|
24
|
+
},
|
25
|
+
{
|
26
|
+
name: 'Validation',
|
27
|
+
y: 3,
|
28
|
+
},
|
29
|
+
{
|
30
|
+
name: 'Done',
|
31
|
+
y: 6,
|
32
|
+
},
|
33
|
+
] %>
|
34
|
+
|
35
|
+
<% data_third = [
|
36
|
+
{
|
37
|
+
name: '1 Point Tickets',
|
38
|
+
y: 2,
|
39
|
+
},
|
40
|
+
{
|
41
|
+
name: '3 Point Tickets',
|
42
|
+
y: 5,
|
43
|
+
},
|
44
|
+
{
|
45
|
+
name: '5 Point Tickets',
|
46
|
+
y: 6,
|
47
|
+
},
|
48
|
+
{
|
49
|
+
name: '8 Point Tickets',
|
50
|
+
y: 3,
|
51
|
+
},
|
52
|
+
{
|
53
|
+
name: '13 Point Tickets',
|
54
|
+
y: 1,
|
55
|
+
},
|
56
|
+
] %>
|
57
|
+
|
58
|
+
<% data_fourth = [
|
59
|
+
{
|
60
|
+
name: 'Facebook',
|
61
|
+
y: 2498,
|
62
|
+
},
|
63
|
+
{
|
64
|
+
name: 'YouTube',
|
65
|
+
y: 2000,
|
66
|
+
},
|
67
|
+
{
|
68
|
+
name: 'WhatsApp',
|
69
|
+
y: 2000,
|
70
|
+
},
|
71
|
+
{
|
72
|
+
name: 'Facebook Messenger',
|
73
|
+
y: 1300,
|
74
|
+
},
|
75
|
+
{
|
76
|
+
name: 'WeChat',
|
77
|
+
y: 1165,
|
78
|
+
},
|
79
|
+
{
|
80
|
+
name: 'Instagram',
|
81
|
+
y: 1000,
|
82
|
+
},
|
83
|
+
{
|
84
|
+
name: 'Tik Tok',
|
85
|
+
y: 800,
|
86
|
+
},
|
87
|
+
] %>
|
88
|
+
|
89
|
+
<% chart_options_small = {
|
90
|
+
series: [{
|
91
|
+
data: data_first,
|
92
|
+
innerSize: '35%'
|
93
|
+
}], } %>
|
94
|
+
|
95
|
+
<% chart_options_md = {
|
96
|
+
series: [{
|
97
|
+
data: data_second,
|
98
|
+
innerSize: '50%'
|
99
|
+
}], } %>
|
100
|
+
|
101
|
+
<% chart_options_lg = {
|
102
|
+
series: [{
|
103
|
+
data: data_third,
|
104
|
+
innerSize: '85%'
|
105
|
+
}], } %>
|
106
|
+
|
107
|
+
<% chart_options_xl = {
|
108
|
+
series: [{
|
109
|
+
data: data_fourth,
|
110
|
+
innerSize: '0%'
|
111
|
+
}], } %>
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<%= pb_rails("pb_circle_chart", props: { options: chart_options_small }) %>
|
116
|
+
<%= pb_rails("pb_circle_chart", props: { options: chart_options_md }) %>
|
117
|
+
<%= pb_rails("pb_circle_chart", props: { options: chart_options_lg }) %>
|
118
|
+
<%= pb_rails("pb_circle_chart", props: { options: chart_options_xl }) %>
|
@@ -0,0 +1,144 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { PbCircleChart } from "playbook-ui";
|
3
|
+
|
4
|
+
const dataFirst = [
|
5
|
+
{
|
6
|
+
name: 'Bugs',
|
7
|
+
y: 8,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
name: 'Chores',
|
11
|
+
y: 1,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
name: 'Stories',
|
15
|
+
y: 12,
|
16
|
+
},
|
17
|
+
]
|
18
|
+
|
19
|
+
const dataSecond = [
|
20
|
+
{
|
21
|
+
name: 'Queued',
|
22
|
+
y: 7,
|
23
|
+
},
|
24
|
+
{
|
25
|
+
name: 'In Progress',
|
26
|
+
y: 6,
|
27
|
+
},
|
28
|
+
{
|
29
|
+
name: 'Validation',
|
30
|
+
y: 3,
|
31
|
+
},
|
32
|
+
{
|
33
|
+
name: 'Done',
|
34
|
+
y: 6,
|
35
|
+
},
|
36
|
+
]
|
37
|
+
|
38
|
+
const dataThird = [
|
39
|
+
{
|
40
|
+
name: '1 Point Tickets',
|
41
|
+
y: 2,
|
42
|
+
},
|
43
|
+
{
|
44
|
+
name: '3 Point Tickets',
|
45
|
+
y: 5,
|
46
|
+
},
|
47
|
+
{
|
48
|
+
name: '5 Point Tickets',
|
49
|
+
y: 6,
|
50
|
+
},
|
51
|
+
{
|
52
|
+
name: '8 Point Tickets',
|
53
|
+
y: 3,
|
54
|
+
},
|
55
|
+
{
|
56
|
+
name: '13 Point Tickets',
|
57
|
+
y: 1,
|
58
|
+
},
|
59
|
+
]
|
60
|
+
|
61
|
+
const dataFourth = [
|
62
|
+
{
|
63
|
+
name: 'Facebook',
|
64
|
+
y: 2498,
|
65
|
+
},
|
66
|
+
{
|
67
|
+
name: 'YouTube',
|
68
|
+
y: 2000,
|
69
|
+
},
|
70
|
+
{
|
71
|
+
name: 'WhatsApp',
|
72
|
+
y: 2000,
|
73
|
+
},
|
74
|
+
{
|
75
|
+
name: 'Facebook Messenger',
|
76
|
+
y: 1300,
|
77
|
+
},
|
78
|
+
{
|
79
|
+
name: 'WeChat',
|
80
|
+
y: 1165,
|
81
|
+
},
|
82
|
+
{
|
83
|
+
name: 'Instagram',
|
84
|
+
y: 1000,
|
85
|
+
},
|
86
|
+
{
|
87
|
+
name: 'Tik Tok',
|
88
|
+
y: 800,
|
89
|
+
},
|
90
|
+
]
|
91
|
+
|
92
|
+
const PbCircleChartInnerSizes= (props) => {
|
93
|
+
const chartOptionsSmall = {
|
94
|
+
series: [{
|
95
|
+
data: dataFirst,
|
96
|
+
innerSize: '35%'
|
97
|
+
}],
|
98
|
+
}
|
99
|
+
|
100
|
+
const chartOptionsMedium = {
|
101
|
+
series: [{
|
102
|
+
data: dataSecond,
|
103
|
+
innerSize: '50%'
|
104
|
+
}],
|
105
|
+
}
|
106
|
+
|
107
|
+
const chartOptionsLarge = {
|
108
|
+
series: [{
|
109
|
+
data: dataThird,
|
110
|
+
innerSize: '85%'
|
111
|
+
}],
|
112
|
+
}
|
113
|
+
|
114
|
+
const chartOptionsNone = {
|
115
|
+
series: [{
|
116
|
+
data: dataFourth,
|
117
|
+
innerSize: '0%'
|
118
|
+
}],
|
119
|
+
}
|
120
|
+
|
121
|
+
return (
|
122
|
+
<div>
|
123
|
+
<PbCircleChart
|
124
|
+
options={chartOptionsSmall}
|
125
|
+
{...props}
|
126
|
+
/>
|
127
|
+
<PbCircleChart
|
128
|
+
options={chartOptionsMedium}
|
129
|
+
{...props}
|
130
|
+
/>
|
131
|
+
<PbCircleChart
|
132
|
+
options={chartOptionsLarge}
|
133
|
+
{...props}
|
134
|
+
/>
|
135
|
+
<PbCircleChart
|
136
|
+
options={chartOptionsNone}
|
137
|
+
{...props}
|
138
|
+
/>
|
139
|
+
</div>
|
140
|
+
);
|
141
|
+
};
|
142
|
+
|
143
|
+
|
144
|
+
export default PbCircleChartInnerSizes;
|
@@ -0,0 +1,60 @@
|
|
1
|
+
import React, { useState } from "react";
|
2
|
+
import { PbCircleChart, Button } from "playbook-ui";
|
3
|
+
|
4
|
+
const chartData = [
|
5
|
+
{
|
6
|
+
name: "Waiting for Calls",
|
7
|
+
y: 41,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
name: "On Call",
|
11
|
+
y: 49,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
name: "After Call",
|
15
|
+
y: 10,
|
16
|
+
},
|
17
|
+
];
|
18
|
+
|
19
|
+
const chartData2 = [
|
20
|
+
{
|
21
|
+
name: "Waiting for Calls",
|
22
|
+
y: 48,
|
23
|
+
},
|
24
|
+
{
|
25
|
+
name: "On Call",
|
26
|
+
y: 12,
|
27
|
+
},
|
28
|
+
{
|
29
|
+
name: "After Call",
|
30
|
+
y: 140,
|
31
|
+
},
|
32
|
+
];
|
33
|
+
|
34
|
+
|
35
|
+
const PbCircleChartLiveData = (props) => {
|
36
|
+
|
37
|
+
const [data, setData] = useState(chartData);
|
38
|
+
|
39
|
+
const updateValue = () => {
|
40
|
+
setData(chartData2)
|
41
|
+
}
|
42
|
+
const chartOptions = {
|
43
|
+
series: [{ data: data }],
|
44
|
+
}
|
45
|
+
|
46
|
+
return (
|
47
|
+
<div>
|
48
|
+
<Button
|
49
|
+
onClick={updateValue}
|
50
|
+
text="Update Value"
|
51
|
+
/>
|
52
|
+
<PbCircleChart
|
53
|
+
options={chartOptions}
|
54
|
+
{...props}
|
55
|
+
/>
|
56
|
+
</div>
|
57
|
+
);
|
58
|
+
};
|
59
|
+
|
60
|
+
export default PbCircleChartLiveData;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<% data = [
|
2
|
+
{
|
3
|
+
name: "Waiting for Calls",
|
4
|
+
y: 41,
|
5
|
+
},
|
6
|
+
{
|
7
|
+
name: "On Call",
|
8
|
+
y: 49,
|
9
|
+
},
|
10
|
+
{
|
11
|
+
name: "After Call",
|
12
|
+
y: 10,
|
13
|
+
},
|
14
|
+
] %>
|
15
|
+
|
16
|
+
<% chart_options = {
|
17
|
+
series: [{
|
18
|
+
data: data,
|
19
|
+
innerSize: '100%',
|
20
|
+
borderWidth: '20',
|
21
|
+
}],
|
22
|
+
} %>
|
23
|
+
|
24
|
+
<%= pb_rails("pb_circle_chart", props: { options: chart_options }) %>
|