This will allow the configuration of bar color properties in Typescript/Angular sites where typings are needed. For example:
// sample usage
let candleOptions = Chart.defaults.elements["candlestick"];
// sets body color
candleOptions.color.up = 'blue';
candleOptions.color.down = 'orange';
myConfig.data = {
datasets: [
{
type: 'candlestick',
label: 'Price',
data: price,
borderColor: { // set border and wicks color
up: candleOptions.color.up,
down: candleOptions.color.down,
unchanged: candleOptions.color.unchanged
},
yAxisID: 'yAxis'
}
]
};
Additional comments
I'm not a JS expert, so please treat this as a suggestion. There may be a better way to handle it. This approach seems to be a bit of a hack. I have two other suggestions here:
Make this the default so you'd only need to provide borderColor if you wanted a consistently colored border.
Allow use of backgroundColor in a similar up/down/unchanged format. Overriding Chart.defaults.elements["candlestick"] as shown in my example (above) is less intuitive.
Description
Fixes #114
Adding custom
CandlestickControllerDatasetOptions
typings to replace use ofBarControllerDatasetOptions
to allow for uniqueborderColor
type:This will allow the configuration of bar color properties in Typescript/Angular sites where typings are needed. For example:
Additional comments
I'm not a JS expert, so please treat this as a suggestion. There may be a better way to handle it. This approach seems to be a bit of a hack. I have two other suggestions here:
Make this the default so you'd only need to provide
borderColor
if you wanted a consistently colored border.Allow use of
backgroundColor
in a similar up/down/unchanged format. OverridingChart.defaults.elements["candlestick"]
as shown in my example (above) is less intuitive.