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

CandleChart do not render the first candle in CombineChartView #3857

Closed
yogalau opened this issue Feb 21, 2019 · 3 comments
Closed

CandleChart do not render the first candle in CombineChartView #3857

yogalau opened this issue Feb 21, 2019 · 3 comments

Comments

@yogalau
Copy link

yogalau commented Feb 21, 2019

What did you do?

i'm using combineChartView to display some data with candleChart.

What did you expect to happen?

I would like to display fully data and candle stick at chart.

What happened instead?

After combineChartView data loaded, candle chart data is fully loaded, but the first candle did not rendered.

image

When selecting the value of chart, it can read the entry data.

image

log::

image

Charts Environment

**Charts version/Branch/Commit Number:Charts 3.2.2
**Xcode version:Version 10.1 (10B61)
**Swift version:4.2
**Platform(s) running Charts:iOS 12.1
**macOS version running Xcode:macOS 10.14 (18A391)

Demo Project

NSMutableArray *candleVals = [NSMutableArray array];

for (int i = 0; i < 10; i++) {
    double high = [candleData[i][@"high"] doubleValue];
    double low = [candleData[i][@"low"] doubleValue];
    double open = [candleData[i][@"open"] doubleValue];
    double close = [candleData[i][@"close"] doubleValue];
    
    [candleVals addObject:[[CandleChartDataEntry alloc] initWithX:i shadowH:high shadowL:low open:open close:close icon: nil]];
}

CandleChartDataSet *candleDataSet = [[CandleChartDataSet alloc] initWithValues:candleVals];
[candleDataSet setColor:[UIColor colorWithWhite:1 alpha:0.5]];

candleDataSet.shadowWidth = 0.8;
candleDataSet.decreasingColor = GREEN_COLOR;
candleDataSet.decreasingFilled = YES;
candleDataSet.increasingColor = RED_COLOR;
candleDataSet.increasingFilled = YES;
candleDataSet.drawValuesEnabled = NO;

CandleChartData *candleData = [[CandleChartData alloc] initWithDataSet:candleDataSet];

CombinedChartData *combinedData = [[CombinedChartData alloc] init];
combinedData.candleData = candleData;
_combinedChartView.data = combinedData;
@yogalau yogalau changed the title CandleChart lost the first candle in CombineChartView CandleChart do not render the first candle in CombineChartView Feb 21, 2019
@shoujs
Copy link

shoujs commented Feb 24, 2019

I second the issue. The first candle is not diplayed in the iOS-swift-demo project. I am using 3.2.2.

YusukeOba pushed a commit to YusukeOba/Charts that referenced this issue Feb 25, 2019
YusukeOba pushed a commit to YusukeOba/Charts that referenced this issue Feb 25, 2019
@jjatie
Copy link
Collaborator

jjatie commented Mar 9, 2019

@yogalau can you check the master branch for this issue? #3891 Should resolve this.

@liuxuan30
Copy link
Member

we could close it now I suppose.

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

4 participants