Skip to content

Can't get legend or x and y labels #243

Description

@dadixon

v2 ticket

Ticket description:

I'm having trouble getting the legend and labels to show in the ChartGrid with a LineChart. I'm passing in the tuple for the data but only the data is displayed

var demoData: [(String, Double)] = [
      ("M", 8),
      ("T", 2),
      ("W", 4),
      ("T", 6),
      ("F", 12),
      ("S", 9),
      ("S", 2)
]

var body: some View {

   ChartGrid {
       LineChart()
       ChartLabel("")
          .labelStyle(.automatic)
   }
       .data(demoData)
       .chartStyle(ChartStyle(backgroundColor: .white,
                                         foregroundColor: ColorGradient(.blue, .purple)))
}

Screen Shot 2022-06-02 at 10 30 16 AM

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions