Skip to content

Commit 1ee9168

Browse files
committed
Merge branch 'master' of github.com:orangecoding/heatsheet
2 parents 3668f81 + ffbea08 commit 1ee9168

File tree

1 file changed

+189
-139
lines changed

1 file changed

+189
-139
lines changed

static/charts/chart.js

Lines changed: 189 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -11,146 +11,196 @@ window.heatsheet = window.heatsheet || {};
1111
* @param on
1212
* @param id
1313
*/
14-
window.heatsheet.renderChart = function renderChart(temperature, lowHeating, mediumHeating, highHeating, away, off, on, id) {
15-
Highcharts.chart(id, {
16-
chart: {
17-
zoomType: 'x'
14+
window.heatsheet.renderChart = function renderChart(
15+
temperature,
16+
lowHeating,
17+
mediumHeating,
18+
highHeating,
19+
away,
20+
off,
21+
on,
22+
id
23+
) {
24+
Highcharts.chart(id, {
25+
chart: {
26+
zoomType: 'x',
27+
},
28+
title: {
29+
text: '',
30+
},
31+
time: {
32+
useUTC: false,
33+
},
34+
yAxis: [
35+
{
36+
labels: {
37+
format: '{value} min.',
38+
style: {
39+
color: Highcharts.getOptions().colors[0],
40+
},
1841
},
1942
title: {
20-
text: ''
21-
},
22-
time: {
23-
useUTC: false
24-
},
25-
yAxis: [
26-
{
27-
labels: {
28-
format: '{value} min.',
29-
style: {
30-
color: Highcharts.getOptions().colors[0]
31-
}
32-
},
33-
title: {
34-
text: 'Heating times',
35-
style: {
36-
color: Highcharts.getOptions().colors[0]
37-
}
38-
},
39-
opposite: true
40-
}, {
41-
gridLineWidth: 0,
42-
title: {
43-
text: 'Temperature',
44-
style: {
45-
color: Highcharts.getOptions().colors[5]
46-
}
47-
},
48-
labels: {
49-
format: '{value}°C',
50-
style: {
51-
color: Highcharts.getOptions().colors[5]
52-
}
53-
}
54-
55-
},
56-
{
57-
labels: {
58-
format: '{value} min.',
59-
style: {
60-
color: Highcharts.getOptions().colors[3]
61-
}
62-
},
63-
title: {
64-
text: 'Heating Modes',
65-
style: {
66-
color: Highcharts.getOptions().colors[3]
67-
}
68-
},
69-
opposite: true
70-
}
71-
],
72-
xAxis: {
73-
type: 'datetime',
74-
crosshair: {
75-
snap: false,
76-
},
77-
},
78-
plotOptions: {
79-
column: {
80-
stacking: 'normal'
81-
}
43+
text: 'Heating times',
44+
style: {
45+
color: Highcharts.getOptions().colors[0],
46+
},
47+
},
48+
opposite: true,
49+
},
50+
{
51+
gridLineWidth: 0,
52+
title: {
53+
text: 'Temperature',
54+
style: {
55+
color: '#999999',
56+
},
57+
},
58+
labels: {
59+
format: '{value}°C',
60+
style: {
61+
color: '#999999',
62+
},
63+
},
64+
},
65+
{
66+
labels: {
67+
format: '{value} min.',
68+
style: {
69+
color: Highcharts.getOptions().colors[3],
70+
},
71+
},
72+
},
73+
],
74+
xAxis: {
75+
type: 'datetime',
76+
crosshair: {
77+
snap: false,
78+
},
79+
},
80+
plotOptions: {
81+
column: {
82+
stacking: 'normal',
83+
},
84+
},
85+
tooltip: {
86+
shared: true,
87+
},
88+
series: [
89+
{
90+
name: 'Temperature',
91+
type: 'spline',
92+
data: temperature,
93+
yAxis: 1,
94+
color: '#cccccc',
95+
tooltip: {
96+
valueSuffix: ' °C',
97+
},
98+
},
99+
{
100+
name: 'High Heating',
101+
type: 'column',
102+
yAxis: 0,
103+
stack: 1,
104+
data: highHeating,
105+
tooltip: {
106+
valueSuffix: ' min.',
107+
},
108+
color: {
109+
linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
110+
stops: [
111+
[0, '#ff3737'], // start
112+
[1, '#db2828'], // end
113+
],
114+
},
115+
},
116+
{
117+
name: 'Medium Heating',
118+
type: 'column',
119+
yAxis: 0,
120+
stack: 1,
121+
data: mediumHeating,
122+
tooltip: {
123+
valueSuffix: ' min.',
82124
},
125+
color: {
126+
linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
127+
stops: [
128+
[0, '#ff8c00'], // start
129+
[1, '#e07b01'], // end
130+
],
131+
},
132+
},
133+
{
134+
name: 'Low Heating',
135+
type: 'column',
136+
yAxis: 0,
137+
stack: 1,
138+
data: lowHeating,
139+
tooltip: {
140+
valueSuffix: ' min.',
141+
},
142+
color: {
143+
linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
144+
stops: [
145+
[0, '#08b1e3'], // start
146+
[1, '#0794be'], // end
147+
],
148+
},
149+
},
150+
{
151+
name: 'Away Mode',
152+
type: 'column',
153+
yAxis: 2,
154+
stack: 2,
155+
data: away,
156+
visible: false,
157+
tooltip: {
158+
valueSuffix: ' min.',
159+
},
160+
color: {
161+
linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
162+
stops: [
163+
[0, '#cccccc'], // start
164+
[1, '#aaaaaa'], // end
165+
],
166+
},
167+
},
168+
{
169+
name: 'Heating off',
170+
type: 'column',
171+
yAxis: 2,
172+
stack: 2,
173+
data: off,
174+
visible: false,
175+
tooltip: {
176+
valueSuffix: ' min.',
177+
},
178+
color: {
179+
linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
180+
stops: [
181+
[0, '#666666'], // start
182+
[1, '#444444'], // end
183+
],
184+
},
185+
},
186+
{
187+
name: 'Heating on',
188+
type: 'column',
189+
yAxis: 2,
190+
stack: 2,
191+
data: on,
192+
visible: false,
83193
tooltip: {
84-
shared: true
85-
},
86-
series: [{
87-
name: 'Temperature',
88-
type: 'spline',
89-
data: temperature,
90-
yAxis: 1,
91-
color: Highcharts.getOptions().colors[5],
92-
tooltip: {
93-
valueSuffix: ' °C'
94-
},
95-
}, {
96-
name: 'High Heating',
97-
type: 'column',
98-
yAxis: 0,
99-
stack: 1,
100-
data: highHeating,
101-
tooltip: {
102-
valueSuffix: ' min.'
103-
},
104-
}, {
105-
name: 'Medium Heating',
106-
type: 'column',
107-
yAxis: 0,
108-
stack: 1,
109-
data: mediumHeating,
110-
tooltip: {
111-
valueSuffix: ' min.'
112-
},
113-
}, {
114-
name: 'Low Heating',
115-
type: 'column',
116-
yAxis: 0,
117-
stack: 1,
118-
data: lowHeating,
119-
tooltip: {
120-
valueSuffix: ' min.'
121-
},
122-
},
123-
{
124-
name: 'Away Mode',
125-
type: 'column',
126-
yAxis: 2,
127-
stack: 2,
128-
data: away,
129-
visible: false,
130-
tooltip: {
131-
valueSuffix: ' min.'
132-
},
133-
}, {
134-
name: 'Heating off',
135-
type: 'column',
136-
yAxis: 2,
137-
stack: 2,
138-
data: off,
139-
visible: false,
140-
tooltip: {
141-
valueSuffix: ' min.'
142-
},
143-
}, {
144-
name: 'Heating on',
145-
type: 'column',
146-
yAxis: 2,
147-
stack: 2,
148-
data: on,
149-
visible: false,
150-
tooltip: {
151-
valueSuffix: ' min.'
152-
},
153-
}
154-
]
155-
});
156-
};
194+
valueSuffix: ' min.',
195+
},
196+
color: {
197+
linearGradient: { x1: 0, x2: 0, y1: 0, y2: 1 },
198+
stops: [
199+
[0, '#65de3f'], // start
200+
[1, '#51b232'], // end
201+
],
202+
},
203+
},
204+
],
205+
});
206+
};

0 commit comments

Comments
 (0)