mirror of
https://gitlab.silvrtree.co.uk/martind2000/mdot_server.git
synced 2025-02-09 19:59:16 +00:00
new graph
This commit is contained in:
parent
40871afd81
commit
9ce89c23f4
@ -301,6 +301,11 @@
|
|||||||
if (mode === 6) {
|
if (mode === 6) {
|
||||||
value = i.get(this.modes[1]);
|
value = i.get(this.modes[1]);
|
||||||
valueB = i.get(this.modes[3]);
|
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.axisAlpha = 0;
|
||||||
co2Axis.showFirstLabel = false;
|
co2Axis.showFirstLabel = false;
|
||||||
co2Axis.showLastLabel = false;
|
co2Axis.showLastLabel = false;
|
||||||
co2Axis.title = "Co2 Levels";
|
co2Axis.title = 'Co2 Levels';
|
||||||
co2Axis.position = 'right';
|
co2Axis.position = 'right';
|
||||||
self.chart.addValueAxis(co2Axis);
|
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
|
// GRAPH
|
||||||
var graph = new AmCharts.AmGraph();
|
var graph = new AmCharts.AmGraph();
|
||||||
@ -409,6 +426,31 @@
|
|||||||
self.chart.addGraph(co2graph);
|
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
|
// CURSOR
|
||||||
var chartCursor = new AmCharts.ChartCursor();
|
var chartCursor = new AmCharts.ChartCursor();
|
||||||
chartCursor.valueLineEnabled = true;
|
chartCursor.valueLineEnabled = true;
|
||||||
@ -419,15 +461,15 @@
|
|||||||
var chartScrollbar = new AmCharts.ChartScrollbar();
|
var chartScrollbar = new AmCharts.ChartScrollbar();
|
||||||
self.chart.addChartScrollbar(chartScrollbar);
|
self.chart.addChartScrollbar(chartScrollbar);
|
||||||
|
|
||||||
/* // HORIZONTAL GREEN RANGE
|
/* // HORIZONTAL GREEN RANGE
|
||||||
var guide = new AmCharts.Guide();
|
var guide = new AmCharts.Guide();
|
||||||
guide.value = 525;
|
guide.value = 525;
|
||||||
guide.toValue = 575;
|
guide.toValue = 575;
|
||||||
guide.fillColor = '#00CC00';
|
guide.fillColor = '#00CC00';
|
||||||
guide.inside = true;
|
guide.inside = true;
|
||||||
guide.fillAlpha = 0.2;
|
guide.fillAlpha = 0.2;
|
||||||
guide.lineAlpha = 0;
|
guide.lineAlpha = 0;
|
||||||
valueAxis.addGuide(guide);*/
|
valueAxis.addGuide(guide);*/
|
||||||
|
|
||||||
// WRITE
|
// WRITE
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user