LegendData
public struct LegendData : Hashable, Identifiable
Data model to hold data for Legends
-
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
legendText to be displayed.
colourColour styling.
strokeStyleStroke Style.
prioityUsed to make sure the charts data legend is first.
chartTypeType 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 ViewParameters
textColorColour 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 ViewParameters
textColorColour of the text
Return Value
The relevent legend as a view.