-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow spanning data gaps for radar charts #5075
Changes from 4 commits
362470c
90c2742
85ac7e7
9f769b4
5ad2ba9
0f859e7
3084a9e
2df76e4
4bea405
23468aa
2a6b81c
b28d11e
936c822
7b2a8d2
374e220
88ec1f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,6 +30,7 @@ module.exports = function(Chart) { | |
var meta = me.getMeta(); | ||
var line = meta.dataset; | ||
var points = meta.data; | ||
var options = me.chart.options; | ||
var custom = line.custom || {}; | ||
var dataset = me.getDataset(); | ||
var lineElementOptions = me.chart.options.elements.line; | ||
|
@@ -50,6 +51,8 @@ module.exports = function(Chart) { | |
// Model | ||
_model: { | ||
// Appearance | ||
// This option gives lines the ability to span gaps | ||
spanGaps: dataset.spanGaps ? dataset.spanGaps : options.spanGaps, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't work because if both options are defined, we want priority for the dataset one, but if |
||
tension: custom.tension ? custom.tension : helpers.valueOrDefault(dataset.lineTension, lineElementOptions.tension), | ||
backgroundColor: custom.backgroundColor ? custom.backgroundColor : (dataset.backgroundColor || lineElementOptions.backgroundColor), | ||
borderWidth: custom.borderWidth ? custom.borderWidth : (dataset.borderWidth || lineElementOptions.borderWidth), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -268,8 +268,11 @@ module.exports = function(Chart) { | |
|
||
// Keep this in loop since we may support array properties here | ||
var pointLabelFontColor = valueOrDefault(pointLabelOpts.fontColor, globalDefaults.defaultFontColor); | ||
var pointLabelFontColorFormatted = helpers.isArray(pointLabelFontColor) ? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be simply: var pointLabelFontColor = helpers.valueAtIndexOrDefault(pointLabelOpts.fontColor, i, globalDefaults.defaultFontColor); There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, thanks! |
||
pointLabelFontColor[i] : pointLabelFontColor; | ||
|
||
ctx.font = plFont.font; | ||
ctx.fillStyle = pointLabelFontColor; | ||
ctx.fillStyle = pointLabelFontColorFormatted; | ||
|
||
var angleRadians = scale.getIndexAngle(i); | ||
var angle = helpers.toDegrees(angleRadians); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] looks like the backticks got duplicated on each side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry about that, just pushed a fix up