Marker Struct

Markers (built-in and user-defined symbols). The 21 preset markers are listed below (these can be scaled to any size using the SetMarkerScales method) or you may create your own markers from suitable image files (typically GIF images on disk), SVG symbols, or any text character in a suitable font (e.g. WingDings).

public struct Marker

Public Constructor

Creates a custom dashed marker from a character, or URI to an included symbol or image file.

public Marker(
   string newDefinition
);

Example

sp.SetMarkers(new Marker[]{Marker.Cross,Marker.Lozenge});
Marker ms = new Marker("wingdings,9,#146");

Public Static Properties

BallMarker is a large 3D-effect circle
BarMarker is a short vertical line
BlockMarker is a filled square
BulletMarker is a medium-sized filled circle
CircleMarker is an open circle
CrossMarker is a multiply sign
DelMarker is a triangle on its point
DiamondMarker is an open diamond
DotMarker is a tiny (approx 1 pixel) dot
DownTickMarker is a downward tick
HyphenMarker is a short horizontal line
InvisibleMarker is not drawn
LeftTickMarker is a left-aligned tick
LozengeMarker is a filled diamond
NodeMarker is a small 3D-effect circle
PlusMarker is a plus sign
RightTickMarker is a right-aligned tick
RingMarker is a large open circle
SmallBulletMarker is a small filled circle
TriangleMarker is a triangle on its base
UpTickMarker is an upward tick

Creating Custom Markers

The WingDings font is an excellent source of extra marker symbols, and SharpPlot makes it very easy to create markers from any character in any available font. Note that character markers may not work on your user’s browser in the VML or SVG formats unless the correct font is installed. For image formats, the font only needs to be installed on the server.

The string argument to Marker takes three elements, separated by commas. These give:

It is also possible to use small image files as markers (VML and SVG output only) in which case you simply give the URL of the marker file, with an optional ‘natural size’ to scale it:

sp.SetMarkers(new Marker("apple.gif=12,12"));

By default, the image will have its normal size where the marker scale = 1. It is obviously important to keep the width and height of the included image in the same ratio as the actual width and height of the referenced file.

For SVG output, it is possible to include the code for any SVG symbol inline in the output stream, then refer to the included symbol by its id:

sp.IncludeSource(myDuck);
sp.SetMarkers(new Marker[]{Marker.Lozenge,new Marker("#duck=32,24")});

where the first few lines of the duck might be:

 <symbol id="duck" viewBox="0 0 3200 2400">
   <path d="
        M 424 1424 ...

The proportions given in the viewbox should normally match the width and height given for the symbol in the definition.

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | SetMarkers Method