Created
June 12, 2022 17:41
-
-
Save amosgyamfi/835a0378f7022b00f08ef7a06e9390b4 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
// | |
// BasicSwiftChart.swift | |
// SwiftCharts | |
// | |
// Created by Amos | |
// | |
import Charts | |
import SwiftUI | |
struct BasicSwiftChart: View { | |
var body: some View { | |
Chart{ | |
PointMark( | |
// x: .value("Description ", "The value itself") | |
// .value: Meaning we are not setting the position or the height of the bars directly. | |
x: .value("Name", "Chat Messaging"), | |
y: .value("Sales", 916) | |
) | |
PointMark( | |
// x: .value("Description ", "The value itself") | |
// .value: Meaning we are not setting the position or the height of the bars directly. | |
x: .value("Name", "Activity Feeds"), | |
y: .value("Sales", 850) | |
) | |
} | |
.padding() | |
} | |
} | |
struct BasicSwiftChart_Previews: PreviewProvider { | |
static var previews: some View { | |
BasicSwiftChart() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment