8000 add Gantt chart mock · plotly/plotly.js@118dc82 · GitHub
[go: up one dir, main page]

Skip to content

Commit 118dc82

Browse files
committed
add Gantt chart mock
1 parent 6155965 commit 118dc82

File tree

3 files changed

+92
-0
lines changed

3 files changed

+92
-0
lines changed
48.8 KB
Loading

test/image/mocks/bar_gantt-chart.json

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"data": [
3+
{
4+
"base": [
5+
"2020-03-01",
6+
"2020-03-05",
7+
"2020-03-05",
8+
"2020-03-01",
9+
"2020-03-06",
10+
"2020-03-01",
11+
"2020-03-07",
12+
"2020-03-08",
13+
"2020-03-09"
14+
],
15+
"orientation": "h",
16+
"type": "bar",
17+
"x": [
18+
345600000,
19+
172800000,
20+
259200000,
21+
432000000,
22+
86400000,
23+
518400000,
24+
302400000,
25+
86400000,
26+
172800000
27+
],
28+
"marker": {
29+
"colorscale": "Portland",
30+
"color": [
31+
1,
32+
0,
33+
1,
34+
0,
35+
0,
36+
0.9,
37+
0.3,
38+
1,
39+
1
40+
]
41+
},
42+
"y": [
43+
"Activity A",
44+
"Activity B",
45+
"Activity C",
46+
"Activity D",
47+
"Activity E",
48+
"Activity F",
49+
"Activity X",
50+
"Activity Y",
51+
"Activity Z"
52+
],
53+
"text": [
54+
"4 days",
55+
"2 days",
56+
"3 days",
57+
"5 days",
58+
"1 day",
59+
"6 days",
60+
"3½ days",
61+
"1 day",
62+
"2 days"
63+
],
64+
"textfont": { "size": 16 },
65+
"textposition": "inside",
66+
"insidetextanchor": "middle",
67+
"hovertemplate": "%{y}<br>start: %{base}<br>duration: %{text}<br>end: %{x}"
68+
}
69+
],
70+
"layout": {
71+
"width": 1000,
72+
"height": 500,
73+
"title": {
74+
"text": "Gantt chart using Plotly.js bar"
75+
},
76+
"xaxis": {
77+
"gridwidth": 5,
78+
"tickwidth": 5,
79+
"ticklen": 10,
80+
"type": "date"
81+
},
82+
"yaxis": {
83+
"tickfont": {
84+
"family": "Times New Roman",
85+
"size": 16
86+
},
87+
"autorange": "reversed"
88+
}
89+
}
90+
}

test/jasmine/tests/mock_test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ var list = [
111111
'bar_display_height_zero_no_line_width',
112112
'bar_display_height_zero_only_line_width',
113113
'bar_errorbars_inherit_color',
114+
'bar_gantt-chart',
114115
'bar_group_percent',
115116
'bar_hide_nulls',
116117
'bar_line',
@@ -1151,6 +1152,7 @@ figs['bar_display_height_zero'] = require('@mocks/bar_display_height_zero');
11511152
figs['bar_display_height_zero_no_line_width'] = require('@mocks/bar_display_height_zero_no_line_width');
11521153
figs['bar_display_height_zero_only_line_width'] = require('@mocks/bar_display_height_zero_only_line_width');
11531154
figs['bar_errorbars_inherit_color'] = require('@mocks/bar_errorbars_inherit_color');
1155+
figs['bar_gantt-chart'] = require('@mocks/bar_gantt-chart');
11541156
figs['bar_group_percent'] = require('@mocks/bar_group_percent');
11551157
figs['bar_hide_nulls'] = require('@mocks/bar_hide_nulls');
11561158
figs['bar_line'] = require('@mocks/bar_line');

0 commit comments

Comments
 (0)
0