if (labelOpts && labelOpts.usePointStyle) {
// Recalculate x and y for drawPoint() because its expecting
// x and y to be center of figure (instead of top left)
- var radius = boxWidth * Math.SQRT2 / 2;
+ const drawOptions = {
+ radius: boxWidth * Math.SQRT2 / 2,
+ pointStyle: legendItem.pointStyle,
+ rotation: legendItem.rotation,
+ borderWidth: lineWidth
+ };
var centerX = rtlHelper.xPlus(x, boxWidth / 2);
var centerY = y + fontSize / 2;
// Draw pointStyle as legend symbol
- helpers.canvas.drawPoint(ctx, legendItem.pointStyle, radius, centerX, centerY, legendItem.rotation);
+ helpers.canvas.drawPoint(ctx, drawOptions, centerX, centerY);
} else {
// Draw box as legend symbol
ctx.fillRect(rtlHelper.leftForLtr(x, boxWidth), y, boxWidth, fontSize);