FUIChartCardView
@IBDesignable
open class FUIChartCardView : FUICardBaseView, FUISeriesTitleComponent, FUISubtitleComponent, FUITrendComponent
Chart card type, where KPI values are centered in the card, inscribed within circular progress ring.
Developer should use the FUIKPIViewItem
API set to build KPI content and set to the kpiItems: [FUIKPIViewItem]
property.
The optional trendSemanticColor: UIColor?
will be applied to the trend
and trendImage
properties, if not nil
.
Developer should configure the chartView: FUIChartView
.
Note
the default Card configuration for the FUIChartView
will cause only the first and last category title to be displayed.
Data Source
Developer should implement the FUIChartViewDataSource
, to supply data to the card’s chartView
property.
Usage
let view = FUIChartCardView()
view.title.text = "Completed"
view.status.text = "Updated 20 min ago"
view.kpiItems = [<#FUIKPIViewItem#>]
view.trend.text = "11.5 %"
view.trendImage = FUIIconLibrary.analytics.trendUp.withRenderingMode(.alwaysTemplate)
view.trendSemanticColor = UIColor.preferredFioriColor(forStyle: .positive)
view.chartView.chartType = .line
view.chartView.series.colors = [UIColor.preferredFioriColor(forStyle: .negative)]
view.chartView.categoryAxis.labels.isHidden = true
Theming
Supported TEXT
class paths:
fdlFUIChartCardView_title {}
fdlFUIChartCardView_kpiUnitItem {}
fdlFUIChartCardView_kpiMetricItem {}
fdlFUIChartCardView_kpiFractionItem {}
fdlFUIChartCardView_status {}
fdlFUIChartCardView_trend {}
fdlFUIChartCardView_seriesTitles {}
Supported TEXT
properties:
font-color: Color;
font-style: UIFontTextStyle;
text-line-clamp: Integer;
text-align: NSTextAlignment;
Supported IMAGE
class paths:
fdlFUIChartCardView_kpiIconItem {}
fdlFUIChartCardView_trendImage {}
Supported IMAGE
properties:
tint-color: Color;
-
The display mode for
Subtitle
andTrend
components.The default is
subtitle
, displaying only thesubtitle
component when bothsubtitle
andtrend
are set. If one of thesubtitle
ortrend
is not set. the other is displayed, regardless of the value for this property.Declaration
Swift
public var subtitleAndTrendDisplayMode: SubtitleAndTrendDisplayMode
-
This boolean value indicates if the space for the
chartView
should be preserved or not.The default is true, meaning the space for the
chartView
is there even if thedataSource
fot thechartView
is not set. If the value isfalse
, and thedataSource
for thechartView
is not set, there is no space preserved for thechartView
.Declaration
Swift
public var preserveChartViewSpacing: Bool
-
View containing the chart and plotted points
Declaration
Swift
public let chartView: FUIChartView
-
UIImage
value representing chart trendDeclaration
Swift
public var trendImage: UIImage? { get set }
-
UIColor
used to show trendDeclaration
Swift
public var trendSemanticColor: UIColor?
-
Size for trend image.
Set size to nil if the intrinsic image size should be used. Default value is 16 * 16.
Declaration
Swift
public var trendImageSize: CGSize?
-
Array of title strings for each data series in the plot. Will be drawn into the chart legend.
- Theming: Styleable in .nss file using
Text
type of properties. Class name:fdlFUIChartChardView_seriesTitles
. - Styleable: using
FUIPropertyRef.seriesTitles
.
Declaration
Swift
public var seriesTitles: [FUIText] { get set }
- Theming: Styleable in .nss file using
-
Developer formatted
NSAttributedString
to be displayed as the seriesTitleDeclaration
Swift
public var seriesTitlesAttributedText: NSAttributedString! { get set }
-
Declaration
Swift
open override var intrinsicContentSize: CGSize { get }