<p>1: Line chart with axis at zero problem:</p>
<div id="graph1"></div>
<script type="text/javascript">
- new Dygraph(document.getElementById("graph1"),
+ var g1 = new Dygraph(document.getElementById("graph1"),
"Date,Temperature\n" +
"2008-05-07,0\n" +
"2008-05-08,1\n" +
<p>2: Step chart with axis at zero problem:</p>
<div id="graphd2"></div>
<script type="text/javascript">
- new Dygraph(document.getElementById("graphd2"),
+ var g2 = new Dygraph(document.getElementById("graphd2"),
"Date,Temperature\n" +
"2008-05-07,0\n" +
"2008-05-08,1\n" +
<p>3: Line chart with <code>avoidMinZero</code> option:</p>
<div id="graph3"></div>
<script type="text/javascript">
- new Dygraph(document.getElementById("graph3"),
+ var g3 = new Dygraph(document.getElementById("graph3"),
"Date,Temperature\n" +
"2008-05-07,0\n" +
"2008-05-08,1\n" +
<p>4: Step chart with <code>avoidMinZero</code> option:</p>
<div id="graphd4"></div>
<script type="text/javascript">
- new Dygraph(document.getElementById("graphd4"),
+ var g4 = new Dygraph(document.getElementById("graphd4"),
"Date,Temperature\n" +
"2008-05-07,0\n" +
"2008-05-08,1\n" +
<p>Hopefully this stays in its border:</p>
<div id="bordered" style="width:600px; height:300px;"></div>
<script type="text/javascript">
- new Dygraph(document.getElementById('bordered'), data,
+ var g = new Dygraph(document.getElementById('bordered'), data,
{
labelsDivStyles: { border: '1px solid black' },
title: 'Chart Title',
<div id="graphdiv" style="width:600px; height:300px;"></div>
<script type="text/javascript">
- new Dygraph(document.getElementById("graphdiv"),
+ var g = new Dygraph(document.getElementById("graphdiv"),
[
[ new Date("2009/12/01"), 10, 10, 10],
[ new Date("2009/12/02"), 15, 11, 12],
<div id="graph"></div>
<script type="text/javascript">
- new Dygraph(document.getElementById("graph"),
+ var g = new Dygraph(document.getElementById("graph"),
[
[1, [10, 10, 100]],
[2, [15, 20, 110]],
<div id="g2" style="width:600px; height:300px;"></div>
<script type="text/javascript">
- new Dygraph(
+ var g1 = new Dygraph(
document.getElementById("g"),
NoisyData, {
rollPeriod: 7,
}
);
- new Dygraph(
+ var g2 = new Dygraph(
document.getElementById("g2"),
NoisyData, {
rollPeriod: 7,
<div id="div_g3" style="width:600px; height:300px;"></div>
<script type="text/javascript">
- new Dygraph(
+ var g1 = new Dygraph(
document.getElementById("div_g"),
function() {
var ret = "X,Y1,Y2\n";
{ fillGraph: true }
);
- new Dygraph(
+ var g2 = new Dygraph(
document.getElementById("div_g2"),
function() {
var ret = "X,Y1,Y2\n";
{ fillGraph: true }
);
- new Dygraph(
+ var g3 = new Dygraph(
document.getElementById("div_g3"),
function() {
var ret = "X,Y1,Y2\n";
"3,2/3,17/49\n"+
"4,25/30,100/200";
- new Dygraph(document.getElementById("dg"),
+ var g1 = new Dygraph(document.getElementById("dg"),
frac_str,
{
fractions: true
});
- new Dygraph(document.getElementById("dg2"),
+ var g2 = new Dygraph(document.getElementById("dg2"),
frac_str,
{
fractions: true,
new google.visualization.LineChart(
document.getElementById('gviz')).draw(data, null);
- new Dygraph.GVizChart(document.getElementById('dygraphs'))
+ var chart1 = new Dygraph.GVizChart(document.getElementById('dygraphs'))
.draw(data, { });
data = createDataTable('datetime');
- new Dygraph.GVizChart(
+ var chart2 = new Dygraph.GVizChart(
document.getElementById('dygraphs_datetime')).draw(data, {
});
}
new google.visualization.LineChart(
document.getElementById('gviz')).draw(data, null);
- new Dygraph.GVizChart(
+ var chart1 = new Dygraph.GVizChart(
document.getElementById('dygraphs')).draw(data, {
});
data = createDataTable('datetime');
- new Dygraph.GVizChart(
+ var chart2 = new Dygraph.GVizChart(
document.getElementById('dygraphs_datetime')).draw(data, {
});
}
- new Dygraph(
+ var g = new Dygraph(
document.getElementById("div_g"),
data,
{
</tr></table>
<script type="text/javascript">
- new Dygraph(
+ var g1 = new Dygraph(
document.getElementById("graph"),
[
[1, null, 3],
<div class="codeoutput" style="float:left;">
<div id="zoomdiv"></div>
<script type="text/javascript">
- new Dygraph(
+ var g = new Dygraph(
// containing div
document.getElementById("zoomdiv"),
<body>
<div id="graph"></div>
<script type="text/javascript">
- new Dygraph(
+ var g = new Dygraph(
document.getElementById("graph"),
[
[ 1, 10, 11],
suffixes[magnitude];
}
- new Dygraph(document.getElementById("labelsKMB"), data, { labelsKMB: true });
- new Dygraph(document.getElementById("labelsKMG2"), data, { labelsKMG2: true });
- var g = new Dygraph(document.getElementById("labelsKMG2yValueFormatter"), data,
+ var g = new Dygraph(document.getElementById("labelsKMB"), data, { labelsKMB: true });
+ var g2 = new Dygraph(document.getElementById("labelsKMG2"), data, { labelsKMG2: true });
+ var g3 = new Dygraph(document.getElementById("labelsKMG2yValueFormatter"), data,
{ labelsKMG2: true, yValueFormatter: formatValue });
</script>
</body>
pos.push([i, 1000 + 2 * i, 1100 + i]);
}
- new Dygraph(
+ var g1 = new Dygraph(
document.getElementById("g1"),
negs, { labels: [ 'x', 'y1', 'y2' ] }
);
- new Dygraph(
+ var g2 = new Dygraph(
document.getElementById("g2"),
mixed, { labels: [ 'x', 'y1', 'y2' ] }
);
- new Dygraph(
+ var g3 = new Dygraph(
document.getElementById("g3"),
pos, { labels: [ 'x', 'y1', 'y2' ] }
);
<div id="blah2"></div>
<script type="text/javascript">
- new Dygraph(document.getElementById("blah"),
+ var g1 = new Dygraph(document.getElementById("blah"),
"X,Y\n10,12345\n11,12345\n",
{ width: 640, height: 480 });
- new Dygraph(document.getElementById("blah2"),
+ var g2 = new Dygraph(document.getElementById("blah2"),
"date,10M\n" +
"20021229,10000000.000000\n" +
"20030105,10000000.000000\n" +
function drawVisualization() {
data = createDataTable('date');
- new Dygraph.GVizChart(
+ var chart = new Dygraph.GVizChart(
document.getElementById('dygraphs_gviz')).draw(data, {
});
- new Dygraph(document.getElementById('dygraphs'), csv);
+ var graph = new Dygraph(document.getElementById('dygraphs'), csv);
}
google.setOnLoadCallback(drawVisualization);
return "date," + label + "\n20091206,2659329.631743\n20091213,2772361.123362\n20091220,2737584.647191\n20091227,2720000.550414\n20100103,2910306.897977\n20100110,2901385.313093\n20100117,2903041.312099\n20100124,2966455.128911\n";
}
- new Dygraph(document.getElementById("blah"),
+ var g1 = new Dygraph(document.getElementById("blah"),
CSV,
{
width: 640,
str += data[i].join(",") + "\n";
}
- new Dygraph(document.getElementById("blah2"),
+ var g2 = new Dygraph(document.getElementById("blah2"),
str,
{ labels: [ "date", "zero", "non-zero" ] });
</script>
</p>
<script type="text/javascript">
- new Dygraph(
+ var g2 = new Dygraph(
document.getElementById("div_spark"),
data, {
drawXAxis: false,
"2009/07/12 06:00:00,4,6"
}
- new Dygraph(
+ var g1 = new Dygraph(
document.getElementById("normal"),
HourlyData()
);
- new Dygraph(
+ var g2 = new Dygraph(
document.getElementById("offby2"),
HourlyData(),
{
}
});
- new Dygraph(
+ var g3 = new Dygraph(
document.getElementById("seconds"),
HourlyData(),
{
(this was more of a problem before dygraphs automatically switched to scientific notation)</p>
<div id="graph1"></div>
<script type="text/javascript">
- new Dygraph(
+ var g1 = new Dygraph(
document.getElementById("graph1"),
[
[1, 0.0],
<p>The solution using a Y axis formatting function:</p>
<div id="graph2"></div>
<script type="text/javascript">
- new Dygraph(
+ var g2 = new Dygraph(
document.getElementById("graph2"),
[
[1, 0.0],
<p>Different yValueFormatter and yAxisLabelFormatter functions:</p>
<div id="graph3"></div>
<script type="text/javascript">
- new Dygraph(
+ var g3 = new Dygraph(
document.getElementById("graph3"),
[
[1, 0.0],
<div id="graphdiv" style="width:600px; height:300px;"></div>
<script type="text/javascript">
- new Dygraph(document.getElementById("graphdiv"),
+ var g = new Dygraph(document.getElementById("graphdiv"),
document.getElementById("data").innerHTML,
{
customBars: true