*gridLines*.display | Boolean | true |
*gridLines*.color | Color | "rgba(0, 0, 0, 0.1)" | Color of the grid lines.
*gridLines*.lineWidth | Number | 1 | Stroke width of grid lines
+*gridLines*.drawBorder | Boolean | true | If true draw border on the edge of the chart
*gridLines*.drawOnChartArea | Boolean | true | If true, draw lines on the chart area inside the axis lines. This is useful when there are multiple axes and you need to control which grid lines are drawn
*gridLines*.drawTicks | Boolean | true | If true, draw lines beside the ticks in the axis area beside the chart.
*gridLines*.tickMarkLength | Number | 10 | Length in pixels that the grid lines will draw into the axis area.
*ticks*.fontFamily | String | "Helvetica Neue" | Font family for the tick labels, follows CSS font-family options.
*ticks*.fontSize | Number | 12 | Font size for the tick labels.
*ticks*.fontStyle | String | "normal" | Font style for the tick labels, follows CSS font-style options (i.e. normal, italic, oblique, initial, inherit).
-*ticks*.minRotation | Number | 0 | Minimum rotation for tick labels
+*ticks*.minRotation | Number | 0 | Minimum rotation for tick labels
*ticks*.maxRotation | Number | 90 | Maximum rotation for tick labels when rotating to condense labels. Note: Rotation doesn't occur until necessary. *Note: Only applicable to horizontal scales.*
*ticks*.minRotation | Number | 20 | *currently not-implemented* Minimum rotation for tick labels when condensing is necessary. *Note: Only applicable to horizontal scales.*
*ticks*.maxTicksLimit | Number | 11 | Maximum number of ticks and gridlines to show. If not defined, it will limit to 11 ticks but will show all gridlines.
*ticks*.display | Boolean | true | If true, show the ticks.
*ticks*.suggestedMin | Number | - | User defined minimum number for the scale, overrides minimum value *except for if* it is higher than the minimum value.
*ticks*.suggestedMax | Number | - | User defined maximum number for the scale, overrides maximum value *except for if* it is lower than the maximum value.
-*ticks*.min | Number | - | User defined minimum number for the scale, overrides minimum value.
+*ticks*.min | Number | - | User defined minimum number for the scale, overrides minimum value.
*ticks*.max | Number | - | User defined maximum number for the scale, overrides maximum value
*ticks*.autoSkip | Boolean | true | If true, automatically calculates how many labels that can be shown and hides labels accordingly. Turn it off to show all labels no matter what
*ticks*.callback | Function | `function(value) { return '' + value; } ` | Returns the string representation of the tick value as it should be displayed on the chart.
display: true,
color: "rgba(0, 0, 0, 0.1)",
lineWidth: 1,
+ drawBorder: true,
drawOnChartArea: true,
drawTicks: true,
tickMarkLength: 10,
}
}
- // Draw the line at the edge of the axis
- context.lineWidth = gridLines.lineWidth;
- context.strokeStyle = gridLines.color;
- var x1 = this.left,
- x2 = this.right,
- y1 = this.top,
- y2 = this.bottom;
+ if (gridLines.drawBorder) {
+ // Draw the line at the edge of the axis
+ context.lineWidth = gridLines.lineWidth;
+ context.strokeStyle = gridLines.color;
+ var x1 = this.left,
+ x2 = this.right,
+ y1 = this.top,
+ y2 = this.bottom;
- var aliasPixel = helpers.aliasPixel(context.lineWidth);
- if (this.isHorizontal()) {
- y1 = y2 = options.position === 'top' ? this.bottom : this.top;
- y1 += aliasPixel;
- y2 += aliasPixel;
- } else {
- x1 = x2 = options.position === 'left' ? this.right : this.left;
- x1 += aliasPixel;
- x2 += aliasPixel;
- }
+ var aliasPixel = helpers.aliasPixel(context.lineWidth);
+ if (this.isHorizontal()) {
+ y1 = y2 = options.position === 'top' ? this.bottom : this.top;
+ y1 += aliasPixel;
+ y2 += aliasPixel;
+ } else {
+ x1 = x2 = options.position === 'left' ? this.right : this.left;
+ x1 += aliasPixel;
+ x2 += aliasPixel;
+ }
- context.beginPath();
- context.moveTo(x1, y1);
- context.lineTo(x2, y2);
- context.stroke();
+ context.beginPath();
+ context.moveTo(x1, y1);
+ context.lineTo(x2, y2);
+ context.stroke();
+ }
}
});
};
gridLines: {
color: "rgba(0, 0, 0, 0.1)",
+ drawBorder: true,
drawOnChartArea: true,
drawTicks: true, // draw ticks extending towards the label
tickMarkLength: 10,
gridLines: {
color: "rgba(0, 0, 0, 0.1)",
+ drawBorder: true,
drawOnChartArea: true,
drawTicks: true, // draw ticks extending towards the label,
tickMarkLength: 10,
gridLines: {
color: "rgba(0, 0, 0, 0.1)",
+ drawBorder: true,
drawOnChartArea: true,
drawTicks: true, // draw ticks extending towards the label
tickMarkLength: 10,
gridLines: {
color: "rgba(0, 0, 0, 0.1)",
+ drawBorder: true,
drawOnChartArea: true,
drawTicks: true, // draw ticks extending towards the label
tickMarkLength: 10,
display: true,
gridLines: {
color: "rgba(0, 0, 0, 0.1)",
+ drawBorder: true,
drawOnChartArea: true,
drawTicks: true,
tickMarkLength: 10,
display: true,
gridLines: {
color: "rgba(0, 0, 0, 0.1)",
+ drawBorder: true,
drawOnChartArea: true,
drawTicks: true,
tickMarkLength: 10,
display: true,
gridLines: {
color: "rgba(0, 0, 0, 0.1)",
+ drawBorder: true,
drawOnChartArea: true,
drawTicks: true,
tickMarkLength: 10,