Add gradient bars for BarChart [master branch] #4411
Add gradient bars for BarChart [master branch] #4411larryonoff wants to merge 7 commits intoChartsOrg:masterfrom
Conversation
78706eb to
842b0d8
Compare
| if let set = chartView.data?.dataSets.first as? BarChartDataSet { | ||
| set1 = set | ||
| set1.replaceEntries(yVals) | ||
| setup(set) |
There was a problem hiding this comment.
let's rename to a more meaningful name to imply it's about setup gradient
| set.mode = (set.mode == .cubicBezier) ? .horizontalBezier : .cubicBezier | ||
| } | ||
| chartView.setNeedsDisplay() | ||
| case .toggleGradient: |
There was a problem hiding this comment.
is it possible for you to add the objc portion? (feel free to say no)
| if dataSet.drawBarGradientEnabled { | ||
| drawGradientBars(context: context, dataSet: dataSet, buffer: buffer, matrix: valueToPixelMatrix) | ||
| } else { | ||
| drawDefaultBars(context: context, dataSet: dataSet, dateSetIndex: index, buffer: buffer) |
There was a problem hiding this comment.
maybe drawNormalBars or standard bars, etc? not sure which is better. @jjatie idea?
| context.setLineWidth(dataSet.barBorderWidth) | ||
| context.stroke(barRect) | ||
| } | ||
| } |
There was a problem hiding this comment.
in gradient bars, accessibilityOrderedElements is missing?
There was a problem hiding this comment.
@liuxuan30 pushed commit. Hope that I did it correct.
|
|
||
| extension NSUIColor | ||
| { | ||
| var nsuirgba: (red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)? { |
There was a problem hiding this comment.
though the imp is different, here are two var nsuirgba in one extension? typo? or two vars indeed?
There was a problem hiding this comment.
@larryonoff can you get the notification? I basically finished the review, jsut some minor issues to address.
|
|
||
| extension NSUIColor | ||
| { | ||
| var nsuirgba: (red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)? { |
|
@jjatie @danielgindi please also take a look. Generally I'm accepting except for some minor issues. |
|
Hi i want to implement gradient bars with round corners when to expect this merge? |
|
@liuxuan30 @danielgindi Hi. Sorry for the delay in responding. Really busy these weeks. I won't be able to check this PR for some time. But I think It can be done without my help easily. |
|
@larryonoff I could fix most of them, but two left need your input, 1st is about 2st is about the var nsuirgba, I need your input which is new, because you added two same var with different implementation. And I can't tell which is the right one. |
rename `setup(_ dataSet: BarChartDataSet)` to `setupBarGradient(_ dataSet: BarChartDataSet)`
rename `drawDefaultBars` to `drawNormalBars`
just pushed commit
|
|
@larryonoff I saw nsuirgba is ported from 4.0 branch. I was evaluating which branch is better to merge, merging into master will have more conflicts while merging 4.0 branch, so I was kind of unsure. anyway, I could take on from here. Thanks! |
|
I think the best way is to merge 4.0 branch first, and try to merge this. I'm actively working on the 4.0 merge right now, and it could take 1-2 weeks to resolve the conflicts. |
|
@liuxuan30 Can we have a merged file in next few weeks? |
|
I think so, @larryonoff so we have merged the 4.0 branch into master, now this is the next we want to merge. I'm switching to master base |
|
@larryonoff any chance you could fix the conflicts? |
|
@liuxuan30 hey! sorry, but not in a week. very busy. |
|
@larryonoff @liuxuan30 Any chance to update in this week? |
|
Sorry I‘m super busy recently as well. I hope someone could help on this PR, basically solve the conflict with master. |
|
This would be easy to accomplish by providing your custom renderer, if #4297 was merged. |
|
Hi everyone! Sorry for hijacking this PR. But I';ve been reading the commits, and I still have no idea how to apply gradient colors to my EDIT: I suppose this hasn't been merged to the Master. |
|
May 2023 and still waiting on this... |
This PR adds functionality to draw gradient bars with BarChartDataSet based on
masterbranch