Ik zit nu echt te stoeien met het x-as probleem maar ik kom er maar niet uit.
http://hetweerinnagele.nl/voorbeeld/outtemp.html
Code: Selecteer allesvar options = {
chart: {
renderTo: 'outtempcontainer',
height: 300, width: 750,
defaultSeriesType: 'spline'
},
credits: {enabled: false},
tooltip: {
formatter: function() {
return this.x +
'<br/>'+ this.y +' C';
}
},
title: {
text: 'Temperatuur vandaag'
},
legend: {
verticalAlign: "top",
align: "right",
x: 0,
y: 0,
layout: "vertical",
},
xAxis: {
tickInterval: 3600 * 1000, // one week
tickWidth: 1,
tickWidth:0,
gridLineWidth:0,
labels: {
enabled: true,
rotation: 300,
align: 'right',
},
categories: []
},
yAxis: {
title: {
text: 'Graden'
}
},
plotOptions:
{
spline:
{
lineWidth: 4,
states: {hover: {lineWidth: 5}},
marker:
{
enabled: false,
states:
{
hover:
{
enabled: true,symbol: 'circle',radius: 5, lineWidth: 1
}
}
}
}
},
series: []
};
$.get('./graphdata-outtemp.php', function(data) {
// Split the lines
var lines = data.split('\\n');
// Iterate over the lines and add categories or series
$.each(lines, function(lineNo, line) {
var items = line.split(',');
if (lineNo == 0) {
$.each(items, function(itemNo, item) {
if (itemNo > 0) options.xAxis.categories.push(item);
});
}
else {
var series = {
data: []
};
$.each(items, function(itemNo, item) {
if (itemNo == 0) {
series.name = item;
} else {
series.data.push(parseFloat(item));
}
});
options.series.push(series);
}
});
// Create the chart
var chart = new Highcharts.Chart(options);
});
Dit is nu de code zoals hij op de website staat. Je ziet dat elke tijd op de x-as staat. Is er een manier zodat alleen volle uren op de website komen (zoals 16, 17, 18, 19 uur)?
Ik heb al op
www.highcharts.com gekeken maar het lukt niet!
Oh ja Theo, heb je toevallig ook nog ergens het default theme bestand?