Commit cc517f69 authored by olau@iola.dk's avatar olau@iola.dk

Added borderColor option, patch from achamayou

git-svn-id: https://flot.googlecode.com/svn/trunk@124 1e0a6537-2640-0410-bfb7-f154510ff394
parent edbec959
...@@ -477,6 +477,7 @@ Customizing the grid ...@@ -477,6 +477,7 @@ Customizing the grid
labelMargin: number labelMargin: number
markings: array of markings or (fn: axes -> array of markings) markings: array of markings or (fn: axes -> array of markings)
borderWidth: number borderWidth: number
borderColor: color or null
clickable: boolean clickable: boolean
hoverable: boolean hoverable: boolean
autoHighlight: boolean autoHighlight: boolean
...@@ -495,7 +496,8 @@ of the page with CSS. ...@@ -495,7 +496,8 @@ of the page with CSS.
between tick labels and the grid. Note that you can style the tick between tick labels and the grid. Note that you can style the tick
labels with CSS, e.g. to change the color. They have class "tickLabel". labels with CSS, e.g. to change the color. They have class "tickLabel".
"borderWidth" is the width of the border around the plot. Set it to 0 "borderWidth" is the width of the border around the plot. Set it to 0
to disable the border. to disable the border. You can also set "borderColor" if you want the
border to have a different color than the grid lines.
"markings" is used to draw simple lines and rectangular areas in the "markings" is used to draw simple lines and rectangular areas in the
background of the plot. You can either specify an array of ranges on background of the plot. You can either specify an array of ranges on
......
...@@ -25,6 +25,8 @@ Changes: ...@@ -25,6 +25,8 @@ Changes:
$.plot.formatDate(...) (suggestion by Matt Manela) and even $.plot.formatDate(...) (suggestion by Matt Manela) and even
replaced. replaced.
- Added "borderColor" option to the grid (patch from achamayou).
Bug fixes: Bug fixes:
- Fixed two corner-case bugs when drawing filled curves (report and - Fixed two corner-case bugs when drawing filled curves (report and
......
...@@ -79,7 +79,8 @@ ...@@ -79,7 +79,8 @@
backgroundColor: null, // null for transparent, else color backgroundColor: null, // null for transparent, else color
tickColor: "#dddddd", // color used for the ticks tickColor: "#dddddd", // color used for the ticks
labelMargin: 5, // in pixels labelMargin: 5, // in pixels
borderWidth: 2, borderWidth: 2, // in pixels
borderColor: null, // set if different from the grid color
markings: null, // array of ranges or fn: axes -> array of ranges markings: null, // array of ranges or fn: axes -> array of ranges
markingsColor: "#f4f4f4", markingsColor: "#f4f4f4",
markingsLineWidth: 2, markingsLineWidth: 2,
...@@ -967,7 +968,7 @@ ...@@ -967,7 +968,7 @@
if (options.grid.borderWidth) { if (options.grid.borderWidth) {
// draw border // draw border
ctx.lineWidth = options.grid.borderWidth; ctx.lineWidth = options.grid.borderWidth;
ctx.strokeStyle = options.grid.color; ctx.strokeStyle = options.grid.borderColor ? options.grid.borderColor : options.grid.color;
ctx.lineJoin = "round"; ctx.lineJoin = "round";
ctx.strokeRect(0, 0, plotWidth, plotHeight); ctx.strokeRect(0, 0, plotWidth, plotHeight);
} }
......
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