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

Why my LineChartDataSet's line is behind the bar? #2354

Closed
zip520123 opened this issue Apr 12, 2017 · 2 comments
Closed

Why my LineChartDataSet's line is behind the bar? #2354

zip520123 opened this issue Apr 12, 2017 · 2 comments

Comments

@zip520123
Copy link

2017-04-12 3 24 53

I follow the demo code "Combined Chart".
There is my "LineChartDataSet" setting below.

set1 = LineChartDataSet(values: yVals, label: "")
set1?.lineDashLengths = [1 ,0]
set1?.lineWidth = 1.0
set1?.circleRadius = 4.0
set1?.drawCircleHoleEnabled = false
set1?.formSize = 15.0
set1?.setColors(UIColor.red)
set1?.setCircleColor(UIColor.red)
set1?.mode = .stepped
set1?.drawValuesEnabled = false

and BarChartDataSet setting.

set1 = BarChartDataSet(values: yVals, label: "")
set1?.setColors(UIColor(red: 0.071, green: 0.459, blue: 0.835, alpha: 1.00))
set1?.drawValuesEnabled = false

How can I bring LineChartDataSet's line to front?

@thierryH91200
Copy link
Contributor

set1
let dataLine = LineChartData()
.... what you want...
dataLine.addDataSet(set1)

set2 = BarChartDataSet(values: yVals, label: "")
... what you want ..
let dataBar = BarChartData()
dataBar.addDataSet(set2)

and

let data = CombinedChartData()
data.lineData = dataLine
data.barData = dataBar

@zip520123
Copy link
Author

zip520123 commented Apr 12, 2017

My fault.
I fix it by change

chartView.drawOrder = [DrawOrder.line.rawValue ,DrawOrder.bar.rawValue ]

to

chartView.drawOrder = [DrawOrder.bar.rawValue ,DrawOrder.line.rawValue ]

Sorry, my poor english that you can't understand my question...😂

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

2 participants