-
-
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
Fix CombinedChartView not draw markers #2702
Conversation
return nil | ||
} | ||
|
||
let data = dataObjects[highlight.dataIndex] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can leverage dataByIndex()
to remove the need to use dataObjects
/// - Returns: dataset related to highlight | ||
open func getDataSetByHighlight(_ highlight: Highlight) -> IChartDataSet! | ||
{ | ||
let dataObjects = allData |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems unnecessary to declare dataObjects
Codecov Report
@@ Coverage Diff @@
## master #2702 +/- ##
==========================================
+ Coverage 19.65% 19.67% +0.02%
==========================================
Files 112 113 +1
Lines 13717 13772 +55
==========================================
+ Hits 2696 2710 +14
- Misses 11021 11062 +41
Continue to review full report at Codecov.
|
I have restarted the failed task on tvOS, looks like passed. |
I‘ve test the function on my forked branch, it works fine when drawing markers on a combined chart view. For the code style question, I'm not familiar with swift, so the added function is imitated from existing ones... |
OK, I need you review my comments and if it makes sense please update your code and I can merge then. |
If you don't have time that's fine. I will find a slot this week to update, test and merge |
@xzysun Thanks for a great work! I tested within ChartsDemo combined chart with balloon marker, works fine BalloonMarker *marker = [[BalloonMarker alloc]
initWithColor: [UIColor colorWithWhite:180/255. alpha:1.0]
font: [UIFont systemFontOfSize:12.0]
textColor: UIColor.whiteColor
insets: UIEdgeInsetsMake(8.0, 8.0, 20.0, 8.0)];
marker.chartView = _chartView;
marker.minimumSize = CGSizeMake(80.f, 40.f);
_chartView.marker = marker; to test put above code in |
If someone asks about why the first and last marker position has offset, it's because else if chart != nil && point.x + width + offset.x > chart!.bounds.size.width
{
offset.x = chart!.bounds.size.width - point.x - width
} |
look at #3404 |
Fix CombinedChartView not draw markers
Try to fix issue #2692.