summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
36b7208)
* Provide option to set color and width for annotation line
* documentation for new annotation options
<tr><td><code>height</code></td><td>Height (in pixels) of the annotation flag or icon.</td></tr>
<tr><td><code>cssClass</code></td><td>CSS class to use for styling the annotation.</td></tr>
<tr><td><code>tickHeight</code></td><td>Height of the tick mark (in pixels) connecting the point to its flag or icon.</td></tr>
<tr><td><code>height</code></td><td>Height (in pixels) of the annotation flag or icon.</td></tr>
<tr><td><code>cssClass</code></td><td>CSS class to use for styling the annotation.</td></tr>
<tr><td><code>tickHeight</code></td><td>Height of the tick mark (in pixels) connecting the point to its flag or icon.</td></tr>
+<tr><td><code>tickWidth</code></td><td>Width of the tick mark connecting the point to its flag or icon.</td></tr>
+<tr><td><code>tickColor</code></td><td>Color of the tick mark connecting the point to its flag or icon.</td></tr>
<tr><td><code>attachAtBottom</code></td><td>If true, attach annotations to the x-axis, rather than to actual points.</td></tr>
<tr><td><code>clickHandler</code></td> <td>See Handlers, below</td></tr>
<tr><td><code>mouseOverHandler</code></td><td>See Handlers, below</td></tr>
<tr><td><code>attachAtBottom</code></td><td>If true, attach annotations to the x-axis, rather than to actual points.</td></tr>
<tr><td><code>clickHandler</code></td> <td>See Handlers, below</td></tr>
<tr><td><code>mouseOverHandler</code></td><td>See Handlers, below</td></tr>
var ctx = e.drawingContext;
ctx.save();
var ctx = e.drawingContext;
ctx.save();
- ctx.strokeStyle = g.colorsMap_[p.name];
+ ctx.strokeStyle = a.hasOwnProperty('tickColor') ? a.tickColor : g.colorsMap_[p.name];
+ ctx.lineWidth = a.hasOwnProperty('tickWidth') ? a.tickWidth : g.getOption('strokeWidth');
ctx.beginPath();
if (!a.attachAtBottom) {
ctx.moveTo(p.canvasx, p.canvasy);
ctx.beginPath();
if (!a.attachAtBottom) {
ctx.moveTo(p.canvasx, p.canvasy);
width: 18,
height: 23,
tickHeight: 4,
width: 18,
height: 23,
tickHeight: 4,
+ tickColor: 'indianred',
+ tickWidth: 2,
text: 'Another one',
cssClass: 'annotation',
clickHandler: function() {
text: 'Another one',
cssClass: 'annotation',
clickHandler: function() {