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

How can I combine two lineCharts? #3607

Closed
Args opened this issue Aug 20, 2018 · 3 comments
Closed

How can I combine two lineCharts? #3607

Args opened this issue Aug 20, 2018 · 3 comments

Comments

@Args
Copy link

Args commented Aug 20, 2018

What did you do?

I try to use CombinedChartView,but it doesn't seem to combine two charts of the same type

What did you expect to happen?

I want to combined two lineCharts,and can update data together.Code like this

    CombinedChartData *data = [[CombinedChartData alloc] init];
    data.lineData0 = [self generateLineData0];
    data.lineData1 = [self generateLineData1];

or

    CombinedChartData *data = [[CombinedChartData alloc] init];
    data.lineDataArr = [self generateLineDataArr];

What happened instead?

    CombinedChartData *data = [[CombinedChartData alloc] init];
    data.lineData = [self generateLineData];

Charts Environment

**Charts version/Branch/Commit Number:3.1.1
**Xcode version:9.4.1
**Swift version:4.1
**Platform(s) running Charts:iOS
**macOS version running Xcode:10.13.5

@suvan92
Copy link

suvan92 commented Sep 17, 2018

Use the demo app for examples. What you're looking for is in LineChart2. You can initialize LineChartData with multiple LineChartDataSets:

let data = LineChartData(dataSets: [set1, set2, set3])
chartView.data = data

where chartView is a an instance if LineChartView

@liuxuan30
Copy link
Member

Just use two line chart data sets. There are examples in multiple line chart

@Rajneesh071
Copy link

Hi @liuxuan30
How to do the same with along with bar chart?
I want to set 2 line data set and 1 bar data set.
And overlapping would be like this "Line 1 , Bar 1, Line 2"

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