Skip to content

Conversation

touletan
Copy link
Contributor

@touletan touletan commented Sep 30, 2017

Replaced by
New Pull Request

| `hoverBackgroundColor` | `Color[]` | The fill colour of the arcs when hovered.
| `hoverBorderColor` | `Color[]` | The stroke colour of the arcs when hovered.
| `hoverBorderWidth` | `Number[]` | The stroke width of the arcs when hovered.
| `legendSymbol` | `String[]` | Symbol to display as label when usePointStyle is false (size is based on fontSize except for large symbol (ending with Lg) where boxWidth is used in this case). Values are rectLg, lineLg, rectRoundedLg and other values from [PointStyle](./elements.md/#point-styles)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might make sense to split large vs small into a separate boolean.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or, if boxWidth is defined, use it else use the fontSize

@touletan
Copy link
Contributor Author

touletan commented Oct 3, 2017

New legendSymbolLarge property has been added.

var fontSize = helpers.valueOrDefault(opts.fontSize, defaults.global.defaultFontSize);
return helpers.isArray(data.datasets) ? data.datasets.map(function(dataset, i) {
var itemLegendSymbol = (opts.usePointStyle && (dataset.pointStyle || defaults.global.elements.point.pointStyle)) || dataset.legendSymbol || (opts.legendSymbol);
var itemLegendSymbolLarge = typeof dataset.legendSymbolLarge !== 'undefined' ? dataset.legendSymbolLarge : (typeof opts.legendSymbolLarge !== 'undefined' ? opts.legendSymbolLarge : (opts.usePointStyle ? false : true));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be able to use helpers.getValueOrDefault since this pattern is used in a few places.

pointStyle: dataset.pointStyle,
legendSymbol: itemLegendSymbol,
boxWidth: (opts.usePointStyle && (fontSize * Math.SQRT2)) || (itemLegendSymbol.slice(-2) === 'Lg' ? opts.boxWidth : (fontSize * Math.SQRT2)),
legendSymbol: (opts.usePointStyle && (dataset.pointStyle || defaults.global.elements.point.pointStyle)) || dataset.legendSymbol || (opts.legendSymbol),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does legendSymbol negate the need for the pointStyle property on the line above? If so, is removing it a breaking change?

var type, edgeLength, xOffset, yOffset, height, size;
drawPoint: function(ctx, style, width, fontSize, x, y, isLineWidthZero) {

<<<<<<< HEAD
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a bad merge here


drawPoint: function(ctx, style, radius, x, y) {
var type, edgeLength, xOffset, yOffset, height, size;
drawPoint: function(ctx, style, width, fontSize, x, y, isLineWidthZero) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't knw that fontSize should be a param here. height makes a lot more sense.

@touletan touletan closed this Oct 3, 2017
@touletan
Copy link
Contributor Author

touletan commented Oct 3, 2017

I will reopen a new one.....

@touletan touletan changed the title Legend Symbol Parameter [New Feature] Legend Symbol Parameter [deleted] Oct 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants