-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add borderDash options to arc element (#11127)
- Loading branch information
1 parent
6cf9de9
commit 7f9bca6
Showing
14 changed files
with
186 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
test/fixtures/controller.doughnut/borderDash/scriptable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module.exports = { | ||
config: { | ||
type: 'doughnut', | ||
data: { | ||
labels: [0, 1, 2, 3, 4, 5], | ||
datasets: [ | ||
{ | ||
// option in element (fallback) | ||
data: [5, 2, 4, 7, 6, 8] | ||
} | ||
] | ||
}, | ||
options: { | ||
elements: { | ||
arc: { | ||
backgroundColor: 'transparent', | ||
borderColor: 'black', | ||
borderWidth: 1, | ||
borderDash: function(ctx) { | ||
var value = (ctx.dataIndex || 0) % 2; | ||
return value === 0 ? [3, 3] : []; | ||
} | ||
|
||
} | ||
}, | ||
} | ||
}, | ||
options: { | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module.exports = { | ||
config: { | ||
type: 'polarArea', | ||
data: { | ||
labels: [0, 1, 2, 3, 4, 5], | ||
datasets: [ | ||
{ | ||
// option in dataset | ||
data: [5, 2, 4, 7, 6, 8], | ||
borderAlign: 'inner', | ||
borderColor: 'black' | ||
}, | ||
] | ||
}, | ||
options: { | ||
elements: { | ||
arc: { | ||
backgroundColor: 'transparent', | ||
borderWidth: 1, | ||
borderDash: [3, 3] | ||
} | ||
}, | ||
scales: { | ||
r: { | ||
display: false | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions
38
test/fixtures/controller.polarArea/borderDash/scriptable.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module.exports = { | ||
config: { | ||
type: 'polarArea', | ||
data: { | ||
labels: [0, 1, 2, 3, 4, 5], | ||
datasets: [ | ||
{ | ||
// option in dataset | ||
data: [5, 2, 4, 7, 6, 8] | ||
} | ||
] | ||
}, | ||
options: { | ||
elements: { | ||
arc: { | ||
backgroundColor: 'transparent', | ||
borderColor: 'black', | ||
borderWidth: 1, | ||
borderDash: function(ctx) { | ||
var value = (ctx.dataIndex || 0) % 2; | ||
return value === 0 ? [3, 3] : []; | ||
} | ||
} | ||
}, | ||
scales: { | ||
r: { | ||
display: false | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module.exports = { | ||
config: { | ||
type: 'polarArea', | ||
data: { | ||
labels: [0, 1, 2, 3, 4, 5], | ||
datasets: [ | ||
{ | ||
// option in dataset | ||
data: [5, 2, 4, 7, 6, 8], | ||
borderAlign: 'inner', | ||
borderColor: 'black' | ||
}, | ||
] | ||
}, | ||
options: { | ||
elements: { | ||
arc: { | ||
backgroundColor: 'transparent', | ||
borderWidth: 1, | ||
borderDash: [3, 3] | ||
} | ||
}, | ||
scales: { | ||
r: { | ||
display: false | ||
} | ||
} | ||
} | ||
}, | ||
options: { | ||
canvas: { | ||
height: 256, | ||
width: 512 | ||
} | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.