Closed jimijon closed 7 years ago
It seems to me that the colours are currently hardcoded in ChartCandleStickLayer.generateScreenItems()
and cannot be customized currently.
The code setting the colours based on whether the stick is decreasing or increasing is this one (adjusted to using red + green):
let (rectTop, rectBottom, fillColor) = closeScreenY < openScreenY ? (closeScreenY, openScreenY, UIColor.green) : (openScreenY, closeScreenY, UIColor.red)
.
So either you can copy that file over to your project and customize it or you fork this project and adjust ChartCandleStickLayer
to allow setting those colours in init
.
Edit: I created a pull request allowing to customize the fill colours here: https://github.com/i-schuetz/SwiftCharts/pull/299
Pull request merged - closing this.
It seems like ChartCandleStickLayer has hard coded the fill colors of black and white for the candle in the candlestick chart.
What is the proper way to change this color?