Created
January 7, 2023 19:53
-
-
Save navsing/ed5eafc8f7ab7bcffab436f351b21303 to your computer and use it in GitHub Desktop.
This file contains 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 Component | |
BarMark( | |
x: .value("Year", i.year), | |
y: .value("Awards", i.awards) | |
) | |
//Customization to try | |
RuleMark(y: .value("rulemark", 275)).foregroundStyle(.red) //adds a rule mark | |
//add multiple data sources for stacked charts. See Image. | |
//create 1-D charts | |
.chartPlotStyle { area in | |
area | |
.background(<color>) | |
.cornerRadius(<radius>) | |
}.chartXScale(range: 0...<range>) | |
.frame(height: <height>) | |
//stack them to center to create a sound bar chart | |
BarMark( | |
x: .value("Year", i.year), | |
y: .value("Awards", i.awards), | |
stacking: .center | |
).foregroundStyle(.green) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment