Chart config

BinderNotebook

Config is an object that configures high level properties of the chart like making all chart elements editable or the tool bar on top

Image button options

Options for chart export can be set in the config at ToImageButtonOptions:

  • Three file formats for chart exports are supported (SVG, PNG, JPEG) and can be set as Format.

  • A predefined name for the downloaded chart can be set at Filename.

  • The dimensions of the downloaded chart are set at Width and Height.

  • The Scale defines the size of the exported svg.

The settings do not apply for the html document containing the chart but for charts that are exported by clicking the camera icon in the menu bar.

open Plotly.NET
open Plotly.NET.ConfigObjects

let svgConfig =
    Config.init (
        ToImageButtonOptions =
            ToImageButtonOptions.init (
                Format = StyleParam.ImageFormat.JPEG,
                Filename = "mySvgChart",
                Width = 900.,
                Height = 600.,
                Scale = 10.
            )
    )

let svgButtonChart = Chart.Point(xy = [ (1., 2.) ]) |> Chart.withConfig svgConfig

Static plots

To create a static plot that has no hoverable elements, use StaticPlot=true on the Config:

let staticConfig = Config.init (StaticPlot = true)

let staticPlot = Chart.Point(xy = [ (1., 2.) ]) |> Chart.withConfig staticConfig

Editable charts

You can define fields that can be edited on the chart by setting Editable = true on the config, optionally explicitly setting the editable parts via EditableAnnotations

let editableConfig =
    Config.init (Editable = true, Edits = Edits.init (LegendPosition = true, AxisTitleText = true, LegendText = true))

let editablePlot = Chart.Point(xy = [ (1., 2.) ]) |> Chart.withConfig editableConfig

Responsive charts

To create a chart that is responsive to its container size, use Responsive=true on the Config:

(try resizing the window)

let responsiveConfig = Config.init (Responsive = true)

let responsivePlot =
    Chart.Point(xy = [ (1., 2.) ]) |> Chart.withConfig responsiveConfig
namespace Plotly
namespace Plotly.NET
module Defaults from Plotly.NET
<summary> Contains mutable global default values. Changing these values will apply the default values to all consecutive Chart generations. </summary>
val mutable DefaultDisplayOptions: DisplayOptions
Multiple items
type DisplayOptions = inherit DynamicObj new: unit -> DisplayOptions static member addAdditionalHeadTags: additionalHeadTags: XmlNode list -> (DisplayOptions -> DisplayOptions) static member addDescription: description: XmlNode list -> (DisplayOptions -> DisplayOptions) static member combine: first: DisplayOptions -> second: DisplayOptions -> DisplayOptions static member getAdditionalHeadTags: displayOpts: DisplayOptions -> XmlNode list static member getDescription: displayOpts: DisplayOptions -> XmlNode list static member getPlotlyReference: displayOpts: DisplayOptions -> PlotlyJSReference static member init: ?AdditionalHeadTags: XmlNode list * ?Description: XmlNode list * ?PlotlyJSReference: PlotlyJSReference -> DisplayOptions static member initCDNOnly: unit -> DisplayOptions ...

--------------------
new: unit -> DisplayOptions
static member DisplayOptions.init: ?AdditionalHeadTags: Giraffe.ViewEngine.HtmlElements.XmlNode list * ?Description: Giraffe.ViewEngine.HtmlElements.XmlNode list * ?PlotlyJSReference: PlotlyJSReference -> DisplayOptions
type PlotlyJSReference = | CDN of string | Full | Require of string | NoReference
<summary> Sets how plotly is referenced in the head of html docs. </summary>
union case PlotlyJSReference.NoReference: PlotlyJSReference
namespace Plotly.NET.ConfigObjects
val svgConfig: Config
Multiple items
type Config = inherit DynamicObj new: unit -> Config static member combine: first: Config -> second: Config -> Config static member init: ?StaticPlot: bool * ?TypesetMath: bool * ?PlotlyServerUrl: string * ?Editable: bool * ?Edits: Edits * ?EditSelection: bool * ?Autosizable: bool * ?Responsive: bool * ?FillFrame: bool * ?FrameMargins: float * ?ScrollZoom: ScrollZoom * ?DoubleClick: DoubleClick * ?DoubleClickDelay: int * ?ShowAxisDragHandles: bool * ?ShowAxisRangeEntryBoxes: bool * ?ShowTips: bool * ?ShowLink: bool * ?LinkText: string * ?SendData: bool * ?ShowSources: obj * ?DisplayModeBar: bool * ?ShowSendToCloud: bool * ?ShowEditInChartStudio: bool * ?ModeBarButtonsToRemove: seq<ModeBarButton> * ?ModeBarButtonsToAdd: seq<ModeBarButton> * ?ModeBarButtons: seq<seq<ModeBarButton>> * ?ToImageButtonOptions: ToImageButtonOptions * ?Displaylogo: bool * ?Watermark: bool * ?plotGlPixelRatio: float * ?SetBackground: obj * ?TopojsonURL: string * ?MapboxAccessToken: string * ?Logging: int * ?NotifyOnLogging: int * ?QueueLength: int * ?GlobalTransforms: obj * ?Locale: string * ?Locales: obj -> Config static member style: ?StaticPlot: bool * ?TypesetMath: bool * ?PlotlyServerUrl: string * ?Editable: bool * ?Edits: Edits * ?EditSelection: bool * ?Autosizable: bool * ?Responsive: bool * ?FillFrame: bool * ?FrameMargins: float * ?ScrollZoom: ScrollZoom * ?DoubleClick: DoubleClick * ?DoubleClickDelay: int * ?ShowAxisDragHandles: bool * ?ShowAxisRangeEntryBoxes: bool * ?ShowTips: bool * ?ShowLink: bool * ?LinkText: string * ?SendData: bool * ?ShowSources: obj * ?DisplayModeBar: bool * ?ShowSendToCloud: bool * ?ShowEditInChartStudio: bool * ?ModeBarButtonsToRemove: seq<ModeBarButton> * ?ModeBarButtonsToAdd: seq<ModeBarButton> * ?ModeBarButtons: seq<seq<ModeBarButton>> * ?ToImageButtonOptions: ToImageButtonOptions * ?Displaylogo: bool * ?Watermark: bool * ?plotGlPixelRatio: float * ?SetBackground: obj * ?TopojsonURL: string * ?MapboxAccessToken: string * ?Logging: int * ?NotifyOnLogging: int * ?QueueLength: int * ?GlobalTransforms: obj * ?Locale: string * ?Locales: obj -> (Config -> Config)
<summary> The Config object gets passed to the plotly renderer and contains render-specific options. </summary>

--------------------
new: unit -> Config
static member Config.init: ?StaticPlot: bool * ?TypesetMath: bool * ?PlotlyServerUrl: string * ?Editable: bool * ?Edits: Edits * ?EditSelection: bool * ?Autosizable: bool * ?Responsive: bool * ?FillFrame: bool * ?FrameMargins: float * ?ScrollZoom: StyleParam.ScrollZoom * ?DoubleClick: StyleParam.DoubleClick * ?DoubleClickDelay: int * ?ShowAxisDragHandles: bool * ?ShowAxisRangeEntryBoxes: bool * ?ShowTips: bool * ?ShowLink: bool * ?LinkText: string * ?SendData: bool * ?ShowSources: obj * ?DisplayModeBar: bool * ?ShowSendToCloud: bool * ?ShowEditInChartStudio: bool * ?ModeBarButtonsToRemove: seq<StyleParam.ModeBarButton> * ?ModeBarButtonsToAdd: seq<StyleParam.ModeBarButton> * ?ModeBarButtons: seq<seq<StyleParam.ModeBarButton>> * ?ToImageButtonOptions: ToImageButtonOptions * ?Displaylogo: bool * ?Watermark: bool * ?plotGlPixelRatio: float * ?SetBackground: obj * ?TopojsonURL: string * ?MapboxAccessToken: string * ?Logging: int * ?NotifyOnLogging: int * ?QueueLength: int * ?GlobalTransforms: obj * ?Locale: string * ?Locales: obj -> Config
Multiple items
type ToImageButtonOptions = inherit DynamicObj new: unit -> ToImageButtonOptions static member init: ?Format: ImageFormat * ?Filename: string * ?Width: float * ?Height: float * ?Scale: float -> ToImageButtonOptions static member style: ?Format: ImageFormat * ?Filename: string * ?Width: float * ?Height: float * ?Scale: float -> (ToImageButtonOptions -> ToImageButtonOptions)

--------------------
new: unit -> ToImageButtonOptions
static member ToImageButtonOptions.init: ?Format: StyleParam.ImageFormat * ?Filename: string * ?Width: float * ?Height: float * ?Scale: float -> ToImageButtonOptions
Multiple items
type Format<'Printer,'State,'Residue,'Result> = PrintfFormat<'Printer,'State,'Residue,'Result>
<summary>Type of a formatting expression.</summary>
<typeparam name="Printer">Function type generated by printf.</typeparam>
<typeparam name="State">Type argument passed to %a formatters</typeparam>
<typeparam name="Residue">Value generated by the overall printf action (e.g. sprint generates a string)</typeparam>
<typeparam name="Result">Value generated after post processing (e.g. failwithf generates a string internally then raises an exception)</typeparam>
<category>Language Primitives</category>


--------------------
type Format<'Printer,'State,'Residue,'Result,'Tuple> = PrintfFormat<'Printer,'State,'Residue,'Result,'Tuple>
<summary>Type of a formatting expression.</summary>
<typeparam name="Printer">Function type generated by printf.</typeparam>
<typeparam name="State">Type argument passed to %a formatters</typeparam>
<typeparam name="Residue">Value generated by the overall printf action (e.g. sprint generates a string)</typeparam>
<typeparam name="Result">Value generated after post processing (e.g. failwithf generates a string internally then raises an exception)</typeparam>
<typeparam name="Tuple">Tuple of values generated by scan or match.</typeparam>
<category>Language Primitives</category>
module StyleParam from Plotly.NET
type ImageFormat = | SVG | PNG | JPEG member Convert: unit -> obj override ToString: unit -> string static member convert: (ImageFormat -> obj) static member toString: (ImageFormat -> string)
union case StyleParam.ImageFormat.JPEG: StyleParam.ImageFormat
val svgButtonChart: GenericChart.GenericChart
type Chart = static member AnnotatedHeatmap: zData: seq<#seq<'a1>> * annotationText: seq<#seq<string>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?X: seq<'a3> * ?MultiX: seq<seq<'a3>> * ?XGap: int * ?Y: seq<'a4> * ?MultiY: seq<seq<'a4>> * ?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 'a3 :> IConvertible and 'a4 :> IConvertible and 'a5 :> IConvertible) + 1 overload static member Area: x: seq<#IConvertible> * y: seq<#IConvertible> * ?ShowMarkers: bool * ?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 * ?AlignmentGroup: string * ?OffsetGroup: string * ?StackGroup: string * ?Orientation: Orientation * ?GroupNorm: GroupNorm * ?FillColor: Color * ?FillPatternShape: PatternShape * ?FillPattern: Pattern * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart (requires 'a2 :> IConvertible) + 1 overload static member Bar: values: seq<#IConvertible> * ?Keys: seq<'a1> * ?MultiKeys: seq<seq<'a1>> * ?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 'a1 :> IConvertible and 'a2 :> IConvertible and 'a4 :> IConvertible) + 1 overload static member BoxPlot: ?X: seq<'a0> * ?MultiX: seq<seq<'a0>> * ?Y: seq<'a1> * ?MultiY: seq<seq<'a1>> * ?Name: string * ?ShowLegend: bool * ?Text: 'a2 * ?MultiText: seq<'a2> * ?FillColor: Color * ?MarkerColor: Color * ?Marker: Marker * ?Opacity: float * ?WhiskerWidth: float * ?BoxPoints: BoxPoints * ?BoxMean: BoxMean * ?Jitter: float * ?PointPos: float * ?Orientation: Orientation * ?OutlineColor: Color * ?OutlineWidth: float * ?Outline: Line * ?AlignmentGroup: string * ?OffsetGroup: string * ?Notched: bool * ?NotchWidth: float * ?QuartileMethod: QuartileMethod * ?UseDefaults: bool -> GenericChart (requires 'a0 :> IConvertible and 'a1 :> IConvertible and 'a2 :> IConvertible) + 2 overloads 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 * ?AlignmentGroup: string * ?OffsetGroup: string * ?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<'a4> * ?MultiX: seq<seq<'a4>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?Text: 'a5 * ?MultiText: seq<'a5> * ?Line: Line * ?IncreasingColor: Color * ?Increasing: FinanceMarker * ?DecreasingColor: Color * ?Decreasing: FinanceMarker * ?WhiskerWidth: float * ?ShowXAxisRangeSlider: bool * ?UseDefaults: bool -> GenericChart (requires 'a4 :> IConvertible and 'a5 :> IConvertible) + 2 overloads static member Column: values: seq<#IConvertible> * ?Keys: seq<'a1> * ?MultiKeys: seq<seq<'a1>> * ?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 'a1 :> IConvertible and 'a2 :> IConvertible and 'a4 :> IConvertible) + 1 overload static member Contour: zData: seq<#seq<'a1>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?X: seq<'a2> * ?MultiX: seq<seq<'a2>> * ?Y: seq<'a3> * ?MultiY: seq<seq<'a3>> * ?Text: 'a4 * ?MultiText: seq<'a4> * ?ColorBar: ColorBar * ?ColorScale: Colorscale * ?ShowScale: bool * ?ReverseScale: bool * ?Transpose: bool * ?ContourLineColor: Color * ?ContourLineDash: DrawingStyle * ?ContourLineSmoothing: float * ?ContourLine: Line * ?ContoursColoring: ContourColoring * ?ContoursOperation: ConstraintOperation * ?ContoursType: ContourType * ?ShowContourLabels: bool * ?ContourLabelFont: Font * ?Contours: Contours * ?FillColor: Color * ?NContours: int * ?UseDefaults: bool -> GenericChart (requires 'a1 :> IConvertible and 'a2 :> IConvertible and 'a3 :> 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>> * ?X: seq<'a2> * ?MultiX: seq<seq<'a2>> * ?Y: seq<'a3> * ?MultiY: seq<seq<'a3>> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?XGap: int * ?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 'a2 :> IConvertible and 'a3 :> IConvertible and 'a4 :> IConvertible) + 1 overload ...
static member Chart.Point: xy: seq<#System.IConvertible * #System.IConvertible> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'c * ?MultiText: seq<'c> * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: seq<StyleParam.TextPosition> * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol * ?MultiMarkerSymbol: seq<StyleParam.MarkerSymbol> * ?Marker: TraceObjects.Marker * ?AlignmentGroup: string * ?OffsetGroup: string * ?StackGroup: string * ?Orientation: StyleParam.Orientation * ?GroupNorm: StyleParam.GroupNorm * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart.GenericChart (requires 'c :> System.IConvertible)
static member Chart.Point: x: seq<#System.IConvertible> * y: seq<#System.IConvertible> * ?Name: string * ?ShowLegend: bool * ?Opacity: float * ?MultiOpacity: seq<float> * ?Text: 'a2 * ?MultiText: seq<'a2> * ?TextPosition: StyleParam.TextPosition * ?MultiTextPosition: seq<StyleParam.TextPosition> * ?MarkerColor: Color * ?MarkerColorScale: StyleParam.Colorscale * ?MarkerOutline: Line * ?MarkerSymbol: StyleParam.MarkerSymbol * ?MultiMarkerSymbol: seq<StyleParam.MarkerSymbol> * ?Marker: TraceObjects.Marker * ?AlignmentGroup: string * ?OffsetGroup: string * ?StackGroup: string * ?Orientation: StyleParam.Orientation * ?GroupNorm: StyleParam.GroupNorm * ?UseWebGL: bool * ?UseDefaults: bool -> GenericChart.GenericChart (requires 'a2 :> System.IConvertible)
static member Chart.withConfig: config: Config -> (GenericChart.GenericChart -> GenericChart.GenericChart)
module GenericChart from Plotly.NET
<summary> Module to represent a GenericChart </summary>
val toChartHTML: gChart: GenericChart.GenericChart -> string
val staticConfig: Config
val staticPlot: GenericChart.GenericChart
val editableConfig: Config
Multiple items
type Edits = inherit DynamicObj new: unit -> Edits static member init: ?AnnotationPosition: bool * ?AnnotationTail: bool * ?AnnotationText: bool * ?AxisTitleText: bool * ?ColorbarPosition: bool * ?ColorbarTitleText: bool * ?LegendPosition: bool * ?LegendText: bool * ?ShapePosition: bool * ?TitleText: bool -> Edits static member style: ?AnnotationPosition: bool * ?AnnotationTail: bool * ?AnnotationText: bool * ?AxisTitleText: bool * ?ColorbarPosition: bool * ?ColorbarTitleText: bool * ?LegendPosition: bool * ?LegendText: bool * ?ShapePosition: bool * ?TitleText: bool -> (Edits -> Edits)
<summary> The Edits object holds information about which elements of the chart are editable. </summary>

--------------------
new: unit -> Edits
static member Edits.init: ?AnnotationPosition: bool * ?AnnotationTail: bool * ?AnnotationText: bool * ?AxisTitleText: bool * ?ColorbarPosition: bool * ?ColorbarTitleText: bool * ?LegendPosition: bool * ?LegendText: bool * ?ShapePosition: bool * ?TitleText: bool -> Edits
val editablePlot: GenericChart.GenericChart
val responsiveConfig: Config
val responsivePlot: GenericChart.GenericChart