deskside / emodiary

0 stars 0 forks source link

Hello Swift Charts #37

Closed deskside closed 1 year ago

deskside commented 1 year ago
deskside commented 1 year ago
image image
deskside commented 1 year ago
image image
image image
image

BarMark PointMark LineMark

image
image

Dark Mode / Device Screen Sizes / Dynamic Type/ Voice Over / Audio Graphs/ High-Contrast/Localization/ Multi-Platform

deskside commented 1 year ago

Apple usage of Chart

image
deskside commented 1 year ago
GropuBox{}

BarMark()
.foregroundStyle(Color("barColor")
.accessibilityLabel($0.name)
.accessibilityValue( "\($0.sales) sold")
.interpolationMethod(.catmullRom) // make line more smooth
.position(by: .value("City", series.city)) // make 2 data seperate

Chart{
  ForEach(dailySales, id: \.day) {
    LineMark(
      x: .value ( "Day",  $0.day, unit: .day),
      y: .value( " Sales", $0.sales)
)}}
deskside commented 1 year ago
image

AreaMark + LineMark

image

BarMark + RectangleMark

image

BarMark + RuleMark

image image
deskside commented 1 year ago
image image image
deskside commented 1 year ago
image

legend ⑤ countable (on map, picture) 图例 túlì axes axis

image
Chart{...}
.chartYAxis{
  AxisMarks(preset: .extended, position: .leading)
}
.chartXAxis(.hidden)
.chartLegend(.hidden)
image
deskside commented 1 year ago
.chartPlotStyle { plotArea in
  plotArea
  .background(.pink.opacity(0.2))
  .border(.pink, width:1)
}
image image image