FUIChartFloorplanView
public class FUIChartFloorplanView : FUIDrawingView, FUITitleMultiLineComponent, FUISubtitleMultiLineComponent, FUIStatusMultilineComponent, FUIAxisTitleComponent, FUISeriesTitleComponent
View implementation of FUIChartFloorplan
. Shared by FUIChartFloorplanViewController
and FUIChartFloorplanTableViewCell
.
Composed of FUIChartTitleView
, FUIChartSummaryView
, FUIChartPlotView
, and FUIChartLegendView
. The FUIChartView
of the FUIChartPlotView
is exposed as a public property, and should be used directly by the developer.
Data Sources
Developer should implement the FUIChartViewDataSource
to supply data to the FUIChartView
.
Developer should implement the FUIChartSummaryDataSource
to supply FUIChartSummaryItem
instances to be displayed when users select categories in the chart view.
Delegates
Developer may optionally implement the FUIChartSummaryDelegate
, to handle selection of the FUIChartSummaryItem(s)
.
Usage
self.title = "Sales Chart"
self.chartView.chartType = .bar
self.chartView.numberOfGridlines = 4
self.chartView.dataSource = self
self.summaryView.dataSource = self
self.titleText.text = "Total APE ($) by Salesperson"
self.status.text = "Updated 20m ago"
self.categoryAxisTitle.text = "Salesperson"
self.valuesAxisTitle.text = "Total APE ($)"
let item = FUIChartSummaryItem()
item.categoryIndex = -1
item.isEnabled = false
item.isPreservingTrendHeight = false
let values: [Double] = {
var values: [Double] = []
for series in chartView.series {
let categoriesUpperBound = series.numberOfValues - 1
if let valuesInSeries = series.valuesInCategoryRange((0...categoriesUpperBound), dimension: 0) {
values.append(valuesInSeries.flatMap({ $0 }).reduce(0.0, +))
}
}
return values
}()
let numberFormatter = NumberFormatter()
numberFormatter.numberStyle = .currency
numberFormatter.maximumFractionDigits = 0
item.valuesText = values.map { "\(numberFormatter.string(from: $0 as NSNumber)!)k" }
item.titleText.text = "Team ($) APE"
self.summaryView.addItem(item)
Theming
Supported class paths:
fdlFUIChartFloorplanView_title {}
fdlFUIChartFloorplanView_subtitle {}
fdlFUIChartFloorplanView_status {}
fdlFUIChartFloorplanView_seriesTitles {}
fdlFUIChartFloorplanView_valuesAxisTitle {}
fdlFUIChartFloorplanView_secondaryValuesAxisTitle {}
fdlFUIChartFloorplanView_categoryAxisTitle {}
Supported properties:
font-color: Color;
font-style: UIFontTextStyle;
text-line-clamp: Integer;
text-align: NSTextAlignment;
-
Text value for chart
title
Declaration
Swift
public var title: FUIMultiLineText { get }
-
The styling for chart
title
Declaration
Swift
public var titleStyleClassPath: [FioriStyle] { get set }
-
Text value for chart
subtitle
Declaration
Swift
public var subtitle: FUIMultiLineText { get }
-
The styling for chart
subtitle
Declaration
Swift
public var subtitleStyleClassPath: [FioriStyle] { get set }
-
Text value for chart
status
Declaration
Swift
public var status: FUIMultiLineText { get }
-
The styling for the
status
Declaration
Swift
public var statusStyleClassPath: [FioriStyle] { get set }
-
Text value for chart
valuesAxisTitle
Declaration
Swift
public var valuesAxisTitle: FUIText { get }
-
Text value for chart
secondaryValuesAxisTitle
Declaration
Swift
public var secondaryValuesAxisTitle: FUIText { get }
-
The styling for the
valueAxisTitle
Declaration
Swift
public var valuesAxisTitleStyleClassPath: [FioriStyle] { get set }
-
The styling for the
secondaryValuesAxisTitle
Declaration
Swift
public var secondaryValuesAxisTitleStyleClassPath: [FioriStyle] { get set }
-
Text to be displayed as the
categoryAxisTitle
Declaration
Swift
public var categoryAxisTitle: FUIText { get }
-
The styling for the
categoryAxisTitle
Declaration
Swift
public var categoryAxisTitleStyleClassPath: [FioriStyle] { get set }
-
Flag for setting if should enable series selection when legend for series is tapped.
Declaration
Swift
public var allowLegendViewSeriesSelection: Bool { get set }
-
Text to be displayed as the
seriesTitles
Declaration
Swift
public var seriesTitles: [FUIText] { get set }
-
The attributed text for the
seriesTitles
Declaration
Swift
public var seriesTitlesAttributedText: NSAttributedString! { get set }
-
Declaration
Swift
public var seriesTitlesStyleClassPath: [FioriStyle] { get set }
-
The styling for the
seriesTitle
Declaration
Swift
override public var styleClassForPropertyRef: [FUIPropertyRef : [FUIStyleClassSource : FUIStyleType]] { get set }
-
Background color scheme for the chart
Declaration
Swift
@available(*, deprecated, message: "Will be unavailble in newer SDK version.") override open var backgroundColorScheme: FUIBackgroundColorScheme { get set }
-
Cached attributes for the chart components
Declaration
Swift
override public var cachedAttributes: [FUIPropertyRef : [FUIStyleClassSource : [NSAttributedStringKey : Any]]] { get set }
-
Summary view for category data
Declaration
Swift
public internal(set) var summaryView: FUIChartSummaryView! { get }
-
Legend view for chart
Declaration
Swift
public internal(set) var legendView: FUIChartLegendView { get }
-
View containing the chart and plotted points
Declaration
Swift
public var chartView: FUIChartView { get }