GenericChart Type
The central type that gets created by all Chart constructors is GenericChart, which itself represents either a single chart or a multi chart (as a Discriminate Union type). A GenericChart consists of four top level objects: Trace (multiple of those in the case of a MultiChart), Layout, Config, and DisplayOptions. - `Trace` is in principle the representation of a dataset on a chart, including for example the data itself, color and shape of the visualization, etc. - `Layout` is everything of the chart that is not dataset specific - e.g. the shape and style of axes, the chart title, etc. - `Config` is an object that configures high level properties of the chart like making all chart elements editable or the tool bar on top - `DisplayOptions` is an object that contains meta information about how the html document that contains the chart.
Union cases
| Union case |
Description
|
Full Usage:
Chart(data, layout, config, displayOpts)
Parameters:
Trace
layout : Layout
config : Config
displayOpts : DisplayOptions
|
|
Full Usage:
MultiChart(data, layout, config, displayOpts)
Parameters:
Trace list
layout : Layout
config : Config
displayOpts : DisplayOptions
|
|
Instance members
| Instance member |
Description
|
Full Usage:
this.IsChart
Returns: bool
|
|
Full Usage:
this.IsMultiChart
Returns: bool
|
|
Static members
| Static member |
Description
|
Full Usage:
GenericChart.addConfig config gChart
Parameters:
Config
-
the config to add
gChart : GenericChart
-
the input GenericChart to set the config on
Returns: GenericChart
|
Returns a new GenericChart with the given config combined with the given GenericChart's existing config.
|
Full Usage:
GenericChart.addDisplayOptions displayOpts gChart
Parameters:
DisplayOptions
-
the DisplayOptions to add
gChart : GenericChart
-
the input GenericChart to set the DisplayOptions on
Returns: GenericChart
|
Returns a new GenericChart with the given DisplayOptions combined with the given GenericChart's existing DisplayOptions.
|
Full Usage:
GenericChart.addLayout layout gChart
Parameters:
Layout
-
the layout to add
gChart : GenericChart
-
the input GenericChart to set the layout on
Returns: GenericChart
|
Returns a new GenericChart with the given layout combined with the given GenericChart's existing layout.
|
Full Usage:
GenericChart.combine gCharts
Parameters:
GenericChart seq
-
the input GenericCharts to combine
Returns: GenericChart
|
Combines a collection of GenericCharts, meaning that the traces, layout, config and display options of all elements are combined and returned as a single new GenericChart. Combination occurs step-wise in a `Seq.reduce`, where duplicate properties are overwritten on the accumulator by the current element in the collection. Traces are simply appended to a single list accumulator. Layout, Config, and DisplayOptions can contain properties that themselves are collections. These are combined by appending the values of the second to the first: - Layout: annotations, shapes, selections, images, sliders, hiddenlabels, updatemenus - Config: modeBarButtonsToAdd - DisplayOptions: AdditionalHeadTags, Description
|
Full Usage:
GenericChart.countTrace gChart
Parameters:
GenericChart
-
the input GenericChart
Returns: int
|
Returns the number of traces in the given GenericChart.
|
Full Usage:
GenericChart.existsTrace predicate gChart
Parameters:
Trace -> bool
-
the predicate to check for the trace items
gChart : GenericChart
-
the input GenericChart
Returns: bool
|
Returns true if the given chart contains a trace for which the predicate function returns true
|
Full Usage:
GenericChart.fromChartDTO dto
Parameters:
ChartDTO
-
The ChartDTO to convert
Returns: GenericChart
|
Creates a GenericChart from the given ChartDTO.
|
Full Usage:
GenericChart.fromFigure fig
Parameters:
Figure
-
The Figure DTO to convert
Returns: GenericChart
|
Creates a GenericChart from the given Figure DTO.
|
Full Usage:
GenericChart.getConfig gChart
Parameters:
GenericChart
-
the input GenericChart to get the config from
Returns: Config
|
Returns the config of a given GenericChart.
|
Full Usage:
GenericChart.getDisplayOptions gChart
Parameters:
GenericChart
-
the input GenericChart to get the DisplayOptions from
Returns: DisplayOptions
|
Returns the DisplayOptions of a given GenericChart.
|
Full Usage:
GenericChart.getLayout gChart
Parameters:
GenericChart
-
the input GenericChart to get the layout from
Returns: Layout
|
Returns the layout of a given GenericChart.
|
Full Usage:
GenericChart.getTraceID gChart
Parameters:
GenericChart
-
the input genericChart
Returns: TraceID
|
returns a single TraceID (when all traces of the charts are of the same type), or traceID.Multi if the chart contains traces of multiple different types
|
Full Usage:
GenericChart.getTraceIDs gChart
Parameters:
GenericChart
-
the input genericChart
Returns: TraceID list
|
returns a list of TraceIDs representing the types of all traces contained in the chart.
|
Full Usage:
GenericChart.getTraces gChart
Parameters:
GenericChart
-
the input GenericChart to get all traces from
Returns: Trace list
|
Returns all traces of a given GenericChart.
|
Full Usage:
GenericChart.mapConfig f gChart
Parameters:
Config -> 'a
-
the function to apply to the config
gChart : GenericChart
-
the input GenericChart
Returns: GenericChart
Type parameters: 'a (requires :> Plotly.NET.Config) |
Creates a new GenericChart whose config is the results of applying the given function to the config of the input GenericChart.
|
Full Usage:
GenericChart.mapDisplayOptions f gChart
Parameters:
DisplayOptions -> 'a
-
the function to apply to the DisplayOptions
gChart : GenericChart
-
the input GenericChart
Returns: GenericChart
Type parameters: 'a (requires :> Plotly.NET.DisplayOptions) |
Creates a new GenericChart whose DisplayOptions is the results of applying the given function to the DisplayOptions of the input GenericChart.
|
Full Usage:
GenericChart.mapLayout f gChart
Parameters:
Layout -> 'a
-
the function to apply to the layout
gChart : GenericChart
-
the input GenericChart
Returns: GenericChart
Type parameters: 'a (requires :> Plotly.NET.Layout) |
Creates a new GenericChart whose layout is the results of applying the given function to the layout of the input GenericChart.
|
Full Usage:
GenericChart.mapTrace f gChart
Parameters:
Trace -> Trace
-
the function to apply to each trace item
gChart : GenericChart
-
the input GenericChart
Returns: GenericChart
|
Creates a new GenericChart whose traces are the results of applying the given function to each trace item of the input GenericChart.
|
Full Usage:
GenericChart.mapiTrace f gChart
Parameters:
int -> Trace -> Trace
-
the function to apply to each trace item
gChart : GenericChart
-
the input GenericChart
Returns: GenericChart
|
Creates a new GenericChart whose traces are the results of applying the given function to each trace item of the input GenericChart. The integer index passed to the function indicates the index (from 0) of element being transformed.
|
Full Usage:
GenericChart.ofTraceObject useDefaults trace
Parameters:
bool
-
wether or not to set default objects for Layout, Config and DisplayOptions
trace : Trace
-
the input Trace
Returns: GenericChart
|
Creates a GenericChart from a trace object. The objects set for the Layout, Config and DisplayOptions depend on `useDefaults`: If true, the default objects found in `Defaults` are used. If false, empty objects are used.
|
Full Usage:
GenericChart.ofTraceObjects useDefaults traces
Parameters:
bool
-
wether or not to set default objects for Layout, Config and DisplayOptions
traces : 'a
-
the input Trace collection
Returns: GenericChart
Type parameters: 'a (requires :> Plotly.NET.Trace Microsoft.FSharp.Collections.seq) |
Creates a GenericChart from a list of trace objects. The objects set for the Layout, Config and DisplayOptions depend on `useDefaults`: If true, the default objects found in `Defaults` are used. If false, empty objects are used.
|
Full Usage:
GenericChart.setConfig config gChart
Parameters:
Config
-
the config to set
gChart : GenericChart
-
the input GenericChart to set the config on
Returns: GenericChart
|
Returns a new GenericChart with the given config.
|
Full Usage:
GenericChart.setDisplayOptions displayOpts gChart
Parameters:
DisplayOptions
-
the DisplayOptions to set
gChart : GenericChart
-
the input GenericChart to set the DisplayOptions on
Returns: GenericChart
|
Returns a new GenericChart with the given DisplayOptions.
|
Full Usage:
GenericChart.setLayout layout gChart
Parameters:
Layout
-
the layout to set
gChart : GenericChart
-
the input GenericChart to set the layout on
Returns: GenericChart
|
Returns a new GenericChart with the given layout.
|
Full Usage:
GenericChart.toChartDTO gChart
Parameters:
GenericChart
-
The GenericChart to convert
Returns: ChartDTO
|
Creates a ChartDTO from the given GenericChart.
|
Full Usage:
GenericChart.toChartHTML gChart
Parameters:
GenericChart
-
The input GenericChart to return as HTML string
Returns: string
|
Returns the HTML string representation of a given GenericChart. The resulting HTML string contains a a div tag containing the chart, and a script tag containing the javascript to create it. Note that no references to the necessary scripts are included, so these must be added separately.
|
Full Usage:
GenericChart.toChartHTMLNodes gChart
Parameters:
GenericChart
-
The input GenericCharts to return as HTML nodes
Returns: XmlNode
|
Returns the HTML node representation of a given GenericChart. The resulting HTML node contains a a div tag containing the chart, and a script tag containing the javascript to create it. Note that no references to the necessary scripts are included, so these must be added separately.
|
Full Usage:
GenericChart.toEmbeddedHTML gChart
Parameters:
GenericChart
-
The input GenericChart to return as HTML string
Returns: string
|
Returns the HTML string representation of a given GenericChart embedded into a full HTML document. The resulting HTML string contains a head tag with references according to the input GenericChart's DisplayOptions, and a body tag containing the chart div, a script tag containing the javascript to create the chart, and a div tag containing the chart description.
|
Full Usage:
GenericChart.toFigure gChart
Parameters:
GenericChart
-
The GenericChart to convert
Returns: Figure
|
Creates a Figure DTO from the given GenericChart.
|
Full Usage:
GenericChart.toFigureJson gChart
Parameters:
GenericChart
-
the chart to serialize
Returns: string
|
Serializes a GenericChart to a JSON string, representing the data and layout of the GenericChart, together with an empty frame array (not supported): { "data": [ -serialized traces array- ] , "layout": { -serialized layout object- } , "frames": [ -empty array, not supported yet- ] }
|
Full Usage:
GenericChart.toJson gChart
Parameters:
GenericChart
-
the chart to serialize
Returns: string
|
Serializes a GenericChart to a JSON string, representing the data, layout and config of the GenericChart: { "data": [ -serialized traces array- ] , "layout": { -serialized layout object- } , "config": { -serialized config object- } }
|
Full Usage:
GenericChart.tryGetLayoutSize gChart
Parameters:
GenericChart
-
the input GenericChart to get the layout size from
Returns: int option * int option
|
Returns a tuple containing the width and height of a GenericChart's layout if the property is set, otherwise None.
|
Plotly.NET