Skip to content

Commit b6c00a5

Browse files
andraskangyalsimzer
authored andcommitted
Preset charts & optimizing code of preset basics.
1 parent 67b5ebe commit b6c00a5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1558
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { data } from '../../../test_data/chart_types_eu.mjs';
2+
3+
const testSteps = [
4+
chart => chart.animate(
5+
{
6+
data: data,
7+
config: chart.constructor.presets.column({
8+
x:'Joy factors',
9+
y:'Value 2 (+)',
10+
title: 'Column Chart'
11+
}),
12+
style: {
13+
plot: {
14+
paddingLeft: '8em',
15+
yAxis: {
16+
label: {
17+
paddingRight: '0.8em'
18+
}
19+
},
20+
xAxis: {
21+
label: { paddingTop: '0.8em' }
22+
}
23+
}
24+
}
25+
}
26+
),
27+
chart => chart.feature('tooltip',true)
28+
];
29+
30+
export default testSteps;
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import { data } from '../../../test_data/chart_types_eu.mjs';
2+
3+
const testSteps = [
4+
chart => chart.animate(
5+
{
6+
data: Object.assign(data, {
7+
filter: record =>
8+
record.Country == 'Austria' ||
9+
record.Country == 'Belgium' ||
10+
record.Country == 'Bulgaria' ||
11+
record.Country == 'Cyprus' ||
12+
record.Country == 'Denmark' ||
13+
record.Country == 'Hungary'
14+
}),
15+
config: chart.constructor.presets.groupedColumn({
16+
x:'Country',
17+
y:'Value 5 (+/-)',
18+
groupedBy: 'Joy factors',
19+
title: 'Grouped Column Chart'
20+
}),
21+
style:
22+
{
23+
plot: {
24+
paddingLeft: '1.2em',
25+
yAxis: {
26+
label: { paddingRight: '0.8em' }
27+
},
28+
xAxis: {
29+
label: { paddingTop: '0.8em' }
30+
}
31+
}
32+
}
33+
}
34+
),
35+
chart => chart.feature('tooltip',true)
36+
];
37+
38+
export default testSteps;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { data } from '../../../test_data/chart_types_eu.mjs';
2+
3+
const testSteps = [
4+
chart => chart.animate(
5+
{
6+
data: Object.assign(data, {
7+
filter: record =>
8+
record.Country == 'Austria' ||
9+
record.Country == 'Belgium' ||
10+
record.Country == 'Bulgaria' ||
11+
record.Country == 'Cyprus' ||
12+
record.Country == 'Czechia' ||
13+
record.Country == 'Denmark'
14+
}),
15+
config: chart.constructor.presets.stackedColumn({
16+
x:'Country',
17+
y:'Value 2 (+)',
18+
stackedBy: 'Joy factors',
19+
title: 'Stacked Column Chart'
20+
}),
21+
style: {
22+
plot: {
23+
paddingLeft: '1.2em',
24+
yAxis: {
25+
label: {
26+
paddingRight: '0.8em'
27+
}
28+
},
29+
xAxis: {
30+
label: { paddingTop: '0.8em' }
31+
}
32+
}
33+
}
34+
}
35+
),
36+
chart => chart.feature('tooltip',true)
37+
];
38+
39+
export default testSteps;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { data } from '../../../test_data/chart_types_eu.mjs';
2+
3+
const testSteps = [
4+
chart => chart.animate(
5+
{
6+
data: data,
7+
config: chart.constructor.presets.splittedColumn({
8+
x:'Year',
9+
y:'Value 2 (+)',
10+
splittedBy: 'Joy factors',
11+
title: 'Splitted Column Chart'
12+
}),
13+
style: {
14+
plot: {
15+
paddingLeft: '1.2em',
16+
yAxis: {
17+
label: {
18+
paddingRight: '0.8em'
19+
}
20+
},
21+
xAxis: {
22+
label: { paddingTop: '0.8em' }
23+
}
24+
}
25+
}
26+
}
27+
),
28+
29+
chart => chart.feature('tooltip',true)
30+
];
31+
32+
export default testSteps;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { data } from '../../../test_data/chart_types_eu.mjs';
2+
3+
const testSteps = [
4+
chart => chart.animate(
5+
{
6+
data: Object.assign(data, {
7+
filter: record =>
8+
record.Country == 'Austria' ||
9+
record.Country == 'Belgium' ||
10+
record.Country == 'Bulgaria' ||
11+
record.Country == 'Cyprus' ||
12+
record.Country == 'Czechia' ||
13+
record.Country == 'Denmark'
14+
}),
15+
config: chart.constructor.presets.percentageColumn({
16+
x:'Country',
17+
y:'Value 2 (+)',
18+
stackedBy: 'Joy factors',
19+
title: 'Percentage Column Chart'
20+
}),
21+
style: {
22+
plot: {
23+
paddingLeft: '1.2em',
24+
yAxis: {
25+
label: {
26+
paddingRight: '0.8em'
27+
}
28+
},
29+
xAxis: {
30+
label: { paddingTop: '0.8em' }
31+
}
32+
}
33+
}
34+
}
35+
),
36+
chart => chart.feature('tooltip',true)
37+
];
38+
39+
export default testSteps;
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { data } from '../../../test_data/chart_types_eu.mjs';
2+
3+
data.filter = record =>
4+
record.Country == 'Belgium';
5+
6+
const testSteps = [
7+
chart => chart.animate(
8+
{
9+
data: data,
10+
config: chart.constructor.presets.waterfall({
11+
x:'Year',
12+
y:'Value 5 (+/-)',
13+
title: 'Waterfall Chart'
14+
}),
15+
style:
16+
{
17+
plot: {
18+
paddingLeft: '8em',
19+
marker: {
20+
colorGradient:
21+
[
22+
'#ff001b 0',
23+
'#ff001b 0.5',
24+
'#7e79e8 0.5',
25+
'#7e79e8 1'
26+
].join(),
27+
label: {
28+
position: 'top'
29+
}
30+
},
31+
yAxis: {
32+
label: {
33+
paddingRight: '0.8em'
34+
}
35+
},
36+
xAxis: {
37+
label: { paddingTop: '0.8em' }
38+
}
39+
}
40+
}
41+
}
42+
),
43+
chart => chart.feature('tooltip',true)
44+
];
45+
46+
export default testSteps;
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { data } from '../../../test_data/chart_types_eu.mjs';
2+
3+
data.filter = record =>
4+
record.Country == 'Bulgaria' ||
5+
record.Country == 'Germany' ||
6+
record.Country == 'Malta' ||
7+
record.Country == 'Lithuania'
8+
9+
const testSteps = [
10+
chart => chart.animate(
11+
{
12+
data: data,
13+
config: chart.constructor.presets.mekko({
14+
x:'Value 1 (+)',
15+
y:'Value 2 (+)',
16+
stackedBy:'Joy factors',
17+
groupedBy:'Country',
18+
title: 'Stacked Mekko Chart'
19+
}),
20+
style: {
21+
plot: {
22+
paddingLeft: '1.2em',
23+
yAxis: {
24+
label: {
25+
paddingRight: '0.8em'
26+
}
27+
},
28+
xAxis: {
29+
title: { paddingTop: '2.4em' },
30+
label: { paddingTop: '0.8em' }
31+
}
32+
}
33+
}
34+
}
35+
),
36+
chart => chart.feature('tooltip',true)
37+
];
38+
39+
export default testSteps;
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import { data } from '../../../test_data/chart_types_eu.mjs';
2+
3+
const testSteps = [
4+
chart => chart.animate({
5+
data: Object.assign(data, {
6+
filter: record =>
7+
record.Country == 'Bulgaria' ||
8+
record.Country == 'Germany' ||
9+
record.Country == 'Malta' ||
10+
record.Country == 'Lithuania'
11+
}),
12+
config: chart.constructor.presets.marimekko({
13+
x:'Value 2 (+)',
14+
y:'Value 3 (+)',
15+
stackedBy: 'Joy factors',
16+
groupedBy:'Country',
17+
title: 'Marimekko Chart'
18+
}),
19+
style: {
20+
plot: {
21+
paddingLeft: '1.2em',
22+
yAxis: {
23+
label: {
24+
paddingRight: '0.8em'
25+
}
26+
},
27+
xAxis: {
28+
title: { paddingTop: '2.4em' },
29+
label: { paddingTop: '0.8em' }
30+
}
31+
}
32+
}
33+
})
34+
];
35+
36+
export default testSteps;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { data } from '../../../test_data/chart_types_eu.mjs';
2+
3+
const testSteps = [
4+
chart => chart.animate(
5+
{
6+
data: Object.assign(data, {
7+
filter: record =>
8+
record.Country == 'Austria' ||
9+
record.Country == 'Belgium' ||
10+
record.Country == 'Bulgaria' ||
11+
record.Country == 'Cyprus' ||
12+
record.Country == 'Czechia' ||
13+
record.Country == 'Denmark' ||
14+
record.Country == 'Hungary'
15+
}),
16+
config: chart.constructor.presets.bar({
17+
x:'Value 5 (+/-)',
18+
y:'Country',
19+
title: 'Bar Chart'
20+
}),
21+
style: {
22+
plot: {
23+
paddingLeft: '8em',
24+
yAxis: {
25+
label: {
26+
paddingRight: '0.8em'
27+
}
28+
},
29+
xAxis: {
30+
title: { paddingTop: '2.4em' },
31+
label: { paddingTop: '0.8em' }
32+
}
33+
}
34+
}
35+
}
36+
),
37+
chart => chart.feature('tooltip',true)
38+
];
39+
40+
export default testSteps;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { data } from '../../../test_data/chart_types_eu.mjs';
2+
3+
const testSteps = [
4+
chart => chart.animate(
5+
{
6+
data: Object.assign(data, {
7+
filter: record =>
8+
record.Country == 'Austria' ||
9+
record.Country == 'Belgium' ||
10+
record.Country == 'Bulgaria' ||
11+
record.Country == 'Cyprus' ||
12+
record.Country == 'Denmark' ||
13+
record.Country == 'Hungary'
14+
}),
15+
config: chart.constructor.presets.groupedBar({
16+
x:'Value 5 (+/-)',
17+
y:'Country',
18+
groupedBy:'Joy factors',
19+
title: 'Grouped Bar Chart'
20+
}),
21+
style: {
22+
plot: {
23+
paddingLeft: '1.65em',
24+
yAxis: {
25+
label: {
26+
paddingRight: '0.8em'
27+
}
28+
},
29+
xAxis: {
30+
title: { paddingTop: '2.4em' },
31+
label: { paddingTop: '0.8em' }
32+
}
33+
}
34+
}
35+
}
36+
),
37+
chart => chart.feature('tooltip',true)
38+
];
39+
40+
export default testSteps;

0 commit comments

Comments
 (0)