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

Combined bar and line chart #67

Closed
colinhumber opened this issue May 5, 2021 · 3 comments
Closed

Combined bar and line chart #67

colinhumber opened this issue May 5, 2021 · 3 comments
Labels
enhancement New feature or request
Projects

Comments

@colinhumber
Copy link

Working with 2 data sets that should be displayed with a bar chart the grouped chart is perfect. Is it possible with the current setup to display a bar chart with a line chart overlaid?

@willdale willdale added the enhancement New feature or request label May 5, 2021
@willdale willdale added this to To do in General Project Board via automation May 5, 2021
@willdale
Copy link
Owner

willdale commented May 5, 2021

This is something I want to implement when I have time.

@willdale willdale removed this from To do in General Project Board May 8, 2021
@willdale willdale added this to To do in v2.6 via automation May 8, 2021
@willdale willdale moved this from To do to In progress in v2.6 May 8, 2021
@willdale willdale mentioned this issue May 10, 2021
@willdale
Copy link
Owner

In v2.6 there is a slightly experimental new view modifier.


BarChart(chartData: data)
    .extraLine(chartData: data, legendTitle: "Test") {
        extraLineData
    } style: {
        extraLineStyle
    }
private var extraLineData: [ExtraLineDataPoint] {
    [ExtraLineDataPoint(value: 1),
     ExtraLineDataPoint(value: 4),
     ExtraLineDataPoint(value: 9),
     ExtraLineDataPoint(value: 4),
     ExtraLineDataPoint(value: 6),
     ExtraLineDataPoint(value: 5),
     ExtraLineDataPoint(value: 6)]
}
private var extraLineStyle: ExtraLineStyle {
    ExtraLineStyle(lineColour: ColourStyle(colour: .blue),
        lineType: .curvedLine,
        lineSpacing: .bar,
        yAxisTitle: "Bob",
        yAxisNumberOfLabels: 7,
        animationType: .raise,
        baseline: .zero)
}

bar and line


It's currently undocumented, just ask if you need help.

Thanks,
Will

v2.6 automation moved this from In progress to Done May 10, 2021
@colinhumber
Copy link
Author

Amazing! 🙌🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
v2.6
Done
Development

No branches or pull requests

2 participants