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

Line chart with solid and dashed line #3334

Closed
charlesburks opened this issue Mar 13, 2018 · 2 comments
Closed

Line chart with solid and dashed line #3334

charlesburks opened this issue Mar 13, 2018 · 2 comments

Comments

@charlesburks
Copy link

Is there a way to draw a solid line that also has a dashed segment?
Here is an example.

@jjatie
Copy link
Collaborator

jjatie commented Mar 13, 2018

The only way to currently achieve this is to use two datasets (one for the solid line, one for the dashed line)

@jjatie jjatie closed this as completed Mar 13, 2018
@Artfire
Copy link

Artfire commented Mar 13, 2018

I think that the easiest way is to create two separate LineChart. You just need to separate all X and Y values for solid and dashed arrays.
1)
let lineChartDataSet1 = LineChartDataSet(...) lineChartDataSet1.setColor(.blue)
2)
let lineChartDataSet2 = LineChartDataSet(...) lineChartDataSet2.lineDashLengths = [5, 5] lineChartDataSet2.setColor(.blue)

let lineChartData = LineChartData(dataSets: [lineChartDataSet1, lineChartDataSet2])

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