Skip to content
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

Crash with marker attached into CombinedChartView #1315

Closed
clear-m opened this issue Aug 11, 2016 · 4 comments
Closed

Crash with marker attached into CombinedChartView #1315

clear-m opened this issue Aug 11, 2016 · 4 comments

Comments

@clear-m
Copy link

clear-m commented Aug 11, 2016

Hi there!
I am working with CombinedChartView at the moment and got some issue when marked attached

I've cloned current master repo (latest commit f48fbfc ) and edit CombinedChartViewController.m at ChartsDemo to make this issue reproducible. Please, edit setChartData like below:

- (void)setChartData
{
CombinedChartData *data = [[CombinedChartData alloc] initWithXVals:months];
data.lineData = [self generateLineData];
data.barData = [self generateBarData];
data.bubbleData = [self generateBubbleData];
//data.scatterData = [self generateScatterData];
//data.candleData = [self generateCandleData];
_chartView.data = data;
_chartView.marker = [[ChartMarker alloc] init];
[_chartView highlightValueWithXIndex:(ITEM_COUNT - 1) dataSetIndex:0 callDelegate:NO];
}

Here is stack trace from XCode:

Thread 1Queue : com.apple.main-thread (serial)
#0 0x00000001050c41a8 in specialized fatalErrorMessage(StaticString, StaticString, StaticString, UInt) -> () ()
#1 0x0000000104f71962 in ArrayBuffer.checkInoutAndNativeTypeCheckedBounds(Int, wasNativeTypeChecked : Bool) -> () ()
#2 0x0000000104f8b047 in Array.subscript.getter ()
#3 0x000000010205537f in CombinedChartData.getEntryForHighlight(ChartHighlight) -> ChartDataEntry? at /Users/alpari_dev/Downloads/charts_master/Charts/Charts/Classes/Data/Implementations/Standard/CombinedChartData.swift:223
#4 0x000000010211b6d6 in ChartViewBase.drawMarkers(context : CGContext) -> () at /Users/alpari_dev/Downloads/charts_master/Charts/Charts/Classes/Charts/ChartViewBase.swift:548
#5 0x0000000102143876 in BarLineChartViewBase.drawRect(CGRect) -> () at /Users/alpari_dev/Downloads/charts_master/Charts/Charts/Classes/Charts/BarLineChartViewBase.swift:277
#6 0x00000001021439c5 in @objc BarLineChartViewBase.drawRect(CGRect) -> () ()
#7 0x0000000103a9d3e5 in -UIView(CALayerDelegate) drawLayer:inContext:
#8 0x00000001069647ea in -CALayer drawInContext:
#9 0x0000000106853faa in CABackingStoreUpdate
()
#10 0x00000001069644d4 in **ZN2CA5Layer8display_Ev_block_invoke ()
#11 0x000000010696434a in CA::Layer::display
() ()
#12 0x0000000106958e87 in CA::Layer::display_if_needed(CA::Transaction
) ()
#13 0x0000000106958f17 in CA::Layer::layout_and_display_if_needed(CA::Transaction
) ()
#14 0x000000010694d3c9 in CA::Context::commit_transaction(CA::Transaction*) ()
#15 0x000000010697b086 in CA::Transaction::commit() ()
#16 0x0000000103a0f19b in _afterCACommitHandler ()
#17 0x0000000102e87c37 in __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION** ()
#18 0x0000000102e87ba7 in __CFRunLoopDoObservers ()
#19 0x0000000102e7d7fb in __CFRunLoopRun ()
#20 0x0000000102e7d0f8 in CFRunLoopRunSpecific ()
#21 0x00000001070dbad2 in GSEventRunModal ()
#22 0x00000001039e2f09 in UIApplicationMain ()
#23 0x0000000101ac5f2f in main at /Users/alpari_dev/Downloads/charts_master/Charts/ChartsDemo/Supporting Files/main.m:20
#24 0x000000010638492d in start ()

@liuxuan30
Copy link
Member

This is known issue I believe, check out #1185
maybe turn off self.highlightFullBarEnabled would help on your side

@clear-m
Copy link
Author

clear-m commented Aug 12, 2016

Thanks - you are absolutely right.
This snipped solves my issue:

h = ChartHighlight(xIndex: h!.xIndex, value: Double.NaN, dataIndex: 0, dataSetIndex: 0, stackIndex: 0)

@danielgindi
Copy link
Collaborator

Or you can use Charts 3.0 beta ;-)

@clear-m
Copy link
Author

clear-m commented Aug 12, 2016

Ok - thanks - did't see 3.0 yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants