-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmge-export.html
139 lines (121 loc) · 4.4 KB
/
mge-export.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>MISO - Madison Gas and Electric</title>
<link rel="stylesheet" href="css/style.css" media="screen" type="text/css" />
<script type="text/javascript"
src="js/dygraph-combined.js"></script>
<script type="text/javascript"
src="js/dygraph-extra.js"></script>
</head>
<body>
<div id="title">Madison Gas & Electric</div>
<h3>Export this graph!</h3>
<p>
Use this graph in a presentation or paper. Just adjust to the desired settings and push the create button below. Or go back to the <a href="mge.html">regular page</a>.
</p>
<table><tr><td>
<div id="graphdiv"></div>
<center>
<p><b>Show Series:</b></p>
<p>
<input type=checkbox id="0" checked onClick="change(this)">
<label for="0"> Day-Ahead</label></br>
<input type=checkbox id="1" onClick="change(this)">
<label for="1"> Real-Time</label></br>
<input type=checkbox id="2" checked onClick="change(this)">
<label for="2"> Residential</label>
</p>
<p><b>Rolling Averages:</b></p>
<a href="#" id="day" onClick="daily()">Daily</a>
<a href="#" id="week" onClick="weekly()">Weekly</a>
<a href="#" id="month" onClick="monthly()">Monthly</a>
<a href="#" id="year" onClick="yearly()">Yearly</a>
</center>
</td><td valign=top>
<div id="status" style="width:200px; font-size:0.8em; padding-top:5px;"></div>
</td>
</tr></table>
<hr/>
<h3>PNG Image</h3>
<div id="notsupported" style="display: none;">
<h4>Sorry, browser not supported</h4>
<p>In order to export a <code>dygraph</code> as an image you need a
browser that supports the canvas API and the <a href="http://www.w3.org/TR/html5/the-canvas-element.html#dom-canvas-todataurl">canvas.toDataURL</a>
method. Unfortunately, <a href="http://code.google.com/p/explorercanvas/">excanvas</a>
does not support this method and old versions of Internet Explorer (IE6 to IE8)
are not supported.</p>
</div>
<div id="export-div">
<p><button id="update-img">Create</button> (<em>Hint: Update above graph to desired settings and hit create</em>)</p>
<table><tr><td>
<img id="demoimg"/>
</td><td valign=top>
<div style="width:200px; font-size:0.8em; padding-top:5px;"></div>
</td>
</tr></table>
</div>
Right click image and <b>save image as</b>
<hr class="break"/>
<h4>Use as you wish</h4>
But try to cite this work and let others know if possible
<table class="pages">
<tr>
<td class="linktitle" colspan="4" ><b>Pages<b></td>
</tr>
<tr>
<td>
<a href="miso.html"><b>Midwest Independent System Operator<b></a>
<td>
<a href="mge.html">Madison Gas and Electric Loadzone</a>
</td>
<td>
<a href="kwe.html">Kewaunee Nuclear Power Plant</a>
</td>
<td>
<a href="ref.html">References</a>
</td>
</tr>
<tr>
<td><a href="reg.html">Regions</a></td>
</tr>
<tr>
<td class="home" colspan="4"><a href="index.html">Home</a></td>
</tr>
</table>
<script type="text/javascript">
g = new Dygraph(
document.getElementById("graphdiv"),
"data/mge-full.txt", // path to CSV file
{
rollPeriod: 7,
showRoller: true,
customBars: true,
ylabel: 'Price ($/MW)',
showRangeSelector: true,
visibility: [true, false, true],
title: 'Time-Series of Wholesale Prices for MGE'
} // options
);
function setStatus() {
document.getElementById("visibility").innerHTML =
g.visibility().toString();
}
function change(el) {
g.setVisibility(parseInt(el.id), el.checked);;
setStatus();
}
function daily() { g.updateOptions({rollPeriod: 1}); };
function weekly() { g.updateOptions({rollPeriod: 7}); };
function monthly() { g.updateOptions({rollPeriod: 30}); };
function yearly() { g.updateOptions({rollPeriod: 365}); };
function createImage(){if(!Dygraph.Export.isSupported()){var notsupported=document.getElementById('notsupported');notsupported.style.display='block';var exportDiv=document.getElementById('export-div');exportDiv.style.display='none';return;}
var img=document.getElementById('demoimg')
Dygraph.Export.asPNG(g,img);}
var btn=document.getElementById("update-img")
btn.onclick=function(){createImage()}
createImage()
</script>
</body>
</html>