Commit 0a3db845 authored by rlinehan's avatar rlinehan

Add option for lineJoin shape

This commit adds an option for the shape of the corners of the
selection rectangle. By default the shape is set to "round" (the
previous setting for lineJoin). The other options are "bevel" and
"miter".
parent 42286155
......@@ -7,14 +7,16 @@ The plugin supports these options:
selection: {
mode: null or "x" or "y" or "xy",
color: color
color: color,
shape: "round" or "miter" or "bevel"
}
Selection support is enabled by setting the mode to one of "x", "y" or "xy".
In "x" mode, the user will only be able to specify the x range, similarly for
"y" mode. For "xy", the selection becomes a rectangle where both ranges can be
specified. "color" is color of the selection (if you need to change the color
later on, you can get to it with plot.getOptions().selection.color).
later on, you can get to it with plot.getOptions().selection.color). "shape"
is the shape of the corners of the selection.
When selection support is enabled, a "plotselected" event will be emitted on
the DOM element you passed into the plot function. The event handler gets a
......@@ -305,7 +307,7 @@ The plugin allso adds the following methods to the plot object:
ctx.strokeStyle = c.scale('a', 0.8).toString();
ctx.lineWidth = 1;
ctx.lineJoin = "round";
ctx.lineJoin = o.selection.shape;
ctx.fillStyle = c.scale('a', 0.4).toString();
var x = Math.min(selection.first.x, selection.second.x) + 0.5,
......@@ -335,7 +337,8 @@ The plugin allso adds the following methods to the plot object:
options: {
selection: {
mode: null, // one of null, "x", "y" or "xy"
color: "#e8cfac"
color: "#e8cfac",
shape: "round" // one of "round", "miter", or "bevel"
}
},
name: 'selection',
......
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