Indicator Charts

BinderScriptNotebook

Summary: This example shows how to create indicator charts in F#.

Indicator Charts visualize the evolution of a value compared to a reference value, optionally inside a range.

There are different types of indicator charts, depending on the IndicatorMode used in chart generation:

  • Delta/Number (and combinations) simply shows if the value is increasing or decreasing compared to the reference
  • Any combination of the above with Gauge adds a customizable gauge that indicates where the value lies inside a given range.
open Plotly.NET 
open Plotly.NET.TraceObjects
open Plotly.NET.LayoutObjects

let allIndicatorTypes =
    [
        Chart.Indicator(
            120., StyleParam.IndicatorMode.NumberDeltaGauge,
            Title = "Bullet gauge",
            DeltaReference = 90.,
            Range = StyleParam.Range.MinMax(-200., 200.),
            GaugeShape = StyleParam.IndicatorGaugeShape.Bullet,
            ShowGaugeAxis = false,
            Domain  = Domain.init(Row = 0, Column = 0)
        )
        Chart.Indicator(
            200., StyleParam.IndicatorMode.NumberDeltaGauge,
            Title = "Angular gauge",
            Delta = IndicatorDelta.init(Reference=160),
            Range = StyleParam.Range.MinMax(0., 250.),
            Domain = Domain.init(Row = 0, Column = 1)
        )
        Chart.Indicator(
            300., StyleParam.IndicatorMode.NumberDelta,
            Title = "number and delta",
            DeltaReference = 90.,
            Domain  = Domain.init(Row = 1, Column = 0)
        )        
        Chart.Indicator(
            40., StyleParam.IndicatorMode.Delta,
            Title = "delta",
            DeltaReference = 90.,
            Domain  = Domain.init(Row = 1, Column = 1)
        )
    ]
    |> Chart.combine
    |> Chart.withLayoutGridStyle(Rows = 2, Columns = 2)
    |> Chart.withMarginSize(Left = 200)
namespace Plotly
namespace Plotly.NET
namespace Plotly.NET.TraceObjects
namespace Plotly.NET.LayoutObjects
val allIndicatorTypes : GenericChart.GenericChart
type Chart = static member AnnotatedHeatmap : zData:seq<#seq<'a1>> * annotationText:seq<#seq<string>> * ?Name:string * ?ShowLegend:bool * ?Opacity:float * ?X:seq<#IConvertible> * ?XGap:int * ?Y:seq<#IConvertible> * ?YGap:int * ?Text:'a5 * ?MultiText:seq<'a5> * ?ColorBar:ColorBar * ?ColorScale:Colorscale * ?ShowScale:bool * ?ReverseScale:bool * ?ZSmooth:SmoothAlg * ?Transpose:bool * ?UseWebGL:bool * ?ReverseYAxis:bool * ?UseDefaults:bool -> GenericChart (requires 'a1 :> IConvertible and 'a5 :> IConvertible) static member Area : x:seq<#IConvertible> * y:seq<#IConvertible> * ?Name:string * ?ShowMarkers:bool * ?ShowLegend:bool * ?MarkerSymbol:MarkerSymbol * ?Color:Color * ?Opacity:float * ?Labels:seq<#IConvertible> * ?TextPosition:TextPosition * ?TextFont:Font * ?Dash:DrawingStyle * ?Width:float * ?UseDefaults:bool -> GenericChart + 1 overload static member Bar : values:seq<#IConvertible> * ?Keys:seq<#IConvertible> * ?Name:string * ?ShowLegend:bool * ?Opacity:float * ?MultiOpacity:seq<float> * ?Text:'a2 * ?MultiText:seq<'a2> * ?MarkerColor:Color * ?MarkerColorScale:Colorscale * ?MarkerOutline:Line * ?MarkerPatternShape:PatternShape * ?MultiMarkerPatternShape:seq<PatternShape> * ?MarkerPattern:Pattern * ?Marker:Marker * ?Base:#IConvertible * ?Width:'a4 * ?MultiWidth:seq<'a4> * ?TextPosition:TextPosition * ?MultiTextPosition:seq<TextPosition> * ?UseDefaults:bool -> GenericChart (requires 'a2 :> IConvertible and 'a4 :> IConvertible) + 1 overload static member BoxPlot : ?x:seq<#IConvertible> * ?y:seq<#IConvertible> * ?Name:string * ?ShowLegend:bool * ?Text:'a2 * ?MultiText:seq<'a2> * ?Fillcolor:Color * ?MarkerColor:Color * ?OutlierColor:Color * ?OutlierWidth:int * ?Opacity:float * ?WhiskerWidth:float * ?BoxPoints:BoxPoints * ?BoxMean:BoxMean * ?Jitter:float * ?PointPos:float * ?Orientation:Orientation * ?Marker:Marker * ?Line:Line * ?AlignmentGroup:string * ?Offsetgroup:string * ?Notched:bool * ?NotchWidth:float * ?QuartileMethod:QuartileMethod * ?UseDefaults:bool -> GenericChart (requires 'a2 :> IConvertible) + 1 overload static member Bubble : x:seq<#IConvertible> * y:seq<#IConvertible> * sizes:seq<int> * ?Name:string * ?ShowLegend:bool * ?Opacity:float * ?MultiOpacity:seq<float> * ?Text:'a2 * ?MultiText:seq<'a2> * ?TextPosition:TextPosition * ?MultiTextPosition:seq<TextPosition> * ?MarkerColor:Color * ?MarkerColorScale:Colorscale * ?MarkerOutline:Line * ?MarkerSymbol:MarkerSymbol * ?MultiMarkerSymbol:seq<MarkerSymbol> * ?Marker:Marker * ?LineColor:Color * ?LineColorScale:Colorscale * ?LineWidth:float * ?LineDash:DrawingStyle * ?Line:Line * ?StackGroup:string * ?Orientation:Orientation * ?GroupNorm:GroupNorm * ?UseWebGL:bool * ?UseDefaults:bool -> GenericChart (requires 'a2 :> IConvertible) + 1 overload static member Candlestick : open:seq<#IConvertible> * high:seq<#IConvertible> * low:seq<#IConvertible> * close:seq<#IConvertible> * x:seq<#IConvertible> * ?Name:string * ?ShowLegend:bool * ?Opacity:float * ?Text:'a5 * ?MultiText:seq<'a5> * ?Line:Line * ?IncreasingColor:Color * ?Increasing:FinanceMarker * ?DecreasingColor:Color * ?Decreasing:FinanceMarker * ?WhiskerWidth:float * ?UseDefaults:bool -> GenericChart (requires 'a5 :> IConvertible) + 1 overload static member Column : values:seq<#IConvertible> * ?Keys:seq<#IConvertible> * ?Name:string * ?ShowLegend:bool * ?Opacity:float * ?MultiOpacity:seq<float> * ?Text:'a2 * ?MultiText:seq<'a2> * ?MarkerColor:Color * ?MarkerColorScale:Colorscale * ?MarkerOutline:Line * ?MarkerPatternShape:PatternShape * ?MultiMarkerPatternShape:seq<PatternShape> * ?MarkerPattern:Pattern * ?Marker:Marker * ?Base:#IConvertible * ?Width:'a4 * ?MultiWidth:seq<'a4> * ?TextPosition:TextPosition * ?MultiTextPosition:seq<TextPosition> * ?UseDefaults:bool -> GenericChart (requires 'a2 :> IConvertible and 'a4 :> IConvertible) + 1 overload static member Contour : zData:seq<#seq<'a1>> * ?Name:string * ?ShowLegend:bool * ?Opacity:float * ?X:seq<#IConvertible> * ?Y:seq<#IConvertible> * ?Text:'a4 * ?MultiText:seq<'a4> * ?ColorBar:ColorBar * ?ColorScale:Colorscale * ?ShowScale:bool * ?ReverseScale:bool * ?Transpose:bool * ?LineColor:Color * ?LineDash:DrawingStyle * ?Line:Line * ?ContoursColoring:ContourColoring * ?ContoursOperation:ConstraintOperation * ?ContoursType:ContourType * ?ShowContourLabels:bool * ?ContourLabelFont:Font * ?Contours:Contours * ?FillColor:Color * ?NContours:int * ?UseDefaults:bool -> GenericChart (requires 'a1 :> IConvertible and 'a4 :> IConvertible) static member Funnel : x:seq<#IConvertible> * y:seq<#IConvertible> * ?Name:string * ?ShowLegend:bool * ?Opacity:float * ?Width:float * ?Offset:float * ?Text:'a2 * ?MultiText:seq<'a2> * ?TextPosition:TextPosition * ?MultiTextPosition:seq<TextPosition> * ?Orientation:Orientation * ?AlignmentGroup:string * ?OffsetGroup:string * ?MarkerColor:Color * ?MarkerOutline:Line * ?Marker:Marker * ?TextInfo:TextInfo * ?ConnectorLineColor:Color * ?ConnectorLineStyle:DrawingStyle * ?ConnectorFillColor:Color * ?ConnectorLine:Line * ?Connector:FunnelConnector * ?InsideTextFont:Font * ?OutsideTextFont:Font * ?UseDefaults:bool -> GenericChart (requires 'a2 :> IConvertible) static member Heatmap : zData:seq<#seq<'a1>> * ?Name:string * ?ShowLegend:bool * ?Opacity:float * ?X:seq<#IConvertible> * ?XGap:int * ?Y:seq<#IConvertible> * ?YGap:int * ?Text:'a4 * ?MultiText:seq<'a4> * ?ColorBar:ColorBar * ?ColorScale:Colorscale * ?ShowScale:bool * ?ReverseScale:bool * ?ZSmooth:SmoothAlg * ?Transpose:bool * ?UseWebGL:bool * ?ReverseYAxis:bool * ?UseDefaults:bool -> GenericChart (requires 'a1 :> IConvertible and 'a4 :> IConvertible) + 1 overload ...
static member Chart.Indicator : value:System.IConvertible * mode:StyleParam.IndicatorMode * ?Range:StyleParam.Range * ?Name:string * ?Title:string * ?ShowLegend:bool * ?Domain:Domain * ?Align:StyleParam.IndicatorAlignment * ?DeltaReference:#System.IConvertible * ?Delta:IndicatorDelta * ?Number:IndicatorNumber * ?GaugeShape:StyleParam.IndicatorGaugeShape * ?Gauge:IndicatorGauge * ?ShowGaugeAxis:bool * ?GaugeAxis:LinearAxis * ?UseDefaults:bool -> GenericChart.GenericChart
module StyleParam from Plotly.NET
type IndicatorMode = | Number | Delta | Gauge | NumberDelta | NumberGauge | DeltaGauge | NumberDeltaGauge member Convert : unit -> obj override ToString : unit -> string static member convert : (IndicatorMode -> obj) static member toString : (IndicatorMode -> string)
union case StyleParam.IndicatorMode.NumberDeltaGauge: StyleParam.IndicatorMode
Multiple items
type Title = inherit DynamicObj new : unit -> Title static member init : ?Text:string * ?Font:Font * ?Standoff:int * ?Side:Side * ?X:float * ?Y:float -> Title static member style : ?Text:string * ?Font:Font * ?Standoff:int * ?Side:Side * ?X:float * ?Y:float -> (Title -> Title)

--------------------
new : unit -> Title
type Range = | MinMax of float * float | Values of float array member Convert : unit -> obj static member convert : (Range -> obj)
<summary> Defines a Range between min and max value </summary>
union case StyleParam.Range.MinMax: float * float -> StyleParam.Range
type IndicatorGaugeShape = | Angular | Bullet member Convert : unit -> obj override ToString : unit -> string static member convert : (IndicatorGaugeShape -> obj) static member toString : (IndicatorGaugeShape -> string)
union case StyleParam.IndicatorGaugeShape.Bullet: StyleParam.IndicatorGaugeShape
Multiple items
type Domain = inherit DynamicObj new : unit -> Domain static member init : ?X:Range * ?Y:Range * ?Row:int * ?Column:int -> Domain static member style : ?X:Range * ?Y:Range * ?Row:int * ?Column:int -> (Domain -> Domain)
<summary> Dimensions type inherits from dynamic object </summary>

--------------------
new : unit -> Domain
static member Domain.init : ?X:StyleParam.Range * ?Y:StyleParam.Range * ?Row:int * ?Column:int -> Domain
Multiple items
type IndicatorDelta = inherit DynamicObj new : unit -> IndicatorDelta static member init : ?Decreasing:IndicatorSymbol * ?Font:Font * ?Increasing:IndicatorSymbol * ?Position:IndicatorDeltaPosition * ?Reference:#IConvertible * ?Relative:bool * ?ValueFormat:string -> IndicatorDelta static member style : ?Decreasing:IndicatorSymbol * ?Font:Font * ?Increasing:IndicatorSymbol * ?Position:IndicatorDeltaPosition * ?Reference:#IConvertible * ?Relative:bool * ?ValueFormat:string -> (IndicatorDelta -> IndicatorDelta)

--------------------
new : unit -> IndicatorDelta
static member IndicatorDelta.init : ?Decreasing:IndicatorSymbol * ?Font:Font * ?Increasing:IndicatorSymbol * ?Position:StyleParam.IndicatorDeltaPosition * ?Reference:#System.IConvertible * ?Relative:bool * ?ValueFormat:string -> IndicatorDelta
union case StyleParam.IndicatorMode.NumberDelta: StyleParam.IndicatorMode
union case StyleParam.IndicatorMode.Delta: StyleParam.IndicatorMode
static member Chart.combine : gCharts:seq<GenericChart.GenericChart> -> GenericChart.GenericChart
static member Chart.withLayoutGridStyle : ?SubPlots:(StyleParam.LinearAxisId * StyleParam.LinearAxisId) [] [] * ?XAxes:StyleParam.LinearAxisId [] * ?YAxes:StyleParam.LinearAxisId [] * ?Rows:int * ?Columns:int * ?RowOrder:StyleParam.LayoutGridRowOrder * ?Pattern:StyleParam.LayoutGridPattern * ?XGap:float * ?YGap:float * ?Domain:Domain * ?XSide:StyleParam.LayoutGridXSide * ?YSide:StyleParam.LayoutGridYSide -> (GenericChart.GenericChart -> GenericChart.GenericChart)
static member Chart.withMarginSize : ?Left:'a * ?Right:'b * ?Top:'c * ?Bottom:'d * ?Pad:'e * ?Autoexpand:'f -> (GenericChart.GenericChart -> GenericChart.GenericChart)
module GenericChart from Plotly.NET
<summary> Module to represent a GenericChart </summary>
val toChartHTML : gChart:GenericChart.GenericChart -> string
<summary> Converts a GenericChart to it HTML representation. The div layer has a default size of 600 if not specified otherwise. </summary>