Skip to content

Markers

LucyMu edited this page Dec 17, 2018 · 2 revisions

Markers plot is one of the plot types that can be added to the chart.

Markers creation

To create a markers plot you need two series: Xcoords: float seq and Ycoords: float seq that define the position of each marker.

let markers = createMarkers Xcoords Ycoords

Note

Actually the markers plot is a record of type FSharpIDD.Plots.Markers.Plot

You can also create it by explicitly filling up all record fields:

{
		/// Specifies how to annotate markers in the legend. Null means that name is not set
		Name: string
		/// Series of X coordinates of markers
		X: DataSeries
		/// Series of Y coordinates of markers
		Y: DataSeries
		/// Specifies the size of one marker in pixels
		Size: float
		/// The colour with which the colour will be filled
		FillColour: Colour.Colour
		/// The colour of a marker border
		BorderColour: Colour.Colour
		/// The shape of a marker
		Shape: Shape
}

Configuring markers style

The markers plot has five appearance options that can be configured:

  • Name (as it's seen in a legend)
  • Marker size (in pixels)
  • Marker shape
  • Marker fill colour
  • Marker border colour

You can use the following functions of the module FSharpIDD.Plots.Markers to define the options respectively:

  • setName: name:string -> markers:Plot -> Plot
  • setSize: size:Float -> markers:Plot -> Plot
  • setShape: shape:Markers.Shape -> markers:Plot -> Plot
  • setFillColour: fillColour:Colour.Colour -> markers:Plot -> Plot
  • setBorderColour: borderColour:Colour.Colour -> markers:Plot -> Plot

Example

let markers1 = 
    createMarkers Xseries Yseries
    |> setName "Markers 1"
    |> setSize 20.0
    |> setShape Shape.Cross
    |> setFillColour Colour.Green
    |> setBorderColour Colour.Blue

There is also an option to set several appearance characteristics with a single setOptions: options:Options -> markers:Plot -> Plot call.

The convenience of the method is that you can define several (but not necessarily all) options during Options value creation.

Example

let markerOptions = Options(Name = "MarkersPlot", Thickness = 30.0, Shape=Shape.Diamond)
let markersPlot =
    createMarkers Xseries Yseries
    |> setOptions markerOptions 
Clone this wiki locally