Created
January 7, 2023 19:51
-
-
Save navsing/ca19e1b9cee3caab53f039ffdec3262d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Base Components | |
Chart(data) { i in | |
LineMark( | |
x: .value("x-axis", i.year), | |
y: .value("y-axis", i.awards) | |
) | |
} | |
//Customization to try on the line component | |
.lineStyle(StrokeStyle(lineWidth: 2)) // add stroke to the line | |
.foregroundStyle(.blue) // add color to the line | |
.interpolationMethod(.linear) //try playing with .cardinal, .linear, .monotone etc. | |
.symbol(Circle()) //customize symbols - change color, stroke etc. | |
.symbolSize(10) | |
//Customization to try on the chart component | |
.chartXAxis(.automatic) | |
.chartYAxis(.hidden) //show or hide axis | |
.chartLegend(.automatic) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment