LegendData

public struct LegendData : Hashable, Identifiable

Data model to hold data for Legends

  • id

    Declaration

    Swift

    public var id: UUID
  • The type of chart being used.

    Declaration

    Swift

    public var chartType: ChartType
  • Text to be displayed

    Declaration

    Swift

    public var legend: String
  • Style of the stroke

    Declaration

    Swift

    public var strokeStyle: Stroke?
  • Used to make sure the charts data legend is first

    Declaration

    Swift

    public let prioity: Int
  • Undocumented

    Declaration

    Swift

    public var colour: ColourStyle
  • Legend.

    Declaration

    Swift

    public init(id: UUID,
                legend: String,
                colour: ColourStyle,
                strokeStyle: Stroke?,
                prioity: Int,
                chartType: ChartType
    )

    Parameters

    legend

    Text to be displayed.

    colour

    Colour styling.

    strokeStyle

    Stroke Style.

    prioity

    Used to make sure the charts data legend is first.

    chartType

    Type of chart being used.

  • Get the legend as a view.

    Declaration

    Swift

    public func getLegend(
        width: CGFloat = 40,
        font: Font = .caption,
        textColor: Color = .primary
    ) -> some View

    Parameters

    textColor

    Colour of the text

    Return Value

    The relevent legend as a view.

  • Get the legend as a view where the colour is indicated by a Circle.

    Declaration

    Swift

    public func getLegendAsCircle(
        width: CGFloat = 12,
        font: Font = .caption,
        textColor: Color
    ) -> some View

    Parameters

    textColor

    Colour of the text

    Return Value

    The relevent legend as a view.