-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Candle chart - make the shadow same color as an increasing/decreasing candle color #122
Comments
I've had the same requirement and altered the CandleStickChartRenderer almost identically to your solution. However, what is missing is the case for e.open == e.close, so a neutral shadow color. |
Nice catch @AlBirdie, I guess we could use something like: var shadowColor = dataSet.shadowColor ?? dataSet.colorAt(j); |
Yes, that's it. :) |
On top of that it is customary to draw a horizontal line when the candle height is zero, I've added this feature as well |
I'm developing a financial app, it is customary to color the candle shadow the same color as the candle itself. e.g. green/red for increasing/decreasing.
I've managed to accomplish that by adding the following code:
A. CandleChartDataSet line 31
/// use candle color for the shadow
public var makeShadowSameColorAsCandle = false
B. CandleStickChartRenderer - drawDataSet (line 104) changed from:
CGContextSetStrokeColorWithColor(context, (dataSet.shadowColor ?? dataSet.colorAt(j)).CGColor);
to
Could you please add it to the master ?
The text was updated successfully, but these errors were encountered: