// grid line settings
gridLines: {
- show: true,
+ display: true,
color: "rgba(0, 0, 0, 0.1)",
lineWidth: 1,
drawOnChartArea: true,
labelString: '',
// display property
- show: false,
+ display: false,
},
// label settings
mirror: false,
padding: 10,
reverse: false,
- show: true,
+ display: true,
callback: function(value) {
return '' + value;
},
if (this.isHorizontal()) {
this.minSize.width = this.maxWidth; // fill all the width
} else {
- this.minSize.width = this.options.gridLines.show && this.options.display ? 10 : 0;
+ this.minSize.width = this.options.gridLines.display && this.options.display ? 10 : 0;
}
// height
if (this.isHorizontal()) {
- this.minSize.height = this.options.gridLines.show && this.options.display ? 10 : 0;
+ this.minSize.height = this.options.gridLines.display && this.options.display ? 10 : 0;
} else {
this.minSize.height = this.maxHeight; // fill all the height
}
// Are we showing a title for the scale?
- if (this.options.scaleLabel.show) {
+ if (this.options.scaleLabel.display) {
if (this.isHorizontal()) {
this.minSize.height += (this.options.scaleLabel.fontSize * 1.5);
} else {
}
}
- if (this.options.ticks.show && this.options.display) {
+ if (this.options.ticks.display && this.options.display) {
// Don't bother fitting the ticks if we are not showing them
var labelFont = helpers.fontString(this.options.ticks.fontSize,
this.options.ticks.fontStyle, this.options.ticks.fontFamily);
var xLineValue = this.getPixelForTick(index); // xvalues for grid lines
var xLabelValue = this.getPixelForTick(index, this.options.gridLines.offsetGridLines); // x values for ticks (need to consider offsetLabel option)
- if (this.options.gridLines.show) {
+ if (this.options.gridLines.display) {
if (index === (typeof this.zeroLineIndex !== 'undefined' ? this.zeroLineIndex : 0)) {
// Draw the first index specially
this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;
this.ctx.stroke();
}
- if (this.options.ticks.show) {
+ if (this.options.ticks.display) {
this.ctx.save();
this.ctx.translate(xLabelValue, (isRotated) ? this.top + 12 : this.options.position === "top" ? this.bottom - 10 : this.top + 10);
this.ctx.rotate(helpers.toRadians(this.labelRotation) * -1);
}
}, this);
- if (this.options.scaleLabel.show) {
+ if (this.options.scaleLabel.display) {
// Draw the scale label
this.ctx.textAlign = "center";
this.ctx.textBaseline = 'middle';
var yLineValue = this.getPixelForTick(index); // xvalues for grid lines
- if (this.options.gridLines.show) {
+ if (this.options.gridLines.display) {
if (index === (typeof this.zeroLineIndex !== 'undefined' ? this.zeroLineIndex : 0)) {
// Draw the first index specially
this.ctx.lineWidth = this.options.gridLines.zeroLineWidth;
this.ctx.stroke();
}
- if (this.options.ticks.show) {
+ if (this.options.ticks.display) {
var xLabelValue;
var yLabelValue = this.getPixelForTick(index, this.options.gridLines.offsetGridLines); // x values for ticks (need to consider offsetLabel option)
}
}, this);
- if (this.options.scaleLabel.show) {
+ if (this.options.scaleLabel.display) {
// Draw the scale label
scaleLabelX = this.options.position == 'left' ? this.left + (this.options.scaleLabel.fontSize / 2) : this.right - (this.options.scaleLabel.fontSize / 2);
scaleLabelY = this.top + ((this.bottom - this.top) / 2);
position: "chartArea",
angleLines: {
- show: true,
+ display: true,
color: "rgba(0, 0, 0, 0.1)",
lineWidth: 1
},
var yHeight = this.yCenter - yCenterOffset;
// Draw circular lines around the scale
- if (this.options.gridLines.show) {
+ if (this.options.gridLines.display) {
ctx.strokeStyle = this.options.gridLines.color;
ctx.lineWidth = this.options.gridLines.lineWidth;
}
}
- if (this.options.ticks.show) {
+ if (this.options.ticks.display) {
ctx.font = helpers.fontString(this.options.ticks.fontSize, this.options.ticks.fontStyle, this.options.ticks.fontFamily);
if (this.options.ticks.showLabelBackdrop) {
ctx.strokeStyle = this.options.angleLines.color;
for (var i = this.getValueCount() - 1; i >= 0; i--) {
- if (this.options.angleLines.show) {
+ if (this.options.angleLines.display) {
var outerPosition = this.getPointPosition(i, this.getDistanceFromCenterForValue(this.options.reverse ? this.min : this.max));
ctx.beginPath();
ctx.moveTo(this.xCenter, this.yCenter);
drawTicks: true, // draw ticks extending towards the label
lineWidth: 1,
offsetGridLines: false,
- show: true,
+ display: true,
zeroLineColor: "rgba(0,0,0,0.25)",
zeroLineWidth: 1,
},
fontSize: 12,
fontStyle: 'normal',
labelString: '',
- show: false,
+ display: false,
},
ticks: {
beginAtZero: false,
mirror: false,
padding: 10,
reverse: false,
- show: true,
+ display: true,
callback: merged.scales.yAxes[1].ticks.callback, // make it nicer, then check explicitly below
},
type: 'linear'
drawTicks: true, // draw ticks extending towards the label
lineWidth: 1,
offsetGridLines: false,
- show: true,
+ display: true,
zeroLineColor: "rgba(0,0,0,0.25)",
zeroLineWidth: 1,
},
fontSize: 12,
fontStyle: 'normal',
labelString: '',
- show: false,
+ display: false,
},
ticks: {
beginAtZero: false,
mirror: false,
padding: 10,
reverse: false,
- show: true,
+ display: true,
callback: merged.scales.yAxes[2].ticks.callback, // make it nicer, then check explicitly below
},
type: 'linear'
drawTicks: true, // draw ticks extending towards the label
lineWidth: 1,
offsetGridLines: false,
- show: true,
+ display: true,
zeroLineColor: "rgba(0,0,0,0.25)",
zeroLineWidth: 1,
},
fontSize: 12,
fontStyle: 'normal',
labelString: '',
- show: false,
+ display: false,
},
ticks: {
beginAtZero: false,
mirror: false,
padding: 10,
reverse: false,
- show: true,
+ display: true,
callback: defaultConfig.ticks.callback, // make this nicer, then check explicitly below
}
});
drawTicks: true, // draw ticks extending towards the label
lineWidth: 1,
offsetGridLines: false,
- show: true,
+ display: true,
zeroLineColor: "rgba(0,0,0,0.25)",
zeroLineWidth: 1,
},
fontSize: 12,
fontStyle: 'normal',
labelString: '',
- show: false,
+ display: false,
},
ticks: {
beginAtZero: false,
mirror: false,
padding: 10,
reverse: false,
- show: true,
+ display: true,
callback: defaultConfig.ticks.callback, // make this work nicer, then check below
}
});
expect(verticalScale.paddingRight).toBe(0);
// Extra size when scale label showing
- config.scaleLabel.show = true;
+ config.scaleLabel.display = true;
minSize = verticalScale.update(100, 300);
expect(minSize).toEqual({
width: 58,
expect(horizontalScale.paddingRight).toBe(2);
// Extra size when scale label showing
- config.scaleLabel.show = true;
+ config.scaleLabel.display = true;
minSize = horizontalScale.update(200, 300);
expect(minSize).toEqual({
width: 200,
// Turn off some drawing
config.gridLines.drawTicks = false;
config.gridLines.drawOnChartArea = false;
- config.ticks.show = false;
- config.scaleLabel.show = true;
+ config.ticks.display = false;
+ config.scaleLabel.display = true;
config.scaleLabel.labelString = 'myLabel';
mockContext.resetCalls();
// Turn off some drawing
config.gridLines.drawTicks = false;
config.gridLines.drawOnChartArea = false;
- config.ticks.show = false;
- config.scaleLabel.show = true;
+ config.ticks.display = false;
+ config.scaleLabel.display = true;
mockContext.resetCalls();
drawTicks: true,
lineWidth: 1,
offsetGridLines: false,
- show: true,
+ display: true,
zeroLineColor: "rgba(0,0,0,0.25)",
zeroLineWidth: 1,
},
fontSize: 12,
fontStyle: 'normal',
labelString: '',
- show: false,
+ display: false,
},
ticks: {
beginAtZero: false,
mirror: false,
padding: 10,
reverse: false,
- show: true,
+ display: true,
callback: defaultConfig.ticks.callback, // make this nicer, then check explicitly below
},
});
var defaultConfig = Chart.scaleService.getScaleDefaults('radialLinear');
expect(defaultConfig).toEqual({
angleLines: {
- show: true,
+ display: true,
color: "rgba(0, 0, 0, 0.1)",
lineWidth: 1
},
drawTicks: true,
lineWidth: 1,
offsetGridLines: false,
- show: true,
+ display: true,
zeroLineColor: "rgba(0,0,0,0.25)",
zeroLineWidth: 1,
},
fontSize: 12,
fontStyle: 'normal',
labelString: '',
- show: false,
+ display: false,
},
ticks: {
backdropColor: "rgba(255,255,255,0.75)",
padding: 10,
reverse: false,
showLabelBackdrop: true,
- show: true,
+ display: true,
callback: defaultConfig.ticks.callback, // make this nicer, then check explicitly below
},
drawTicks: true,
lineWidth: 1,
offsetGridLines: false,
- show: true,
+ display: true,
zeroLineColor: "rgba(0,0,0,0.25)",
zeroLineWidth: 1,
},
fontSize: 12,
fontStyle: 'normal',
labelString: '',
- show: false,
+ display: false,
},
ticks: {
beginAtZero: false,
mirror: false,
padding: 10,
reverse: false,
- show: true,
+ display: true,
callback: defaultConfig.ticks.callback, // make this nicer, then check explicitly below
},
time: {