Template:TestTemplate: Difference between revisions
From FANTOM5_SSTAR
No edit summary |
No edit summary |
||
Line 45: | Line 45: | ||
} | } | ||
var data = []; | var data = []; | ||
var categories = []; | |||
var tmp_data = []; | |||
var content = "</html>{{{1}}}<html>"; | var content = "</html>{{{1}}}<html>"; | ||
var delimiter = "</html>{{{2}}}<html>"; | var delimiter = "</html>{{{2}}}<html>"; | ||
var content_array = content.split(delimiter); | var content_array = content.split(delimiter); | ||
for(var i=0, l=content_array.length; i<l; i++){ | |||
var tmp =content_array[i]; | |||
for(var i=0, l= | tmp_data.push(tmp); | ||
var tmp = | } | ||
var x = ["score", tmp_data]; | |||
var x = [ | |||
data.push(x); | data.push(x); | ||
var chart; | var chart; | ||
Line 62: | Line 63: | ||
chart = new Highcharts.Chart({ | chart = new Highcharts.Chart({ | ||
chart: { | chart: { | ||
type= 'line', | |||
renderTo: 'container', | renderTo: 'container', | ||
marginRight: 130, | |||
marginBottom: 25 | |||
}, | |||
title: { | |||
text: chart_title , | |||
x= -20 //center | |||
}, | |||
subtitle: { | |||
text: 'Source: fantom5.com', | |||
x: -20 | |||
}, | |||
xAxis: { | |||
categories: categories | |||
}, | }, | ||
yAxis: { | |||
title: { | |||
text: 'Temperature (°C)' | |||
}, | |||
plotLines: [{ | |||
value: 0, | |||
width: 1, | |||
color: '#808080' | |||
}] | |||
}, | }, | ||
tooltip: { | tooltip: { | ||
pointFormat: '{series.name}:<b>{point.y}</b>', | pointFormat: '{series.name}:<b>{point.y}</b>', | ||
percentageDecimals: 0, | |||
valueSuffix: '°C' | |||
}, | }, | ||
legend: { | |||
layout: 'vertical', | |||
align: 'right', | |||
verticalAlign: 'top', | |||
x: -10, | |||
y: 100, | |||
borderWidth: 0 | |||
}, | }, | ||
series: | series: data | ||
}); | }); | ||
Line 122: | Line 132: | ||
<div id ="wrap" style="background-color:White; {round corners}} padding: 0.5em 1em;"> | <div id ="wrap" style="background-color:White; {round corners}} padding: 0.5em 1em;"> | ||
<div id="left_col"> | <div id="left_col"> | ||
<div id="container" style="min-width: | <div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div> | ||
</div> | </div> | ||
</div> | </div> |
Revision as of 14:50, 12 June 2013