new graph

This commit is contained in:
Martin Donnelly 2016-08-15 16:36:04 +01:00
parent 40871afd81
commit 9ce89c23f4

View File

@ -301,6 +301,11 @@
if (mode === 6) {
value = i.get(this.modes[1]);
valueB = i.get(this.modes[3]);
} else {
value = i.get(this.modes[2]);
valueB = i.get(this.modes[4]);
}
}
@ -367,12 +372,24 @@
co2Axis.axisAlpha = 0;
co2Axis.showFirstLabel = false;
co2Axis.showLastLabel = false;
co2Axis.title = "Co2 Levels";
co2Axis.title = 'Co2 Levels';
co2Axis.position = 'right';
self.chart.addValueAxis(co2Axis);
}
if (mode === 7) {
var otherAxis = new AmCharts.ValueAxis();
otherAxis.tickLength = 0;
otherAxis.axisAlpha = 0;
otherAxis.showFirstLabel = false;
otherAxis.showLastLabel = false;
otherAxis.title = 'Humidity';
otherAxis.position = 'right';
self.chart.addValueAxis(otherAxis);
}
// GRAPH
var graph = new AmCharts.AmGraph();
@ -409,6 +426,31 @@
self.chart.addGraph(co2graph);
}
if (mode === 7) {
var otherGraph = new AmCharts.AmGraph();
otherGraph.valueField = 'valueB';
otherGraph.title = 'Humidity';
otherGraph.type = 'line';
otherGraph.valueAxis = otherAxis; // Indicate which axis should be used
otherGraph.lineColor = '#786c56';
otherGraph.lineThickness = 1;
otherGraph.legendValueText = '[[description]]/[[value]]';
otherGraph.bullet = 'round';
otherGraph.bulletSizeField = 'townSize'; // Indicate which field should be used for bullet size
otherGraph.bulletBorderColor = '#786c56';
otherGraph.bulletBorderAlpha = 1;
otherGraph.bulletBorderThickness = 2;
otherGraph.bulletColor = '#000000';
//Co2graph.labelText = "[[townName2]]"; // not all data points has townName2 specified, that's why labels are displayed only near some of the bullets.
otherGraph.labelPosition = 'right';
//Co2graph.balloonText = "latitude:[[value]]";
otherGraph.showBalloon = true;
otherGraph.dashLengthField = 'dashLength';
self.chart.addGraph(otherGraph);
}
// CURSOR
var chartCursor = new AmCharts.ChartCursor();
chartCursor.valueLineEnabled = true;