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;
  • View containing the chart and plotted points

    Declaration

    Swift

    public let chartView: FUIChartView
  • FUIText value for chart trend

    Declaration

    Swift

    public private(set) var trend: FUIText
  • UIImage value representing chart trend

    Declaration

    Swift

    public var trendImage: UIImage? { get set }
  • UIColor used to show trend

    Declaration

    Swift

    public var trendSemanticColor: UIColor?
  • 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 }
  • Developer formatted NSAttributedString to be displayed as the seriesTitle

    Declaration

    Swift

    public var seriesTitlesAttributedText: NSAttributedString! { get set }