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

CombinedChartView with CandleData - first/last candlesticks are cut in half #1717

Closed
PSTDev opened this issue Oct 26, 2016 · 4 comments
Closed
Labels

Comments

@PSTDev
Copy link

PSTDev commented Oct 26, 2016

Similar issue #1668 for CandleStickChartView was resolved recently, but same problem still exists for CombinedChartView with CandleData - first and last candlesticks are cut in half by default.

Same solution d276f55 works for CombinedChartView too:

combinedChartView.xAxis.spaceMin = 0.5
combinedChartView.xAxis.spaceMax = 0.5

I think it should be part of CombinedChartView initialzation as for CandleStickChartView. At least in previous version of Charts (v2.2.5) CombinedChartView with CandleData shows full first/last candlesticks by default.

@liuxuan30 liuxuan30 added the bug label Oct 27, 2016
@liuxuan30
Copy link
Member

do you have code I can reproduce? I tried ChartDemo's combined chart, it has candle stick but it's fine.

@PSTDev
Copy link
Author

PSTDev commented Oct 28, 2016

You can reproduce this issue if in ChartDemo's combined chart sample comment out other datasources and xAxis minimum/maximum modifications. Like this:

CombinedChartViewController.m


- (void)viewDidLoad
{
   ...

    //xAxis.axisMinimum = 0.0;

   ...
}

- (void)setChartData
{
    CombinedChartData *data = [[CombinedChartData alloc] init];
    //data.lineData = [self generateLineData];
    //data.barData = [self generateBarData];
    //data.bubbleData = [self generateBubbleData];
    //data.scatterData = [self generateScatterData];
    data.candleData = [self generateCandleData];

    //_chartView.xAxis.axisMaximum = data.xMax + 0.25;

    _chartView.data = data;
}

@liuxuan30
Copy link
Member

liuxuan30 commented Oct 31, 2016

Tried - only the first bar is cut in half
adding

combinedChartView.xAxis.spaceMin = 0.5
combinedChartView.xAxis.spaceMax = 0.5

for combined chart may have side effect since combined chart is putting different chart renderer together. I would be cautious for the moment. Not having time to look into this right now, but you are welcome to help on this.

@danielgindi
Copy link
Collaborator

You should set spaceMin/spaceMax as @liuxuan30 said, and as is defined by default for bar charts or candlestick charts.
It is not set by default for Combined charts, as they may not contain bars... So you have to set it yourself.

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

No branches or pull requests

3 participants