diff --git a/index.html b/index.html
index 5b8fbca..0a1fa45 100644
--- a/index.html
+++ b/index.html
@@ -33,7 +33,15 @@
"listeners": [{
"event": "zoomed",
"method": syncZoom
- }],
+ }, {
+ "event": "init",
+ "method":
+ function() {
+ today = new Date();
+ tempchart.zoomToDates(new Date(today.getTime() - 7*24*3600*1000), today);
+ }
+ }
+ ],
"chartCursor": {
"listeners": [{
"event": "changed",
@@ -55,34 +63,34 @@
},
"graphs": [
{"type":"line", "valueField": "temp-1", "title": "01",
- "balloonText": "01", },
- {"type":"line", "valueField": "temp-2", "title": "02",
- "balloonText": "02", },
- {"type":"line", "valueField": "temp-4", "title": "04",
- "balloonText": "03", },
- {"type":"line", "valueField": "temp-8", "title": "8 outside",
- "balloonText": "08℃", },
- {"type":"line", "valueField": "temp-11", "title": "11",
- "balloonText": "11", },
- {"type":"line", "valueField": "temp-12", "title": "12",
- "balloonText": "12", },
- {"type":"line", "valueField": "temp-13", "title": "13",
- "balloonText": "13", },
- {"type":"line", "valueField": "temp-14", "title": "14",
- "balloonText": "14", },
- {"type":"line", "valueField": "temp-15", "title": "15",
- "balloonText": "15", },
- {"type":"line", "valueField": "temp-16", "title": "16",
- "balloonText": "16", },
- {"type":"line", "valueField": "temp-17", "title": "17",
- "balloonText": "17", },
- {"type":"line", "valueField": "temp-18", "title": "18",
- "balloonText": "18", },
- {"type":"line", "valueField": "temp-19", "title": "19",
- "balloonText": "19", },
- {"type":"line", "valueField": "temp-20",
- "balloonText": "20",
- "title": "20 outside", "id": "tempscale" },
+ "balloonText": "01: [[value]]℃", },
+ {"type":"line", "valueField": "temp-2", "title": "02",
+ "balloonText": "02: [[value]]℃", },
+ {"type":"line", "valueField": "temp-4", "title": "04",
+ "balloonText": "03: [[value]]℃", },
+ {"type":"line", "valueField": "temp-8", "title": "8 outside",
+ "balloonText": "08 out: [[value]]℃", },
+ {"type":"line", "valueField": "temp-11", "title": "11",
+ "balloonText": "11: [[value]]℃", },
+ {"type":"line", "valueField": "temp-12", "title": "12",
+ "balloonText": "12: [[value]]℃", },
+ {"type":"line", "valueField": "temp-13", "title": "13",
+ "balloonText": "13: [[value]]℃", },
+ {"type":"line", "valueField": "temp-14", "title": "14",
+ "balloonText": "14: [[value]]℃", },
+ {"type":"line", "valueField": "temp-15", "title": "15",
+ "balloonText": "15: [[value]]℃", },
+ {"type":"line", "valueField": "temp-16", "title": "16",
+ "balloonText": "16: [[value]]℃", },
+ {"type":"line", "valueField": "temp-17", "title": "17",
+ "balloonText": "17: [[value]]℃", },
+ {"type":"line", "valueField": "temp-18", "title": "18",
+ "balloonText": "18: [[value]]℃", },
+ {"type":"line", "valueField": "temp-19", "title": "19",
+ "balloonText": "19: [[value]]℃", },
+ {"type":"line", "valueField": "temp-20",
+ "balloonText": "20 out: [[value]]℃",
+ "title": "20 outside", "id": "tempscale" },
]
});
@@ -91,12 +99,21 @@
"dataProvider": data,
"categoryField": "datetime",
"valueAxis": {
+ "maximum": "99",
"ignoreAxisWidth": true
},
"listeners": [{
"event": "zoomed",
"method": syncZoom
- }],
+ }, {
+ "event": "init",
+ "method":
+ function() {
+ today = new Date();
+ humidchart.zoomToDates(new Date(today.getTime() - 7*24*3600*1000), today);
+ }
+ }
+ ],
"chartCursor": {
"oneBalloonOnly": true,
"cursorPosition": "mouse",
@@ -155,7 +172,6 @@
});
function syncCursors(e) {
- console.log("sync"+e.chart)
if(tempchart !== e.chart) {
tempchart.chartCursor.syncWithCursor(e.chart.chartCursor);
} else {
@@ -164,7 +180,6 @@
}
function hideCursors(e) {
- console.log("hidef"+e)
if(tempchart !== e.chart) {
tempchart.chartCursor.hideCursor();
tempchart.chartCursor.clearSelection();
@@ -175,11 +190,11 @@
}
function syncZoom(e) {
- console.log("zoomg"+e)
- if (e.chart.ignoreZoom) {
- e.chart.ignoreZoom = false;
- return;
- }
+ console.log(e.startDate + "|" + e.endDate);
+ if (e.chart.ignoreZoom) {
+ e.chart.ignoreZoom = false;
+ return;
+ }
if(tempchart !== e.chart) {
tempchart.ignoreZoom = true;
tempchart.zoomToDates(e.startDate, e.endDate);
@@ -188,9 +203,6 @@
humidchart.zoomToDates(e.startDate, e.endDate);
}
}
- console.log(humidchart.chartCursor.syncWithCursor(tempchart.charCursor));
- console.log("hoge");//+ humidchart.chartCursor);
- //humidchart.chartCursor.syncWithCursor(tempchart.chartCursor);