Skip to content

Instantly share code, notes, and snippets.

@amosgyamfi
Created June 12, 2022 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amosgyamfi/835a0378f7022b00f08ef7a06e9390b4 to your computer and use it in GitHub Desktop.
Save amosgyamfi/835a0378f7022b00f08ef7a06e9390b4 to your computer and use it in GitHub Desktop.
//
// 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