StackedBarChartData
public final class StackedBarChartData : CTMultiBarChartDataProtocol, GetDataProtocol, Publishable, PointOfInterestProtocol
Data model for drawing and styling a Stacked Bar Chart.
The grouping data informs the model as to how the datapoints are linked.
-
Declaration
Swift
public let id: UUID
-
Declaration
Swift
@Published public final var dataSets: StackedBarDataSets { get set }
-
Declaration
Swift
@Published public final var metadata: ChartMetadata { get set }
-
Declaration
Swift
@Published public final var xAxisLabels: [String]? { get set }
-
Declaration
Swift
@Published public final var yAxisLabels: [String]? { get set }
-
Declaration
Swift
@Published public final var barStyle: BarStyle { get set }
-
Declaration
Swift
@Published public final var chartStyle: BarChartStyle { get set }
-
Declaration
Swift
@Published public final var legends: [LegendData] { get set }
-
Declaration
Swift
@Published public final var viewData: ChartViewData { get set }
-
Declaration
Swift
@Published public final var infoView: InfoViewData<StackedBarDataPoint> { get set }
-
Declaration
Swift
@Published public final var groups: [GroupingData] { get set }
-
Declaration
Swift
@Published public final var extraLineData: ExtraLineData? { get set }
-
Undocumented
Declaration
Swift
public var subscription: Set<AnyCancellable>
-
Declaration
Swift
public let touchedDataPointPublisher: PassthroughSubject<StackedBarChartData.DataPoint, Never>
-
Declaration
Swift
public final var noDataText: Text
-
Declaration
Swift
public final var chartType: (chartType: ChartType, dataSetType: DataSetType)
-
Undocumented
Declaration
Swift
public var disableAnimation: Bool
-
Initialises a Stacked Bar Chart.
Declaration
Swift
public init( dataSets: StackedBarDataSets, groups: [GroupingData], metadata: ChartMetadata = ChartMetadata(), xAxisLabels: [String]? = nil, yAxisLabels: [String]? = nil, barStyle: BarStyle = BarStyle(), chartStyle: BarChartStyle = BarChartStyle(), noDataText: Text = Text("No Data") )
Parameters
dataSets
Data to draw and style the bars.
groups
Information for how to group the data points.
metadata
Data model containing the charts Title, Subtitle and the Title for Legend.
xAxisLabels
Labels for the X axis instead of the labels in the data points.
yAxisLabels
Labels for the Y axis instead of the labels generated from data point values.
barStyle
Control for the aesthetic of the bar chart.
chartStyle
The style data for the aesthetic of the chart.
noDataText
Customisable Text to display when where is not enough data to draw the chart.
-
Declaration
Swift
public final func getXAxisLabels() -> some View
-
Declaration
Swift
public final func getTouchInteraction(touchLocation: CGPoint, chartSize: CGRect) -> some View
-
Declaration
Swift
public final func getDataPoint(touchLocation: CGPoint, chartSize: CGRect)
-
Declaration
Swift
public final func getPointLocation(dataSet: StackedBarDataSets, touchLocation: CGPoint, chartSize: CGRect) -> CGPoint?
-
Declaration
Swift
public typealias SetType = StackedBarDataSets
-
Declaration
Swift
public typealias DataPoint = StackedBarDataPoint
-
Declaration
Swift
public typealias CTStyle = BarChartStyle