Commit 89ce1ca9 authored by olau@iola.dk's avatar olau@iola.dk

Introduce step-wise line charts, extending the data model to have (possibly)...

Introduce step-wise line charts, extending the data model to have (possibly) separate data sets for each graph type, and changing the line shadows to include a horizontal component


git-svn-id: https://flot.googlecode.com/svn/trunk@138 1e0a6537-2640-0410-bfb7-f154510ff394
parent c7288df5
...@@ -421,6 +421,10 @@ Customizing the data series ...@@ -421,6 +421,10 @@ Customizing the data series
align: "left" or "center" align: "left" or "center"
} }
lines: {
steps: boolean
}
colors: [ color1, color2, ... ] colors: [ color1, color2, ... ]
shadowSize: number shadowSize: number
...@@ -457,6 +461,10 @@ instance, for time series the unit is milliseconds so 24 * 60 * 60 * ...@@ -457,6 +461,10 @@ instance, for time series the unit is milliseconds so 24 * 60 * 60 *
a bar should be left-aligned (default) or centered on top of the value a bar should be left-aligned (default) or centered on top of the value
it represents. it represents.
For lines, "steps" specifies whether two adjacent data points are
connected with a straight (possibly diagonal) line or with first a
horizontal and then a vertical line.
The "colors" array specifies a default color theme to get colors for The "colors" array specifies a default color theme to get colors for
the data series from. You can specify as many colors as you like, like the data series from. You can specify as many colors as you like, like
this: this:
......
...@@ -40,10 +40,14 @@ Changes: ...@@ -40,10 +40,14 @@ Changes:
- The option legend.margin can now specify horizontal and vertical - The option legend.margin can now specify horizontal and vertical
margins independently (suggestion by someone who's annoyed). margins independently (suggestion by someone who's annoyed).
- Data passed into Flot is now copied to enable further processing - Data passed into Flot is now copied to a new canonical format to
before it hits the drawing routines. As a side-effect, this should enable further processing before it hits the drawing routines. As a
make Flot more robust in the face of bad data (and fixes issue 112). side-effect, this should make Flot more robust in the face of bad
data (and fixes issue 112).
- Step-wise charting: line charts have a new option "steps" that when
set to true connects the points with steps instead of diagonal lines.
Bug fixes: Bug fixes:
...@@ -77,6 +81,9 @@ Bug fixes: ...@@ -77,6 +81,9 @@ Bug fixes:
- Imported SVN version of excanvas and fixed an issue with the newer - Imported SVN version of excanvas and fixed an issue with the newer
version. Hopefully, this will make Flot work with IE8 (nudge by version. Hopefully, this will make Flot work with IE8 (nudge by
Fabien Menager). Fabien Menager).
- Changed the shadow code for lines to hopefully look a bit better
with vertical lines.
Flot 0.5 Flot 0.5
-------- --------
......
...@@ -36,7 +36,11 @@ $(function () { ...@@ -36,7 +36,11 @@ $(function () {
var d5 = []; var d5 = [];
for (var i = 0; i < 14; i += 0.5) for (var i = 0; i < 14; i += 0.5)
d5.push([i, Math.sqrt(i)]); d5.push([i, Math.sqrt(i)]);
var d6 = [];
for (var i = 0; i < 14; i += 0.5 + Math.random())
d6.push([i, Math.sqrt(2*i + Math.sin(i) + 5)]);
$.plot($("#placeholder"), [ $.plot($("#placeholder"), [
{ {
data: d1, data: d1,
...@@ -58,6 +62,10 @@ $(function () { ...@@ -58,6 +62,10 @@ $(function () {
data: d5, data: d5,
lines: { show: true }, lines: { show: true },
points: { show: true } points: { show: true }
},
{
data: d6,
lines: { show: true, steps: true }
} }
]); ]);
}); });
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment