labels: {
// Boolean - if true show labels
show: true,
+
+ // Boolean - if true the chart will mirror the axis labels. If the labels are on the left, mirroring the axis will render them to the right
+ mirror: false,
+
+ // Number - controls the padding between the label and the axis
+ padding: 10,
// String - template string for labels
template: "<%=value%>",
// label settings
labels: {
show: true,
+ mirror: false,
+ padding: 10,
template: "<%=value.toLocaleString()%>",
fontSize: 12,
fontStyle: "normal",
fontColor: "#666",
- fontFamily: "Helvetica Neue",
+ fontFamily: "Helvetica Neue"
}
};
var labelStartX;
if (this.options.position == "left") {
- labelStartX = this.right - 10;
- this.ctx.textAlign = "right";
+ if (this.options.labels.mirror) {
+ labelStartX = this.right + this.options.labels.padding;
+ this.ctx.textAlign = "left";
+ } else {
+ labelStartX = this.right - this.options.labels.padding;
+ this.ctx.textAlign = "right";
+ }
} else {
// right side
- labelStartX = this.left + 5;
- this.ctx.textAlign = "left";
+ if (this.options.labels.mirror) {
+ labelStartX = this.left - this.options.labels.padding;
+ this.ctx.textAlign = "right";
+ } else {
+ labelStartX = this.left + this.options.labels.padding;
+ this.ctx.textAlign = "left";
+ }
}
this.ctx.textBaseline = "middle";