FUIChartView
open class FUIChartView : UIView, FUIChartItemComponent, FUIChartSelectionComponent
A UIView subclass that displays charts.
-
Text shown when there is no data available. This is used to customize the default
NoDataView
.Declaration
Swift
@available(*, deprecated, message: "Please set `noDataView` directly") public var placeholderText: String? { get set }
-
Text color for the
placeholderText
. This is used to customize the defaultNoDataView
.Declaration
Swift
@available(*, deprecated, message: "Please set `noDataView` directly") public var placeholderTextColor: UIColor? { get set }
-
Font for the
placeholderText
. This is used to customize the defaultNoDataView
.Declaration
Swift
@available(*, deprecated, message: "Please set `noDataView` directly") public var placeholderTextFont: UIFont? { get set }
-
Custom
UIView
to be shown when there is no data available.Declaration
Swift
public var noDataView: UIView? { get set }
-
Style definition for the chart. Gives access to the chart theme palette.
Declaration
Swift
public var style: FUIChartStyle { get set }
-
Type of chart presented by the FUIChartView.
This property must be set before executing
reloadData()
.Declaration
Swift
public var chartType: FUIChartType { get set }
-
Delegate class for the FUIChartView.
Declaration
Swift
public weak var delegate: FUIChartViewDelegate? { get set }
-
Data source class that is reponsible for providing data for the FUIChartView. After modifying this property you will need to execute
reloadData()
.Declaration
Swift
public weak var dataSource: FUIChartViewDataSource? { get set }
-
Reloads the data presented by the FUIChartView.
reloadData()
should be executed after thedataSource
property is assigned aFUIChartViewDataSource
instance.There are other occasions where you may want to invoke this method:
- When your
FUIChartViewDataSource
implementation has new data available. - Changing the
dataSource
. - Changing the
chartType
. - Modifying
numericAxis
properties such asisZeroBased
,explicitMin
, orexplicitMax
. - Changing the
indexesOfTotalsCategories
.
Declaration
Swift
public func reloadData()
- When your
-
Indicates indexes of column series for combo chart.
- Given indexes of series will be treated as column and the rest series will be treated as line.
Declaration
Swift
public var indexesOfColumnSeries: IndexSet? { get set }
-
Indicates total indexes for waterfall chart.
- Given indexes will treat the corresponding categories as totals.
- The corresponding category values in the provided data should correspond to the total sum of the preceding values.
- If the corresponding category value is nil in the provided data, the chart will complete the sum of the total value, which can be retrieved through
plotItem(atSeries:category:)
.
Declaration
Swift
public var indexesOfTotalsCategories: IndexSet? { get set }
-
Indicates secondary value axis series indexes for line based charts.
- The secondary value index works with .line, .area and .combo charts only.
- Given series indexes will assign the corresponding series to the secondary value axis.
Declaration
Swift
public var indexesOfSecondaryValueAxis: IndexSet? { get set }
-
Returns plot item for a given location.
Declaration
Swift
public func plotItem(at location: CGPoint) -> FUIChartPlotItem?
-
Returns plot item for given series and category.
Declaration
Swift
public func plotItem(at series: Int, category: Int) -> FUIChartPlotItem?
-
Provides attributes for the primary numeric axis.
- For clustered column, line, and combo charts this is the Y axis.
- For bar charts this is the X axis.
Declaration
Swift
public var numericAxis: FUIChartNumericAxis { get }
-
Provides attributes for the secondary numeric axis.
- For clustered line, area and combo charts this is the secondary Y axis.
Declaration
Swift
public var secondaryNumericAxis: FUIChartNumericAxis { get }
-
Provides attributes for the category axis.
- For clustered column, line, and combo charts this is the X axis.
- For bar charts this is the Y axis.
Declaration
Swift
public var categoryAxis: FUIChartCategoryAxis { get }
-
Collection of FUIChartSeries containing properties for all series provided by the FUIChartViewDataSource.
Declaration
Swift
public var series: FUIChartSeriesCollection { get set }
-
Number of gridlines that should be displayed by the chart. The actual number presented may differ depending on the chart’s data.
Declaration
Swift
public var numberOfGridlines: Int { get set }
-
Colors for any category in any series for SwiftUI charts. It is optional and will overwrite the color from seriesAttributes. Usage: [seriesIndex1: [catrgoryIndex1: HexColor, …, catrgoryIndexN: HexColor], … , seriesIndexN: [catrgoryIndex1: HexColor, …, catrgoryIndexM: HexColor]]
Declaration
Swift
public var colorsForCategory: [Int : [Int : UIColor]] { get set }
-
Determines which plot items should be selected for a category.
- single : Selects a single value in the currently selected series and category indices.
- all : Selects one value in each series for the selected category index(es).
Declaration
Swift
public var selectionMode: FUIChartSelectionMode { get set }
-
Enable or disable available user interactions on a chart
Declaration
Swift
override public var isUserInteractionEnabled: Bool { get set }
-
Default category selection mode for the chart. Defines how the initial selection is handled. Only valid values are selected. Used in combination with:
select(category:)
,select(categoriesInRange:)
,select(series:)
. If no series is selected throughselect(series:)
, the first series will be used.Declaration
Swift
public var defaultCategorySelectionMode: ChartDefaultCategorySelectionMode
-
Enable/Disable selection gestures
Declaration
Swift
public var selectionEnabled: Bool { get set }
-
When false a state is allowed in which no series is selected/active.
Declaration
Swift
public var selectionRequired: Bool { get set }
-
Indicates index of stock series for SwiftUI chart only.
Declaration
Swift
public var indexOfStockSeries: Int { get set }
-
The currently selected plot items for the FUIChartView (points, columns, bars, etc) in charts.
Declaration
Swift
public var selections: [FUIChartPlotItem]? { get }
-
Selects a category at the given index. The resulting selection(s) depend on the current
selectionMode
.Declaration
Swift
public func select(category categoryIndex: Int)
Parameters
categoryIndex
The index of the category to select.
-
Selects a category range, including the lower and and upper bounds of the range. The resulting selection(s) depend on the current
selectionMode
.Declaration
Swift
public func select(categoriesInRange range: ClosedRange<Int>)
Parameters
range
The closed range of the categories to select.
-
Selects a series at the given index. The resulting selection(s) depend on the current
selectionMode
.Declaration
Swift
public func select(series seriesIndex: Int)
Parameters
seriesIndex
The index of the series to select.
-
Steps through the series in incremental order.
- Works only wing
FUIChartSelectionMode.single
enabled. - If
selectionRequired
istrue
it will step through all series exluding the de-selected state. - If
selectionRequired
isfalse
it will step through all series including the de-selected state.
Declaration
Swift
public func selectNextSeries()
- Works only wing
-
Selects a dimension at the given index for Scatter and bubble charts. The resulting selection(s) depend on the current
selectionMode
.Declaration
Swift
@available(*, deprecated, message: "Dimension selection is not supported.") public func select(dimension dimensionIndex: Int = 0)
Parameters
dimension
The data dimension to select in Scatter (X: 0, Y: 1) and Bubble (X: 0, Y: 1, BubbleSize: 2).
-
Deselects all currently selected plot items in the FUIChartView.
Declaration
Swift
public func clearSelections()
-
The center postion of a chart in relative coordinate system, both x and y are range from 0 to 1
Declaration
Swift
public var centerPosition: CGPoint? { get set }
-
X direction scale factor, scale is not allowed to be less than 1.0
Declaration
Swift
public var scaleX: CGFloat { get set }
-
Y direction scale factor, scale is not allowed to be less than 1.0
Declaration
Swift
public var scaleY: CGFloat { get set }
-
Enable/Disable X direction scale by gesture
Declaration
Swift
public var scaleXEnabled: Bool { get set }
-
Enable/Disable Y direction scale by gesture
Declaration
Swift
public var scaleYEnabled: Bool { get set }
-
Enable/Disable Y direction scale by gesture
Declaration
Swift
public var readableScaleEnabled: Bool { get set }
-
Chart’s data debug description.
Declaration
Swift
public var debugDataDescription: String { get }