forked from rfunduk/flot
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change the data format from [x,y] to {x:x,y:y}. This allows us to do …
…things like {x:x,y:y,delta:d} without having to 'hack' extra data in. This is especially handy for access inside hints. You can use datapoint.whatever for whatever you like. Backwards compatibility is kept with the old data format (it will get normalized inside the library to the new style). This commit also fixes/changes a couple of the examples to demonstrate/make them work (in the case of deltas, for example).
- Loading branch information
Showing
5 changed files
with
138 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
|
||
<html> | ||
<head> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | ||
<title>Flot Examples</title> | ||
<link href="layout.css" rel="stylesheet" type="text/css"></link> | ||
<!--[if IE]><script language="javascript" type="text/javascript" src="../excanvas.pack.js"></script><![endif]--> | ||
<script language="javascript" type="text/javascript" src="../jquery.js"></script> | ||
<script language="javascript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script> | ||
<script language="javascript" type="text/javascript" src="../jquery.flot.js"></script> | ||
</head> | ||
<body> | ||
<h1>Flot Examples</h1> | ||
|
||
<div id="placeholder" style="width:600px;height:300px;"></div> | ||
<script type="text/javascript"> | ||
$(document).ready( function () { | ||
var d1 = []; | ||
for( var i = 0; i < 14; i += 0.5 ) { | ||
d1.push( { x: i, y: Math.sin(i) } ); | ||
} | ||
|
||
<p>Simple example. You don't need to specify much to get an | ||
attractive look. Put in a placeholder, make sure you set its | ||
dimensions (otherwise the plot library will barf) and call the | ||
plot function with the data. The axes are automatically | ||
scaled.</p> | ||
var d2 = [ [0, 3], [4, 8], [8, 5], [9, 13] ]; | ||
|
||
<script id="source" language="javascript" type="text/javascript"> | ||
$(function () { | ||
var d1 = []; | ||
for (var i = 0; i < 14; i += 0.5) | ||
d1.push([i, Math.sin(i)]); | ||
// a null signifies separate line segments | ||
var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]]; | ||
|
||
var d2 = [[0, 3], [4, 8], [8, 5], [9, 13]]; | ||
$.plot( $("#placeholder"), [ d1, d2, d3 ] ); | ||
} ); | ||
</script> | ||
</head> | ||
<body> | ||
<h1>Flot Examples</h1> | ||
|
||
// a null signifies separate line segments | ||
var d3 = [[0, 12], [7, 12], null, [7, 2.5], [12, 2.5]]; | ||
|
||
$.plot($("#placeholder"), [ d1, d2, d3 ]); | ||
}); | ||
</script> | ||
<div id="placeholder" style="width:600px;height:300px;"></div> | ||
|
||
<p> | ||
Simple example. You don't need to specify much to get an | ||
attractive look. Put in a placeholder, make sure you set its | ||
dimensions (otherwise the plot library will barf) and call the | ||
plot function with the data. The axes are automatically | ||
scaled. | ||
</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.