forked from chartjs/Chart.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make line options scriptable (chartjs#6128)
- Loading branch information
1 parent
f7a3d65
commit d078119
Showing
59 changed files
with
1,054 additions
and
89 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
Binary file modified
BIN
+8.45 KB
(270%)
test/fixtures/controller.line/backgroundColor/scriptable.png
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions
68
test/fixtures/controller.line/borderCapStyle/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,68 @@ | ||
module.exports = { | ||
config: { | ||
type: 'line', | ||
data: { | ||
labels: [0, 1, 2, 3], | ||
datasets: [ | ||
{ | ||
// option in dataset | ||
data: [null, 3, 3], | ||
borderCapStyle: function(ctx) { | ||
var index = (ctx.datasetIndex % 2); | ||
return index === 0 ? 'round' | ||
: index === 1 ? 'square' | ||
: 'butt'; | ||
} | ||
}, | ||
{ | ||
// option in element (fallback) | ||
data: [null, 2, 2], | ||
}, | ||
{ | ||
// option in element (fallback) | ||
data: [null, 1, 1], | ||
} | ||
] | ||
}, | ||
options: { | ||
legend: false, | ||
title: false, | ||
elements: { | ||
line: { | ||
borderCapStyle: function(ctx) { | ||
var index = (ctx.datasetIndex % 3); | ||
return index === 0 ? 'round' | ||
: index === 1 ? 'square' | ||
: 'butt'; | ||
}, | ||
borderColor: '#ff0000', | ||
borderWidth: 32, | ||
fill: false | ||
}, | ||
point: { | ||
radius: 10, | ||
} | ||
}, | ||
layout: { | ||
padding: 32 | ||
}, | ||
scales: { | ||
xAxes: [{display: false}], | ||
yAxes: [ | ||
{ | ||
display: false, | ||
ticks: { | ||
beginAtZero: true | ||
} | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
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,52 @@ | ||
module.exports = { | ||
config: { | ||
type: 'line', | ||
data: { | ||
labels: [0, 1, 2, 3], | ||
datasets: [ | ||
{ | ||
// option in dataset | ||
data: [null, 3, 3], | ||
borderCapStyle: 'round', | ||
}, | ||
{ | ||
// option in dataset | ||
data: [null, 2, 2], | ||
borderCapStyle: 'square', | ||
}, | ||
{ | ||
// option in element (fallback) | ||
data: [null, 1, 1], | ||
} | ||
] | ||
}, | ||
options: { | ||
legend: false, | ||
title: false, | ||
elements: { | ||
line: { | ||
borderCapStyle: 'butt', | ||
borderColor: '#00ff00', | ||
borderWidth: 32, | ||
fill: false, | ||
}, | ||
point: { | ||
radius: 10, | ||
} | ||
}, | ||
layout: { | ||
padding: 32 | ||
}, | ||
scales: { | ||
xAxes: [{display: false}], | ||
yAxes: [{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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.