SharpPlot 2.51 User Manual: General Tutorials

SharpPlot business and scientific charting
General Tutorials

SharpPlot offers a comprehensive range of Properties and Methods for constructing business and scientific charts from arrays of data. The design allows the programmer to create effective graphics with the bare minimum of coding:

SharpPlot sp = new SharpPlot(360,240);
data = new int[] {18,27,31,12,19,23};
sp.DrawBarChart(data);
Bitmap bmp = sp.RenderBitmap(96);

To follow the steps required to create a simple business chart you can look at the C# source for a simple command-line program to draw a barchart similar to the one shown above. If you need to write the script in APL or VB, have a look a the Language tutorial to see how to translate C# samples into APL or VB scripts.

Topics covered

Installing SharpPlot
SharpPlot is shipped as a single DLL, with accompanying XML documentation for use by visual development tools.
Your First Chart
Let’s build a simple chart that will be the nearest thing to a “Hello World” example.
SharpPlot in Different Languages
SharpPlot being delivered both as a .Net assembly and as an APL workspace, it can be used in many different languages. This tutorial shows how to write the same SharpPlot script in different languages (C#, VB/.Net, Dyalog APL/.Net, Dyalog APL).
Some Terms Defined
Most of the basic chart terms are illustrated here.
Rendering a chart to image
SharpPlot can generate the finished chart in any of five common vector formats (SVG, PDF, EPS, EMF, VML) and any raster image format supported by the .net Bitmap class (PNG, JPEG, BMP, GIF, TIF).
Creating a Business Graphic
SharpPlot is shipped with sample.cs which illustrates many of the capabilities you need to generate effective business graphics. This short tutorial takes the chart step by step and explains the various properties and methods used to construct it.
Working with Multiple Series
There are many strategies for showing multiple data series in the same charting space. This tutorial explores the ways SharpPlot allows you to approach the issue of arranging several series on the same page.
Grouping and Splitting Database Data
Many aggregations can be done very easily in SQL, and SharpPlot simply used to plot the group totals. The methods explored in this tutorial show you how to make more complex summaries and cross-tabs directly from the raw data series.
Adding Links & Handlers
SharpPlot makes it particularly easy to add hyperlinks and other JavaScript handlers to your charts. This tutorial shows how you can associate links and some simple handlers with each sector of a piechart. Try clicking on the sectors of the piechart for a simple popup message.
Formatting text with simple HTML tags
SharpPlot allows a limited subset of HTML tags to be included in all text elements, typically headings or axis labels.
Using Picture Formatters
You may apply a ‘picture’ format to numeric values, and also to text labels to enforce truncation or wrapping into a given width.
Using Date and Time Axes
Timeseries data from Excel or from a database query is often held internally as floating-point numbers where the integer part represents the date (the number of days elapsed since 1900) and the decimal part the time of day. This scheme is accurate to around 2 sec with normal floating-point precision and is equivalent to the OLE date format.
The CMYK Color Model
On top of the standard ARGB color model (Alpha Red Green Blue – for monitor display), SharpPlot supports and the CMYK color model (Cyan Magenta Yellow Black – for ink mixing). CMYK colors are encoded are ARGB colors with an alpha channel (opacity) between 0 and 8. This is why, when using ARGB colors (which is standard .Net approach), you shouldn’t use opacity smaller than 9, otherwise the colors will appear “random”.
Using the gradient fills
The way gradients (both linear and radial) are defined varies greatly between output formats, so SharpPlot defines a reasonable set of standard fillstyles for you, and where necessary (surface-filled linegraphs and piecharts) enforces a reasonable bounding rectangle on the fill definition.
The Barley Experiment
Many of the examples in the manual use a dataset collected in the 1930s from an experiment to investigate barley yields. Ten varieties of seed were planted at 6 farms over 2 years and the yields from each plot measured to give 120 data points.
Sample Datasets supplied as XML
Several simple databases are included with the SharpPlot distribution to allow you to experiment with grouping and splitting data. The smallest of these is an invented Sales Information database with two products and some monthly figures:

There is also a full set of tutorials specific to each type of chart.


SharpPlot 2.51 User Manual: Installing SharpPlot

Installing SharpPlot

SharpPlot is shipped as a single DLL, with accompanying XML documentation for use by visual development tools.

Simply copy the files, and add it to your development project to make it available for use.

SharpPlot makes no registry entries on your machine, and never requires access to any data files. All communication with your application is handled via data (passed as arguments) and results from the various rendering methods.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: Your First Chart

Your First Chart

Let’s build a simple chart that will be the nearest thing to a “Hello World” example.

// Getting started with SharpPlot.

using System;
using System.Drawing;
using System.Drawing.Imaging;
using Causeway;

namespace SharpPlotSample
{
  class Example
  {
    static void Main(string[] args)
    {
      // A simple composite chart showing most key features
       SharpPlot sp = new SharpPlot(360,240);
       sp.Heading = "Hello, Barchart!";
       int[] data = new int[] {6,18,27,31,56,72,45};
       string[] xlabs = new string[]{"Jan","Feb","Mar","Apr","May","June","July"};
       sp.SetXLabels(xlabs);
       sp.DrawBarChart(data);

      // Render the chart as a 96dpi PNG image, and save to file
       sp.SaveImage("firstbar.png",ImageFormat.Png,96);
       Console.WriteLine("Saved as firstbar.png!");
    }
  }
}

This will create the chart at the top of the page as an image file on disk.

How it all works

A good way to begin to learn about SharpPlot is to copy and modify the source, changing some properties and adding some new ones to see the effect. The SharpPlot engine is a ‘state machine‘ – you can set any of its internal properties at any time, and they stay set until you reset them. The current state influences the appearance and style of all the drawing commands in a logical and predictable way, but everything has a good default value to begin with.

The commands in the sample program work like this:

SharpPlot sp = new SharpPlot(360,240);
This resets all properties to their default values and clears a ‘chart area’ covering 360 by 240 points. This is a little smaller than the default size, and is a comfortable shape for many standard business charts.
sp.Heading = “Hello, Barchart!”;
The main heading is centred in the top margin by default.
sp.SetXLabels(xlabs);
Labels are defined with one value per data-point
sp.DrawBarChart(data);
Now we can draw the chart!
sp.SaveImage( ... );
Render the completed chart to file at 96dpi.

Spicing it up

You might guess that to change the default positioning of the heading, you could add a HeadingStyle property, and maybe you would like the abut the bars, so you could set the Gap property to zero. In general, SharpPlot is designed so that everything looks good when you take all the defaults, but if you have a specific design in mind, you can control the appearance of your chart very finely indeed. Here is the same chart with a few properties added, and some changes to styles and fonts to give you an idea of the possibilities:

The body of the sourcecode now looks like this:

   // Do it again, but prettier?
    sp.Reset(360,240);
    sp.SetBackground(Color.Purple,FillStyle.SpotTopLeft,2);
    sp.SetAxisStyle(Color.White,LineStyle.Solid,2.5);
    sp.Heading = "Hello again, Barchart!";
    sp.SetHeadingFont("Arial",18,FontStyle.Bold,Color.LemonChiffon);
    sp.SetLabelFont("Arial",10,FontStyle.Bold,Color.WhiteSmoke);
    sp.SetColors(Color.LimeGreen);
    sp.SetFillStyles(FillStyle.Drum);
    sp.HeadingStyle = HeadingStyles.Right;
    sp.Gap = 0.4;
    sp.SetXLabels(xlabs);
    sp.DrawBarChart(data);

This adds several properties, the most important being the Background to change the paper colour from white to deep purple with a spotlight gradient. It also sets the axes to white (and a little heavier) and changes the typesizes and colours for the various text elements. The x and y captions have also been centred and the heading is aligned with the right margin.

In general, you should start with a minimal collection of properties, and a very simple script. This approach lets you focus on getting the data correct, while leaving almost all the properties set to their default values. Once you have the chart working, then you can let the designers loose to play with the colours, typefaces and layout, adding more properties as you need them.


SharpPlot 2.51 User Manual: SharpPlot in Different Languages

SharpPlot in Different Languages

SharpPlot being delivered both as a .Net assembly and as an APL workspace, it can be used in many different languages. This tutorial shows how to write the same SharpPlot script in different languages (C#, VB/.Net, Dyalog APL/.Net, Dyalog APL).

Sample chart in C#

Here’s the code to produce that chart from C#. It can be used as a Rosetta stone for users trying to write scripts in other languages.

To build this project in Visual Studio, a few steps are required :

  • Create a Console C# project in Visual Studio
  • Add a reference to System.Drawing (Project → Add Reference... → .Net)
  • Add a reference to sharpplot.dll (Project → Add Reference... → Browse)
  • Paste the following code into your main .cs file
  • Build and run
using System;
using System.Drawing;       // Requires adding a reference to System.Drawing to the C# project
using System.Drawing.Imaging;
using Causeway;             // Requires adding a reference to sharpplot.dll to the C# project
namespace MyNamespace
{
  class MyClass
  {
    static void Main(string[] args)
    {
        SharpPlot sp = new SharpPlot();
        int[] data = {33, 18, 12, 10};
        int[] exp = {0, 0, 0, 20};
        string[] key = {"UK", "France", "Italy", "Ireland"};
        sp.Heading = "Sample pie chart";                              ⍝ Setting a property
        sp.SetKeyText(key);                                           ⍝ Calling a function with a single argument
        sp.KeyStyle = KeyStyles.CenterAlign|KeyStyles.BottomAlign;    ⍝ Setting a flags enumeration property
        sp.PieChartStyle = PieChartStyles.ValueTags;
        sp.DrawPieChart(data, exp);                                   ⍝ calling a function with multiple arguments
        // Render the chart as a 96dpi PNG image, and save to file
        sp.SaveImage("samplepie.png", ImageFormat.Png, 96);
        Console.WriteLine("Saved as samplepie.png!");
    }
  }
}

Sample chart in VB.Net

Here’s the same script in VB.Net. You can build it in a few steps :

  • Create a Console VB.Net project in Visual Studio
  • Add a reference to System.Drawing (Project → Add Reference... → .Net)
  • Add a reference to sharpplot.dll (Project → Add Reference... → Browse)
  • Paste the following code into your main .vb file
  • Build and run
Imports System
Imports System.Drawing   ' Requires adding a reference to System.Drawing to the VB.Net project
Imports System.Drawing.Imaging
Imports Causeway         ' Requires adding a reference to sharpplot.dll to the VB.Net project
Module MyModule
    Sub Main()
        Dim sp As SharpPlot = New SharpPlot
        Dim data As Integer() = New Integer() {33, 18, 12, 10}
        Dim exp As Integer() = New Integer() {0, 0, 0, 20}
        Dim key As String() = New String() {"UK", "France", "Italy", "Ireland"}
        sp.Heading = "Sample pie chart"
        sp.SetKeyText(key)
        sp.KeyStyle = KeyStyles.CenterAlign+KeyStyles.BottomAlign
        sp.PieChartStyle = PieChartStyles.ValueTags
        sp.DrawPieChart(data, exp)
        ' Render the chart as a 96dpi PNG image, and save to file
        sp.SaveImage("samplepie.png", ImageFormat.Png, 96)
        Console.WriteLine("Saved as samplepie.png!")
    End Sub
End Module

Sample chart in Dyalog APL/.Net

Because Dyalog has a .Net bridge, it can use sharpplot.dll directly, which is in the default Dyalog installation directory, and can be accessed by setting ⎕USING to ‘,sharpplot.dll’.

Refer to the Dyalog .Net Interface Guide if you need explanations about how to use .Net objects and pass arrays as arguments.

∇ MyChart;⎕USING;data;exp;key;sp
  ⎕USING←'System.Drawing,system.drawing.dll' 'System.Drawing.Imaging' 'Causeway,sharpplot.dll'
  data←33 18 12 10
  exp←0 0 0 20
  key←'UK' 'France' 'Italy' 'Ireland'
  sp←⎕NEW SharpPlot
  sp.PieChartStyle←PieChartStyles.ValueTags
  sp.Heading←'Sample pie chart'
  sp.SetKeyText⊂key                               ⍝ need to enclose the key vector because it is a single argument, rather than a list of arguments
  sp.KeyStyle←KeyStyles.(CenterAlign+BottomAlign)
  sp.DrawPieChart data exp                        ⍝ no need to enclose here because the 2-item vector maps to 2 different arguments

  ⍝ Render the chart as a 96dpi PNG image, and save to file
  sp.SaveImage'samplepie.png'ImageFormat.Png 96
  ⎕←'Saved as samplepie.png!'
∇

Sample chart in non-.Net Dyalog APL

Since Dyalog v14.0, SharpPlot is also shipped as a pure-APL workspace, than can be used on all platforms supported by Dyalog. All you need to do is to copy sharpplot.dws.

The main differences from using SharpPlot through the .Net bridge are :

  • Because you have access to pure APL functions, the functions are more tolerant than the .Net bridge for argument passing. In particular you don’t need to enclose single-argument arrays.
  • Properties are NOT accessed through variables, like in the .Net bridge, but must be set through their setter function, whose name is the name of the property, prefixed by ‘Set’.
  • Raster graphics and custom fonts are not available. Charts can be output only as SVG, PostScript or PDF (VML is deprecated and should not be used).
∇ MyChart;data;exp;key;sp
  data←33 18 12 10
  exp←0 0 0 20
  key←'UK' 'France' 'Italy' 'Ireland'
  sp←new SharpPlot
  sp.SetPieChartStyle PieChartStyles.ValueTags    ⍝ Properties are access through their Set function, not by assigning the name
  sp.SetHeading'Sample pie chart'                 ⍝ same as above
  sp.SetKeyText key                               ⍝ no need to enclose because SharpPlot/APL is more tolerant than SharpPlot/.Net
  sp.SetKeyStyle KeyStyles.(CenterAlign+BottomAlign)
  sp.DrawPieChart data exp
  ⍝ Render the chart as a 96dpi PNG image, and save to file
  sp.SaveSvg'samplepie.svg'                       ⍝ SharpPlot/APL doesn't support raster graphics : SVG is the recommended way to export charts.
  ⎕←'Saved as samplepie.svg!'
∇

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: Some Terms Defined

Some Terms Defined

Most of the basic chart terms are illustrated here.

Paper

The entire region available for drawing the chart. It comprises the chart area and the gutter that surrounds it. The width and height can be set explicitly when you create a SharpPlot instance. The settings for color, fill style and thickness of the border line can be adjusted through the SetBackground method.

Gutter

The region lying between the edge of the paper and the chart area. The gutter has a uniform depth and, if the Gutter property is set to zero, the paper and chart area have identical dimensions.

Chart Area

The entire region used for the chart, axes, headings and so on. By default, its dimensions are the paper size less the gutter, but the NewFrame method can be used to alter the size of chart area. The settings for color, fill style and thickness of the border line can be changed through the SetFrameBackground method to create, for example, a ‘boxed’ chart (as in the diagram) where a thick line is drawn around it. The chart area that lies outside of the plotting region and that contains the heading, subheading and footnotes is known as the frame. The DrawFrame method can be used to draw this separately, which is useful when, for example, you want to draw several smaller charts on a single piece of paper.

Plotting Region

The rectangle formed by the X and Y axes, stretching between the first and last tick marks in each direction. By default, SharpPlot will leave this clear of all elements except plotted data, but you can choose to place the key here, or to add text notes after the plot is complete. The settings for plotting region color, fill style and thickness of the border line can be modified through the SetChartBackground method.

Margins

The area outside the plotting region up to the boundary of the chart area. By default SharpPlot leaves space for the Y-axis on the left (with labels of up to four digits), the X-axis and key at the foot, and a one-line heading at the top. If you require longer labels or a deeper heading, you will probably need to adjust these settings with the Margins property. This gives the (top,bottom,left,right) margins as shown, or you can set the margins individually with MarginTop and so on. All values are in points.

Chart Heading

The main title for the chart. By default this is written centred at the top of the chart, but you can place it as required by setting the heading style.

Axis Captions

You can set captions for any of the X, Y and Z axes. You can also choose, for example, to have (short) Y-axis captions written horizontally at the end of the axis rather than up the side by setting YAxisStyle.

Axis Labels

These are written at each tick mark. By default, SharpPlot uses numeric labels, but you can scale, format, or over-ride these as required. You can also choose to have the X-axis labels written midway between tick marks, which is often suitable for weekly or monthly data.

Grid Lines

These are lightly-drawn horizontals and verticals which extend from the major tickmarks across the plotting region.

Baseline

This determines how barcharts and surface charts are shaded. You can leave the X-axis at the bottom and set a baseline part-way up the Y-axis to give the effect of bars which ‘hang’ from a norm, or to shade above and below a standard setting.

Key or Legend

This is written (by default) across the foot of the chart, and shows a small sample of the colour / marker / fill style for each line or bar, with a short section of explanatory text beside it. You can place the key anywhere within the chart area or margins, and multiple charts may share a single key.

Value Tags

Scatter plots, piecharts and barcharts may be annotated with data values. For scatter plots these are simple numeric values written beside each data point, for barcharts you can choose to write them on top of each bar or just inside the bar, and for piecharts they will normally be written around the edge of the pie using radial ‘spider’ tags from each segment.

Chart Notes

You can add free text (optionally boxed) anywhere within the chart area. Notes are positioned using the (x,y) coordinates of the last chart plotted, except for piecharts where the plotting region has a notional coordinate system of 0 – 100 in both directions.

Nudge

The position of the Chart Heading, Key, Chart Notes and Value Tags can be shifted in the X- and Y-dimensions through the corresponding nudge property.

Datum Lines

These are normally added after the plot is complete to mark important ‘cut off’ lines, such as +/- 2 standard deviations on a control chart.

Data Analysis

Some charts have one or more styles that use regression (GrowthCurve, ModelFit) or Gaussian smoothing (TrendLine) to calculate and draw a line that best fits the data.

Walls

These are the YZ, XZ and XY backplanes of a 3D chart. The settings can be altered with the SetWallFillStyles method.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: Rendering a chart to image

Rendering a chart to image

SharpPlot can generate the finished chart in any of five common vector formats (SVG, PDF, EPS, EMF, VML) and any raster image format supported by the .net Bitmap class (PNG, JPEG, BMP, GIF, TIF).

Vector vs Raster graphics

Raster graphics have a fixed resolution, so that the graphics are stored as a big matrix of monochrome cells – pixels – possibly with some compression. This forces the choice of a resolution (size in pixels of the whole image) at rendering time.

Vectorial graphics instead are stored as instructions to draw the graphics on an arbitrary XY plane. This means that they can be arbitrarily scaled on the output device. At rendering time, all you have to consider is how to scale it (Fixed size, Fixed Aspect, Stretch...)

In general, any vector format will be smaller (in byte count) than the corresponding raster image by a factor of between 5 and 10, excepted for charts which have a dense matrix of points, such as a contour plot with altitude shading, where the altitude shading is fundamentally a matrix of pixels.

Vectorial formats

  • SVG (Scalable Vector Graphic) is a ratified W3C standard and becoming the standard to vectorial graphics, supported by all modern web browsers – the latest to support it being Microsoft Internet Explorer version 9 (2011).
  • PDF (Portable Document Format) is a good format if you want to email a completed chart, or post several charts as a single document on your website. It might be a convenient way of packaging a large collection of graphs, with an appropriate navigation tree created by SharpPlot as bookmarks. It is the only format which works well with multiple pages.
  • EPS (Encapsulated PostScript). This is very suitable for including single charts in published documents prepared with high-end DTP software for printing on any PostScript device.
  • EMF (Enhanced Metafile). This is ideal for saving as a temporary format, and pasting into Word or PowerPoint.
  • VML (Vector Markup Language) was the vectorial graphics language designed by Microsoft for Internet Explorer 5. It is based on a W3C proposal (May 1998) but is unlikely to progress to a ratified open standard. VML is no longer supported by Microsoft and should not be used.

Raster formats

.Net supports the following raster formats : PNG, BMP, GIF, JPEG, TIF (see System.Drawing.Imaging.ImageFormat). These enumerations are passed as arguments to SaveImage and RenderBitmap functions which respectively save the completed chart on disk, and return it as a Bitmap object, which may for example be returned to the browser via http.

These functions takes the DPI to create the image at. To have the bounding box of the chart in pixels match the required height and width of the image in points, use 72 for the DPI setting (because there are 72 points per inch, and that SharpPlot use the point at its default unit).

Generally, for web publication, the default DPI setting of 96 – the pseudo-standard computer screen resolution – will be more appropriate. Remember to adjust the parameters in the image tag to match, if embedding the picture in a web page.

Here is an image tag suitable for a chart created with SharpPlot(432,324) and rendered with sp.RenderImage(96) to scale it up a little:

<img src="mychart.png" height=432 width=576 border=0 >

If you are creating charts to be printed at 300DPI, you should use RenderImage(300) which will generate a much larger picture, at the real size of the chart, in 72th of inches.

See also ...

SharpPlot | RenderBitmap | RenderEps | RenderMetafile | RenderPdf | RenderSvg | SaveImage

Send comments on this topic
© Dyalog Ltd 2014


SharpPlot 2.51 User Manual: Creating a Business Graphic

Creating a Business Graphic

SharpPlot is shipped with sample.cs which illustrates many of the capabilities you need to generate effective business graphics. This short tutorial takes the chart step by step and explains the various properties and methods used to construct it.

Here is the completed graphic, rendered to a Bitmap for inclusion in the help file.

Defining the data

// Data used in all the examples below
 data1 = new int[] {6,18,27,31,56,72,45,12};
 data2 = new int[] {9,23,32,33,59,81,47,13};
 xlabs = new string[]{"Jan","Feb","Mar","Apr","May","June","July","August\n(part)"};

These are the series used to draw the bars and the overlay line.

Step 1: a Simple Barchart

The first step is to set the chart heading, and to define the ‘paper’ with a suitable background color and fill pattern.

// First example with a barchart
 sp.Reset();
 sp.Heading = "Financial Summary for Current Year";
 sp.SetHeadingFont("Arial",18,FontStyle.Bold,Color.Firebrick);
// Use a simple shaded paper as background
 sp.SetBackground(Color.Wheat,FillStyle.Solid);
 sp.MarginTop = 56;  // Leave a lttle more headspace
 sp.YCaption = "$M";
 sp.YAxisStyle = YAxisStyles.ForceZero|YAxisStyles.AtEndCaption;
 sp.SetXLabels(xlabs);
 sp.DrawBarChart(data1);

The heading is a simple string property, which may contain newline characters. The ‘font’ is actually a composite of the font face, the point-size, the style and the color. Any combination of these may be given – the other elements retain their current settings. Note that you can give a list of font faces here, for example “Verdana,Arial,sans” would be fine for a chart destined to be rendered to VML or SVG.

This example also sets a slightly generous top margin, and places the Y-axis caption at the end of the axis, rather than in its default location which is written vertically alongside the axis. The X-axis labels are set with an array of labels (passed as strings) which again may contain embedded newlines.

Finally, you may have noticed that the Y-axis has been forced to range from zero, rather than taking the default lower limit from the data.

Step 2: Overlaying a LineGraph

The second step illustrates an important feature of the way SharpPlot retains state information. As soon as you draw a chart, you effectively fix the range of the X and Y axes from the given data. These axes can then be re-used over and over again by further charts, in this case a linegraph which shares the same X and Y scales.

// Overlay a linegraph on the same axis set
 sp.SetLineStyles(LineStyle.Dash);
 sp.SetColors(Color.DodgerBlue);
 sp.DrawLineGraph(data2);

SharpPlot works with the concept of color and LineStyle cycles, so you can pass an array of colors or line-styles here. If you are only plotting a single series (as here) then a single color and line-style are all you need.

As you can see, the line is a little lightweight visually, so it is given a much stronger presence in Step-3.

Step 3: Customising the Line

That looks better!

sp.LineGraphStyle = LineGraphStyles.Markers|LineGraphStyles.Risers|LineGraphStyles.Curves;
sp.SetLineStyles(LineStyle.Dash);
sp.SetMarkers(Marker.Lozenge);
sp.SetColors(Color.DodgerBlue);
sp.SetPenWidths(0.8);  // For line and risers
sp.Flexibility = 5;  // For curved line
sp.DrawLineGraph(data2);

The main change is to increase the pen-width (again you may set an array here for multiple series), add Risers from the axis to lozenge-shaped markers, and join the points with a smooth curve.

Step 4: adding a Datumline and a Legend

This shows an example of a Datum line, which has been defined with a customised dash-repeat.

sp.SetDatumLineStyle(Color.Navy,new LineStyle(new int[] {24,3,2,3,2,3}));
sp.SetYDatumLines(40);

You can set a single datum-line (as here) or an array of lines to draw horizontals at multiple Y-values.

This chart also has a simple legend, which describes both series.

// Key picks up series info from both charts
 sp.SetKeyText(new string[]{"Revenue","Invoiced Sales"});
 sp.KeyStyle = KeyStyles.Boxed|KeyStyles.Rounded;

Each time you call one of the SharpPlot ‘Draw’ routines, information about the series is automatically added to the key. All you need to do is to add some text describing each bar or line, and an appropriate legend will be created for you.

Step 5: Adding a Summary Piechart

Piecharts are treated by SharpPlot as ‘rolled-up’ barcharts, so they have X-labels. Again, you can set an array of colours here, which are used one-per-sector, running clockwise from 12:00.

sp.SetXLabelFont("Arial",13.4,FontStyle.Bold,Color.Navy);
sp.SetXLabels(new string[]{"Home","Export"});
sp.SetPieCenter(100,180);
sp.PieRadius = 50;
sp.SetEdgeStyle(Color.Wheat,LineStyle.Solid,1.2);
sp.SetColors(Color.Firebrick);
sp.DrawPieChart(new int[] {34,23});

Having set up the labels and colors, we can place the pie at a specific (x,y) location and reduce its radius to half the default value. It can be edged with a thick line in the current background colour to blend in nicely with the whole graphic.

sp.SetXLabelFont("Arial",13.4,FontStyle.Bold,Color.Navy);
sp.SetXLabels(new string[]{"Home","Export"});
sp.SetPieCenter(100,180);
sp.PieRadius = 50;
sp.SetEdgeStyle(Color.Wheat,LineStyle.Solid,1.2);
sp.SetColors(Color.Firebrick);
sp.DrawPieChart(new int[] {34,23});

Step 6: Graded Background and a Text Note

This illustrates another of the built-in gradient fills, this time shading towards white from the bottom-right corner.

It also adds a text note – you can write as many notes as you like, using either chart co-ordinates (as here) or absolute positioning.

sp.NoteStyle = NoteStyles.Boxed|NoteStyles.Rounded;
sp.SetNoteBackground(Color.Goldenrod);
sp.SetNoteFont(Color.White);
sp.DrawNote("Note: April figures were affected by warehouse fire",3.5,20,0,1.6);

The note is boxed, and you can set the fill-style and color of the background. In this case the font is left to its default (Arial) but changed to white. The text will wrap into a box 1.6 X-axis units wide starting at x-value 3.5 and y-value 20.

Summary

This tutorial illustrates many of the basic techniques for producing effective business graphics with SharpPlot. The next tutorial shows how you can associate hyperlinks and JavaScript handlers with your series to make the graphs part of a real user-interface on the web.


SharpPlot 2.51 User Manual: Working with Multiple Series

Working with Multiple Series

There are many strategies for showing multiple data series in the same charting space. This tutorial explores the ways SharpPlot allows you to approach the issue of arranging several series on the same page.

Re-using both X and Y axes

Once you have established the axes with your first plot, you can call any of the compatible DrawXx methods to overlay more series on the same scale. Clearly you can only reuse 2D scales with a 2D chart (for example a barchart, then a linegraph) or 3D axes with another 3D chart (for example a cloudchart and a fitted response surface). This example shows how to plot a fitted curve over a simple barchart.

sp.Reset();
sp.FrameStyle = FrameStyles.Boxed;
sp.SetMargins(60,48,36,18);
sp.Heading = "Fit of Logistic Curve\nto Checkweigh Data";
sp.HeadingStyle = HeadingStyles.Right;

sp.SetMarkers(Marker.Bullet);
sp.SetFillStyles(FillStyle.Saturate80);
sp.BarEdgeNib = 0;

sp.SetXLabels(new int[] {220,221,222,223,224,225,226,227,228,229,230,231,232});
sp.SetKeyText(new string[]{"Experimental Data","Logistic Fit"});
sp.XCaption = "Weight of Test Pack\n(grams)";
sp.YCaption = "No of rejects (out of 50)";

sp.DrawBarChart(rejects);

sp.SetPenWidths(1);
sp.LineGraphStyle = (LineGraphStyles.Curves|LineGraphStyles.Markers);

sp.DrawLineGraph(logfit);

sp.NoteStyle = 0;
sp.SetNoteFont("Arial",10,Color.Green);
sp.DrawNote("Deduced Set weight = 224.48g\nUncertainty = 1.31g",8,40);

The one thing to note here is that the BarChart must go first. It always creates an X-axis running upwards from 0.5 with bars positioned at 1,2, ... n and cannot reuse an existing X-scale. If you really need to add bars to an existing chart, you must use the XBar plot which has a ‘real’ X-Axis.

Using more than one (rescaled) YAxis

It is a very common requirement to show two related timeseries against different Y-scales, and SharpPlot gives you a very simple way to do this. The first series you plot will create the left-hand Y-axis in the usual way, then you call NewYAxis() to perform a partial reset – it leaves the XAxis in place and re-ranges the Y-axis to fit the second series.

sp.Reset();
sp.FrameStyle = FrameStyles.Boxed;
sp.SetMargins(60,48,36,36);
sp.Heading = "Weekly Bun Sales and\nMean Daily Temperature";

sp.SetPenWidths(0.6);
sp.SetLineStyles(new LineStyle[]{LineStyle.Solid,LineStyle.Dash});
sp.MissingValue = 0;

sp.SetKeyText(new string[]{"Bun Sales","Mean Temperature"});
sp.XAxisStyle = XAxisStyles.Date;
sp.XDateFormat = "dd-MMM";
sp.SetXTickMarks(7);
sp.YCaption = "Sales (arbitrary units)";

sp.DrawLineGraph(buns,date);

sp.NewYAxis();

sp.YCaption = "Temperature (deg C)";
sp.SetYTickMarks(5,4);

sp.DrawLineGraph(temp,date);

The data shows sales of hamburger buns on the left scale and the daily mean temperature on the right. If you want the tick-mark positions to line up (so you can have one set of horizontal gridlines) you will have to work out a good pair of ranges for yourself and set the ranges on both Y-axes explicitly.

Drawing several charts on the same page

SharpPlot defaults to using the entire available paper-size (less a 4-point gutter) for each chart that you draw. You can over-ride this by asking for a new Frame which restricts the plot to a rectangular space within the paper and triggers a complete reset of all properties. It is likely that the charts will share a common heading, and a common key, as shown in this example.

sp.Reset();
sp.FrameStyle = (FrameStyles.Boxed|FrameStyles.Filled);
sp.SetFrameBackground(Color.Green,FillStyle.Saturate20,1.2);
sp.SetMargins(42,48,16,18);
sp.Heading = "Weekly Bun Sales\nand Mean Daily\nTemperatures";
sp.HeadingStyle = HeadingStyles.Left;
sp.DrawFrame();

sp.NewFrame(4,200,256,196);  // Bounds of first chart

sp.FrameStyle = (FrameStyles.Boxed|FrameStyles.Filled);
sp.SetMargins(28,18,26,8);
sp.Heading = "Sales of Hamburger Buns";
sp.HeadingStyle = HeadingStyles.Left;
sp.SetPenWidths(1);
sp.SetColors(ColorTranslator.FromHtml("#2E319E"));
sp.MissingValue = 0;
sp.XAxisStyle = XAxisStyles.Date;
sp.YAxisStyle = YAxisStyles.GridLines;
sp.XDateFormat = "dd-MMM";
sp.SetXTickMarks(7);

sp.DrawLineGraph(buns,date);

sp.NewFrame(180,320,248,180);  // Bounds of second chart

sp.FrameStyle = (FrameStyles.Boxed|FrameStyles.Filled);
sp.SetMargins(28,18,26,8);
sp.Heading = "Mean Daily Temperatures";
sp.HeadingStyle = HeadingStyles.Left;
sp.SetHeadingNudge(8,0);
sp.SetColors(ColorTranslator.FromHtml("#CB2C27"));
sp.SetPenWidths(1);
sp.XAxisStyle = XAxisStyles.Date;
sp.YAxisStyle = YAxisStyles.GridLines;
sp.XDateFormat = "dd-MMM";
sp.SetXTickMarks(7);
sp.DrawLineGraph(temp,date);

// Share common key so reset to entire paper size
sp.NewFrame(432,324);
sp.SetKeyText(new string[]{"Bun Sales","Mean Temperature"});
sp.KeyStyle = (KeyStyles.Vertical|KeyStyles.Boxed);

sp.DrawKey(66,32);  // Notional co-ordinates (100,100) within margins

This can get quite tedious if there are several charts on the paper, but it does give you total control over the positioning. Obviously you need to be careful if you allow parts of one plot to obscure another, as here.

Making life easier with a trellis

The process of segmenting the paper can be automated, if what you want is a collection of charts arranged in a regular pattern. You can choose whether you want a full reset each time you move to a new cell, as often is is more convenient if most of the settings persist across all the charts. Here is an example which might be appropriate in a report on a portfolio of share prices.

sp.Reset(432,500);  // Paper size
sp.NewFrame(400,500);  // Chart area
sp.FrameStyle = FrameStyles.Boxed;

sp.Heading = "Popular UK Shares 2003 – 8";
sp.HeadingStyle = HeadingStyles.Left;
sp.SetHeadingFont("Arial",14,FontStyle.Bold,Color.Navy);
sp.DrawFrame();

sp.NewFrame(0,470,400,450);  // For all 3 charts

sp.SetTrellis(3,1);  // Three down, one across

sp.NewCell();        // Move to first cell and set all properties
sp.Heading = "Halifax Bank of Scotland";
sp.SetHeadingFont("Arial",10,FontStyle.Bold,Color.Navy);
sp.HeadingStyle = HeadingStyles.Left;
sp.SetHeadingNudge(10,-8);
sp.SetMargins(10,0,36,36);
sp.MissingValue = 0;
sp.XAxisStyle = (XAxisStyles.Clipped|XAxisStyles.AnnualTicks|XAxisStyles.PlainAxis);
sp.SetLabelFont("Times New Roman",6,Color.Black);
sp.YIntercept = 700;
sp.YAxisStyle = (YAxisStyles.Clipped|YAxisStyles.DuplicateAxes);
sp.YTickStyle = YTickStyles.InsideTicks;
sp.DrawLineGraph(HBOS,ShareDates);

sp.NewCell();       // Second cell reuses most properties
sp.Heading = "British Petroleum";
sp.YIntercept = 400;
sp.DrawLineGraph(BP,ShareDates);

sp.NewCell();      // Third cell similarly
sp.Heading = "Kelda (company sold late 2007)";
sp.XAxisStyle = (XAxisStyles.Clipped|XAxisStyles.MiddleLabels|XAxisStyles.AnnualTicks);
sp.YIntercept = 300;
sp.DrawLineGraph(Kelda,ShareDates);

Note how you only need to change the properties which are specific to each chart. If all the charts are identical (just iterating around a dimension in the data) you may be able to automate the process completely by using sp.DrawMultiple to iterate around the cells for you.

Driving the trellis with a scatterplot

For geographical data, you often need to place the individual plots at the correct location on a map. A nice example occured in the Proceedings of the Yorkshire Geological Society a few years ago showing the orientation of corals at various quarries in northern England.

sp.Reset(460,390);  // Paper size
sp.SetMargins(56,34,30,30);
sp.Heading = "Current Direction in the Great Limestone\nin Weardale and Teesdale";
sp.SetHeadingFont("Times New Roman",18,FontStyle.Italic,Color.Navy);
sp.Footnote = "PYGS 52.4 Nov99 page 358 (R.A. Fairbairn)";
sp.SetFootnoteFont("Arial",8,FontStyle.Italic,Color.Green);
sp.FootnoteStyle = FootnoteStyles.Right;

sp.SetMarkers(Marker.Bullet);
sp.ScatterPlotStyle = (ScatterPlotStyles.ValueTags|ScatterPlotStyles.GridLines);
sp.SetChartBackground(Color.Green,FillStyle.Saturate20,0);
sp.SetGridLineStyle(Color.Silver,LineStyle.Solid,0.7);
sp.SetValueTags(new string[]{"Wearhead","Stanhope","Middleton in Teesdale"});
sp.ValueTagStyle = ValueTagStyles.Left;
sp.SetAxisStyle(Color.Black,LineStyle.Solid,1);
sp.SetXRange(70,110);
sp.SetXTickMarks(10);
sp.SetXLabels(new string[]{"70","80","90","00","10"});
sp.SetYRange(20,50);
sp.SetYTickMarks(10);
sp.SetYLabels(new string[]{"20","30","40","50"});

sp.DrawScatterPlot(new int[]{39,39,25},new int[]{86,100,95});  // Towns

sp.ScatterPlotStyle = (ScatterPlotStyles.CellsCreated|ScatterPlotStyles.NoMarkers);
sp.SetCellSize(64);
sp.DrawScatterPlot(new int[]{43,47,42,44,43,37,35,36,28,31,31},     // Quarry Eastings
                   new int[]{79,84,88,95,100,103,98,93,94,89,83});  // Northings

// Create the legend by hand!
sp.SetKeyText(new string[]{"Corals","Latiproductus"});
sp.KeyStyle = (KeyStyles.Vertical|KeyStyles.Boxed);
sp.SetKeyBackground(Color.White,FillStyle.Solid,1.1);
kd1 = new KeyDefinition(2,Color.Maroon);
kd2 = new KeyDefinition(2,Color.Green);
sp.DrawKey(72,25,new KeyDefinition[]{kd1,kd2});

// First quarry sets all the properties
sp.ResetProperties();

sp.NewCell();
sp.SetColors(Color.Maroon);
sp.Gutter = 0;
sp.SetMargins(10);
sp.SetChartBackground(Color.White,FillStyle.Solid,0);
sp.Heading = "Killhope";
sp.PolarChartStyle = (PolarChartStyles.SurfaceShading|PolarChartStyles.GridLines);
sp.SetYRange(0,30);
sp.LabelStyle = LabelStyles.Opaque;
sp.DrawPolarChart(new int[] {10,10,20,20,20,15,10,10,20,20,20,15});

sp.NewCell();
sp.Heading = "Thorn Green";
sp.DrawPolarChart(new int[] {10,5,10,25,10,30,10,5,10,25,10,30});

sp.NewCell();
sp.Heading = "Greenfield";
sp.DrawPolarChart(new int[] {10,15,15,25,15,25,10,15,15,25,15,25,10});

sp.NewCell();
sp.Heading = "Chester Garth";
sp.DrawPolarChart(new int[] {15,10,0,15,15,15,35,15,10,0,15,15,15,35});

sp.NewCell();
sp.SetColors(Color.Green);
sp.Heading = "Stanhope Burn";
sp.DrawPolarChart(new int[] {25,10,10,10,10,5,0,0,0,0,0,20});

sp.NewCell();
sp.SetColors(Color.Maroon);
sp.Heading = "Wise Eels Bridge";
sp.DrawPolarChart(new int[] {15,25,25,15,10,10,15,25,25,15,10,10});

sp.NewCell();
sp.SetColors(Color.Green);
sp.Heading = "Harnisha Gill";
sp.DrawPolarChart(new int[] {10,0,5,20,0,0,0,0,0,5,10,35});

sp.NewCell();
sp.Heading = "Scutter Hill";
sp.DrawPolarChart(new int[] {35,10,0,0,0,20,10,0,0,0,0,10});

sp.NewCell();
sp.SetColors(Color.Maroon);
sp.Heading = "Newbiggin";
sp.DrawPolarChart(new int[] {10,10,10,10,20,25,10,10,10,10,20,25});

sp.NewCell();
sp.SetColors(Color.Green);
sp.Heading = "East Binks Edge";
sp.DrawPolarChart(new int[] {20,5,5,5,10,10,5,10,5,10,5,20});

sp.NewCell();
sp.SetColors(Color.Maroon);
sp.Heading = "High Hurth Edge";
sp.DrawPolarChart(new int[] {20,0,0,0,0,0,0,0,20,10,30,30});

The initial scatterplot of the quarries is drawn with no lines or markers, and simply leaves behind it a collection of frames which can be used by each polar plot in turn. Note that the paper is carefully sized to make the (x,y) squares exactly square here.

See also ...

Multiples for small thumbnails | NewYAxis Method | SetTrellis Method


SharpPlot 2.51 User Manual: Grouping and Splitting Database Data

Grouping and Splitting Database Data

Many aggregations can be done very easily in SQL, and SharpPlot simply used to plot the group totals. The methods explored in this tutorial show you how to make more complex summaries and cross-tabs directly from the raw data series.

Grouped Barchart of Quarterly Sales

This example makes use of the DbUtil class to extract entire columns from a sample dataset (supplied as XML) and make a simple summary using grouping and splitting. Here is the finished chart and the complete source code to generate it:

// Simple example to show how we make a chart from a dataset
// Uses sample Sales.xml shipped with SharpPlot and the DbUtil class

using System;
using System.Data;
using Causeway;

class charttest
{
  static void Main()
  {
    SharpPlot sp = new SharpPlot();
    DataSet ds = new DataSet();

   // Initialise the dataset from the XML (schema is included)
    ds.ReadXml("Sales.xml");
    DataTable summary = ds.Tables[1];
    DataRow[] sel = summary.Select();  // All rows are fine here

    int[] col_sales = DbUtil.GetIntegers(sel,"Sales");
    string[] col_prodid = DbUtil.GetStrings(sel,"Product");
    string[] col_qtr = DbUtil.GetStrings(sel,"Quarter");

    sp.SplitBy(col_prodid); // One bar for each product
    sp.GroupBy(col_qtr);    // Accumulate quarters

    sp.BarChartStyle = BarChartStyles.ForceZero|BarChartStyles.StackedBars;
    sp.Heading = "Quarterly Sales Summary";
    sp.YCaption = "Tonnes";
    sp.YAxisStyle = YAxisStyles.AtEndCaption;

   // Use the product names for the keys (tables have the same ordering)
    sp.SetKeyText(DbUtil.GetStrings(ds.Tables[0].Select(),"Product Name"));

    sp.DrawBarChart(col_sales);

   // Save to SVG file
    sp.SaveSvg("dbdemo1.svg",SvgMode.FixedAspect);
  }
 }

Some things to note is the example:

  • The first step is to make a selection from the table – in this case we just take all the rows in primary key sequence.
  • Then we can pick out the required columns one by one – the data is returned as typed arrays
  • SharpPlot can use the Quarters to aggregate the sales values, and the Product Ids to split them
  • The Key text is set by default to the Ids used to split the data – here we override with the full product names.

With real data, you will probably have to take care to have the selections ordered correctly, but the basic principles should be very similar.

Plotting a Simple Timeseries (Share price data)

This example makes a comparative plot of two popular UK shares to get an idea which has performed better over the last three years. Note the formatting of the date column to obtain well-structured X-axis labelling.

The Date column should be retrieved as integers, which forces a conversion to OLEDate values


SharpPlot 2.51 User Manual: Adding Links & Handlers

Adding Links & Handlers

SharpPlot makes it particularly easy to add hyperlinks and other JavaScript handlers to your charts. This tutorial shows how you can associate links and some simple handlers with each sector of a piechart. Try clicking on the sectors of the piechart for a simple popup message.

Defining the data

segs = new int[] {67,34,12};
xlabs = new string[]{"Causeway","GraPL","SharpPlot"};
links = new string[]{"http://www.causeway.co.uk","http://www.grapl.net","http://www.sharpplot.com"};
js = new string[]{"alert('Causeway');","alert('GraPL');","alert('SharpPlot');"};
tips = new string[]{"Causeway hits","GraPL hits","SharpPlot hits"};

These are the items used to draw the pie and create the corresponding labels and links.

Step 1: a Plain Piechart

The first step is to set the chart heading, left-aligned this time. Then the pie can be drawn, using a matching font for the labels.

sp.SetMargins(24,0,0,0);
sp.Heading = "Website Visitors\nin 2004";
sp.SetHeadingFont("Arial",18,FontStyle.Bold,Color.Firebrick);
sp.HeadingStyle = HeadingStyles.Left;
sp.SetXLabels(xlabs);
sp.SetLabelFont("Arial",14,Color.Firebrick);
sp.DrawPieChart(segs);

Note that the margins have been adjusted here, as the pie only needs a little space at the top.

Step 2: Linking from the Sectors

Each sector of the chart now has a matching hyperlink from the data.

This example looks just like the previous chart, until you move the mouse over the pie sectors, when you will notice the ‘pointing hand’ cursor appears. In this case the chart has been rendered twice, firstly to create the <area> tags as an imagemap, and then as a 72dpi PNG file.

sp.AddHyperlinks(links);
sp.DrawPieChart(segs);

string map = sp.RenderImageMap(72);
Bitmap chart = sp.RenderBitmap(72));

When the two elements are combined in a webpage, the sectors become hyperlinks.

Step 3: Adding Hints and Scripting

This example shows how you can define an array of tips or actions, which exactly matches the elements in the data. SharpPlot also has overloads for the various ‘Add’ methods to let you target specific data items in this way.

This example has the same image, but with some simple changes to the map. Try clicking on the sectors, and notice that they all have pop-up tips as well as an Alert message.

// Each segment now has a tip and an action
sp.AddTips(tips);
sp.AddAttributes("onClick",js);
sp.DrawPieChart(segs);
map = sp.RenderImageMap(72);

This is probably all you need to enable quite a complex ‘drill-down’ application where the user can explore a large management report simply by clicking on the various graphical elements. However you are limited in what you can do with mapped images – clearly you cannot change the chart content ‘on the fly’ without reloading the entire image.

With VML or SVG, you have much more scope for adding handlers which actively modify the chart in the client browser. The next example simply illuminates the selected pie sector by highlighting the border.

Step 4: Modifying the Graphic Clientside (with VML)

Here is the same chart again, this time without the text.

Assuming you have the VML component of IE 5.5 or above installed, you will see a very similar piechart, but this time the edges change color as you move the mouse over the sectors!

sp.SetEdgeStyle(Color.Maroon,LineStyle.Solid,2);
sp.AddAttributes("onMouseOver","this.strokecolor='Lime'");
sp.AddAttributes("onMouseOut","this.strokecolor='Maroon'");
sp.DrawPieChart(segs);
string vmldemo = sp.RenderVml(false);

The sector edges start maroon this time, and are set to turn bright green when the mouse enters the sector. Obviously, you must set them back again when it leaves! You can change any attribute of the current object in this way (for example you could also increase the line-weight, or change the fill color) or you can change the attributes of a different object entirely. A typical chart might be a complex linegraph where the user can mouse-over the key to highlight a chosen line.

Similar techniques work with SVG charts, but the JavaScript must be modified to take account of the different property names and structure of the SVG document.

See also ...

SharpPlot Members | AddAttributes Method | AddHyperlinks Method | AddTips Method


SharpPlot 2.51 User Manual: Formatting text with simple HTML tags

Formatting text with simple HTML tags

SharpPlot allows a limited subset of HTML tags to be included in all text elements, typically headings or axis labels.

The tags which may be used in all output formats are:

<b> – to bold a section of text
<i> – to italicise a section of text
<u> – to underline a section of text
<sup> – to superscript a section of text
<sub> – to subscript a section of text
<code> – to set a section of text in Courier (fixed pitch)
<strike> – to strike through a section of text (not supported in XAML)

For example:

sp.Heading = "Data for Current Year<sup>1</sup> for <b>all</b> Products";

This will format the text in the main chart heading, which may refer to Note-1 elsewhere in the output.

Note that you can use these HTML tags in text formatting strings, for example:

    sp.LabelLineSpacing = 1.4;
    sp.XDateFormat = "MMM\nyyyy";
    sp.XLabelFormat = "X~~X<b>XXXX</b>";

This can be used with Spanned labelling to generate monthly labels (with the first letter of the month name) and a bolded year centred under the available months.

Charts saved as VML

In this one case, you can use any HTML tags in your text, as they are simply passed directly into the output. However please be aware that SharpPlot will not measure text correctly if you use the <font> tag to change the text size, and as a result captions and Y-Labels may not wrap correctly.

For output saved as VML, SVG PDF or XAML, you may include hyperlink references in the text. For PDF and the various raster formats, superscripts and subscripts will not be underlined even if an underlined font is used in the main text. This improves the appearance of footnote references.


SharpPlot 2.51 User Manual: Using Picture Formatters

Using Picture Formatters

You may apply a ‘picture’ format to numeric values, and also to text labels to enforce truncation or wrapping into a given width.

Formatting numeric values

Wherever you can use numeric value as labels (axes and data value tags) you may specify a suitable format string to have the numbers converted to appropriate text. Typical formats would be:

  • ‘##0.00’ allows space for 3 leading digits and always shows 2 decimal places
  • ‘#,###,##0’ inserts commas at the thousands and has no decimal places
  • ‘0000’ formats with leading zeros (always 4 digits)
  • ‘0.0E00’ uses scientific format, showing 2 significant figures
  • ‘##0%’ shows a trailing percent sign but does not scale the data (unlike the .Net ToString method)
  • ‘£##0.00’ floats a leading currency symbol
  • ‘---0.00’ floats a leading minus sign if the numbers are negative
  • ‘(#,##0.00’ shows negative values in parentheses
  • ‘Week #0’ shows ‘Week 1’ .... ‘Week 52’

Note that .Net always shows leading minus signs for negative numbers. If you really want absolute values shown, use a 2-part format such as ‘##0;##0’ to have the negative values formatted without the leading minus.

More formally ...

The characters ‘#’, ‘-’ and ‘0’ are used to place the digits. The total number of ‘-#0’ characters in front of the decimal point determines the largest number you can display. Larger numbers are shown as ‘****’ to indicate overflow. Leading ‘0’ characters are zero-filled; leading ‘#’ characters are suppressed if not used. Digits after the decimal point are always shown, so ‘#’ and ‘0’ are equivalent here. Negative numbers are given a leading ‘-’ only if you use ‘-’ rather than ‘#’ as the placeholder.

The common currency symbols ‘$£’ and Euro will float to the front of the result if used as the first character in the format.

The character ‘~’ suppresses the digit in that position, so a vector of years could be formatted as ‘~~00’ to suppress the century part of the 4-digit number.

If the picture begins with an opening parenthesis, negative numbers will be parenthesised, rather than being shown with leading -ve symbols.

If any of the tokens ‘E-0’ ‘E+0’ ‘E0’ occur in the formatter, scientific notation will be used. A ‘+’ in the exponent part will always be shown, but a minus will only be shown when necessary. Floating currency symbols and other leading and trailing characters may be used as normal, for example ‘-##0.00E+00kg’ is a valid formatter here.

All other characters are simply treated as insertions, with the exception of ‘,’ which is only inserted if there were enough digits in the number to require it. The trailing % does not automatically scale the data.

Note that you always use the ‘American’ convention here for the decimal and thousands separators. These will be converted to your local currency symbols by the formatting function before the finished text is written to the chart.

Formatting text labels

A limited subset of the picture formatting capability may be used with text items, such as value tags and axis labels.

  • ‘XXXXXXXX’ simply limits the length of each label to a string of this size in the current font. If any of the labels is longer, it is clipped to one character less than the allowed length and the last character is set to an ellipsis. For very short patterns (less than 3 characters) the output is simply clipped to the pattern length.
  • ‘XXXXX;’ will force the text of each label to wrap into the allowed width.

Any other characters are treated as insertions, so a format like ‘SKU:XX/XXXX’ could be used for product codes, or a format such as ‘XXXX-XX-XX’ would be appropriate for text dates in the form 20020612. You may use line-break character as an insertion within the string, for example ‘SKU:\nXXXXXX’ will make 2-line labels prefixed with ‘SKU:’.

See also ...

XLabelFormat Property | YLabelFormat Property


SharpPlot 2.51 User Manual: Using Date and Time Axes

Using Date and Time Axes

Timeseries data from Excel or from a database query is often held internally as floating-point numbers where the integer part represents the date (the number of days elapsed since 1900) and the decimal part the time of day. This scheme is accurate to around 2 sec with normal floating-point precision and is equivalent to the OLE date format.

For example day number 35414 is actually 15/12/96 (in DD/MM/YY format) so 35414.5 would be 15/12/96 12:00, as times run from midnight to 23:59 spanning the range 0-1. SharpPlot can accept ‘date’ and ‘time’ styles (or both together) on either the X or Y axes, and will format the labels accordingly. The dates are shown by default in the format of your current Windows ‘short date’ setting and the times are normally shown as ‘HH:MM’ on a 24-hour clock.

Value ... Style ... Shown as
35414.25 ... (default) ... 35400
35414.25 ... date ... 15/12/96
35414.25 ... time ... 06:00
35414.25 ... date,time ... 15/12/96 06:00

For more detailed control over the presentation of the date/time combination, you can use the XDateFormat and XTimeFormat properties, for example to label tickmarks ‘Jan-01’ ‘Feb-01’ .... ‘Dec 02’ (in your local language) a suitable format would be “MMM-yy”.

The X-axis will also accept integers in the range 19000000 to 20991231 and (if the x-style is one of ‘date/annual/monthly’) treat these as if they are OLE date values. This may be convenient if you have imported your dates from an old time-series database, as this was a very common format in many database designs.

The tick-mark interval for both X and Y axes is normally a simple integer value, but for axes which include the ‘time’ style it is interpreted as a number of hours, so to get ticks every 6 hours you should set ‘Xtick’ to 6 rather than 0.25 (which would be the normal interpretation of this setting). Default tickmarks normally look for intervals which divide into 10; for time-based axes the choice is made between values which divide into 12 which gives a much better selection of intervals.

Calendar styles

In addition to ‘date’ you can set the x-axis (only) to style ‘annual’ which will put tickmarks at the year boundaries (so the tick spacing will be very slightly irregular). In this case the tick interval gives the number of years, so to mark decades you could use:

SharpPlot.XAxisStyle = XAxisStyles.Annual;
SharpPlot.SetXTickMarks(10);

This style would very likely go along with ‘MiddleLabels’ to get the labels written between the tick marks. The style ‘Monthly’ works in a similar way – in this case the tickmark setting is the interval between months.

See also ...

XDateFormat Property | YDateFormat Property


SharpPlot 2.51 User Manual: The CMYK Color Model

The CMYK Color Model

On top of the standard ARGB color model (Alpha Red Green Blue – for monitor display), SharpPlot supports and the CMYK color model (Cyan Magenta Yellow Black – for ink mixing). CMYK colors are encoded are ARGB colors with an alpha channel (opacity) between 0 and 8. This is why, when using ARGB colors (which is standard .Net approach), you shouldn’t use opacity smaller than 9, otherwise the colors will appear “random”.

Background

Colors on devices that emit light (like computer monitors) traditionally use three light-sources in the Red, Green and Blue band of the spectrum to fool the eye into seeing any of the combinations of color these can produce. Hence the tendency of programmers to think that specifying ‘color’ simply requires giving 3 values to set the RGB of each composite pixel.

However, color printers require a very different perspective, as inks work by selectively removing color from the reflected light. Of course all printers will accept a specification in RGB terms, and internally convert it to (Cyan,Magenta,Yellow,Black) using a simple subtractive procedure. Typically they determine the amount of each of the first three inks by simple subtraction from the RGB values, then factor out as much Black as they can by finding the minimum value across the CMY vector, adding this as Black, then removing this from each of the CMY.

As you can quickly see, any grey (R=G=B in the intensity model) always maps to (0,0,0,k) when converted to ink. That is why the black cartridge always goes down fastest on your photo-printer! Even grey-ish colors use mostly black when converted to inks.

Because the conversion can never be better than a guess, if the intended output medium of a chart is paper (maybe previewed on screen) then to get the colors exactly right, it is best to use either EPS or PDF output from SharpPlot and set the colors of the inks directly. The values you give will be passed directly into the EPS or PDF drawing commands, and both these formats have the ability to control PostScript printers directly.

Previewing CMYK colors on screen

The reverse conversion from CMYK to RGB is very poorly defined – there are two reasonable approaches here. Firstly, we can essentially reverse the RGB mapping by subtracting CMY from 1.0, then subtracting the K component from each of them, being careful not to go less than zero. This is what SharpPlot does if you use the raster output, or save your chart in SVG, XAML and so on – formats which only support RGB. It also matches what GhostScript does with your EPS output (if you convert it to PNG) and what MS Word does when importing EPS files as pictures.

The alternative algorithm is to subtract the CMY values as above, then multiply what you get by (1-K). This avoids the problem of getting values below zero, but generates rather ‘muddier’ colors as a result. This approach is used by the common PDF viewers such as Acrobat Reader and Foxit to generate the preview.

Summary

Use CMYK colors when you need full control over the inks on your printer, but don’t get too hung up on what the preview looks like on screen! There is no one ‘correct approach’ to mapping from inks to pixels.

See also ...

UseCmyk


SharpPlot 2.51 User Manual: Using the gradient fills

Using the gradient fills

The way gradients (both linear and radial) are defined varies greatly between output formats, so SharpPlot defines a reasonable set of standard fillstyles for you, and where necessary (surface-filled linegraphs and piecharts) enforces a reasonable bounding rectangle on the fill definition.

All the fills start from the base colour of the data series, and the default is to grade towards the fillstyle ‘30% saturated’, in other words, to stir in approximately three parts white for every one part of the original color. A typical example is:

          fs = FillStyle.GradientTopLeft;
          sp.SetFillStyles(fs);

This grades from the default color for the first series (Color.Navy) to the same shade of blue with added white. An easy way to modify this fill is to specify an alternative target color in the FillStyle constructor. For example here is a similar chart but grading towards yellow:

          sp.SetFillStyles(new FillStyle(fs,Color.YellowGreen));

If you simply want to have more or less saturation (but maintaining the hue of the series color) you may also override the target FillStyle, for example:

          sp.SetFillStyles(new FillStyle(fs,FillStyle.Saturate10));

This gives a stronger gradient effect while preserving the overall color balance.

For barcharts, the bounding rectangle of the fill is simply each bar taken individually. However for filled LineGraphs, SharpPlot always uses the span of the axes to define the fill, to ensure compatible shading between series with different data ranges.

For piecharts, the only fill which makes much sense is FillStyle.Dome which is always defined on the entire pie, rather than sector by sector which looks very strange indeed. Note that this does not work in VML which has no mechanism for overriding the bounding rectangle of a custom fill!

See also ...

FillStyle Struct


SharpPlot 2.51 User Manual: The Barley Experiment

The Barley Experiment

Many of the examples in the manual use a dataset collected in the 1930s from an experiment to investigate barley yields. Ten varieties of seed were planted at 6 farms over 2 years and the yields from each plot measured to give 120 data points.

This data can be classified and tabulated in many interesting ways, and has been the subject of many papers in the statistical journals. If you want to try out some of the tutorial examples, you will need the numbers and categories, so here they are:

int[] barleyyear = new int[] {1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,
  1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,
  1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,
  1931,1931,1931,1931,1931,1931,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,
  1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,
  1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,
  1932,1932,1932,1932,1932,1932};

string[] barleyfarm = new string[] {"University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth",
  "University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris",
  "Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth",
  "University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris",
  "Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth",
  "University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris",
  "Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth",
  "University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris",
  "Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth",
  "University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris",
  "Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth",
  "University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris",
  "Crookston","Grand Rapids","Duluth","University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth",
  "University Farm","Waseca","Morris","Crookston","Grand Rapids","Duluth"};

string[] barleyvariety = new string[] {"Manchuria","Manchuria","Manchuria","Manchuria","Manchuria","Manchuria",
  "Glabron","Glabron","Glabron","Glabron","Glabron","Glabron","Svansota","Svansota","Svansota","Svansota","Svansota",
  "Svansota","Velvet","Velvet","Velvet","Velvet","Velvet","Velvet","Trebi","Trebi","Trebi","Trebi","Trebi","Trebi",
  "No. 457","No. 457","No. 457","No. 457","No. 457","No. 457","No. 462","No. 462","No. 462","No. 462","No. 462",
  "No. 462","Peatland","Peatland","Peatland","Peatland","Peatland","Peatland","No. 475","No. 475","No. 475","No. 475",
  "No. 475","No. 475","Wisconsin No. 38","Wisconsin No. 38","Wisconsin No. 38","Wisconsin No. 38","Wisconsin No. 38",
  "Wisconsin No. 38","Manchuria","Manchuria","Manchuria","Manchuria","Manchuria","Manchuria","Glabron","Glabron",
  "Glabron","Glabron","Glabron","Glabron","Svansota","Svansota","Svansota","Svansota","Svansota","Svansota","Velvet",
  "Velvet","Velvet","Velvet","Velvet","Velvet","Trebi","Trebi","Trebi","Trebi","Trebi","Trebi","No. 457","No. 457",
  "No. 457","No. 457","No. 457","No. 457","No. 462","No. 462","No. 462","No. 462","No. 462","No. 462","Peatland",
  "Peatland","Peatland","Peatland","Peatland","Peatland","No. 475","No. 475","No. 475","No. 475","No. 475","No. 475",
  "Wisconsin No. 38","Wisconsin No. 38","Wisconsin No. 38","Wisconsin No. 38","Wisconsin No. 38","Wisconsin No. 38"};

double[] yield = new double[] {27,48.87,27.43,39.93,32.97,28.97,43.07,55.2,28.77,38.13,29.13,29.67,35.13,47.33,
  25.77,40.47,29.67,25.7,39.9,50.23,26.13,41.33,23.03,26.3,36.57,63.83,43.77,46.93,29.77,33.93,43.27,58.1,28.7,45.67,
  32.17,33.6,36.6,65.77,30.37,48.57,24.93,28.1,32.77,48.57,29.87,41.6,34.7,32,24.67,46.77,22.6,44.1,19.7,33.07,39.3,
  58.8,29.47,49.87,34.47,31.6,26.9,33.47,34.37,32.97,22.13,22.57,36.8,37.73,35.13,26.17,14.43,25.87,27.43,38.5,35.03,
  20.63,16.63,22.23,26.8,37.4,38.83,32.07,32.23,22.47,29.07,49.23,46.63,41.83,20.63,30.6,26.43,42.2,43.53,34.33,19.47,
  22.7,25.57,44.7,47,30.53,19.9,22.5,28.07,36.03,43.2,25.23,26.77,31.37,30,41.27,44.23,32.13,15.23,27.37,38,58.17,
  47.17,35.9,20.67,29.33};

The yields have been rounded off to 2 decimal places to save on byte count, but otherwise the data is entirely as collected.


SharpPlot 2.51 User Manual: Sample Datasets supplied as XML

Sample Datasets supplied as XML

Several simple databases are included with the SharpPlot distribution to allow you to experiment with grouping and splitting data. The smallest of these is an invented Sales Information database with two products and some monthly figures:

Products Table
==============

 Column Name   Data Type      Allow Null  Unique
 -----------   ---------      ----------  ------
 Product Id    System.String           0       1
 Product Name  System.String           1       0

Sales Table
===========

 Column Name  Data Type        Allow Null  Unique
 -----------  ---------        ----------  ------
 Date         System.DateTime           0       0
 Year         System.Int32              1       0
 Month        System.String             1       0
 Quarter      System.String             1       0
 Product      System.String             0       0
 Sales        System.Int32              1       0

There are two products, and 30 entries in the sales information.

See also ...

Grouping and Splitting Database Data


SharpPlot 2.51 User Manual: Chart Tutorials

Chart Tutorials

Each of the following tutorials has a set of four examples showing how a particular chart type can be used.

Bar Charts for small series
The Barchart is probably the simplest and most commonly used graphic on the web. It is an ideal format for presenting summary data in multiple categories, and often works much better than a Piechart if the object is to allow the reader to compare values easily.
Box-and-Whisker Plots for multivariate data
A selection of simple Box-and-Whisker charts are developed here, all using a ‘classic’ dataset from the 1930s showing barley yields at various farms in Canada. The trials were made at 6 farms over 2 years, with 10 varieties of barley, giving 120 data-points in total. The entire dataset is shown for reference in the glossary.
Bubble Charts for discrete XYZ data
This tutorial builds four simple examples of bubble-charts, showing how the markers scale to represent an extra dimension in the data. Regression models may be used with the bubble-chart – naturally the area of the bubble weights the model-fit appropriately. User-defined markers can be used to good effect also, as the final example illustrates.
Cloud Charts for discrete XYZ data with perspective
The CloudChart or XYZ Scatter is a surprisingly versatile method for diagramming data in 3 dimensions. The four examples shown here illustrate a few of the possibilities.
Contour Plots for XYZ interpolation
Contour plots offer a 2-dimensional alternative to CloudCharts when it is necessary to visualize ‘height’ data in addition to x and y values. The data may be geographic (rainfall totals from a number of weather stations) or simply a model of 3 variables (house prices as a function of the age of the property and its floor area).
Dials and Gauges for isolated numbers
The Dial chart is the only charttype in SharpPlot which typically takes a single number, rather than an array. It is possible to use charts like the XBarchart to imitate thermometers and other simple gauges, but the Dial has the benefit of showing some of the context of the data with warning zones, datum lines and other cues.
Gantt Charts for timewise bars
The Gantt chart was originally developed as a good way to represent activities across time, and was popularised by tools such as Microsoft Project. It may be used in a variety of planning scenarios, or simply to show the status of some activity or piece of machinery across time (say machine performance across the day).
Histograms for distributions
All the examples which follow use the same set of values – the sum of three dice, thrown repeatedly. Clearly the range will vary from 3 to 18, with the more likely values falling in the middle.
Line Graphs and Time Series
Although it is called ‘Linegraph’ this SharpPlot method can do markers, risers from the X-axis, filled surfaces and so on, in any combination. Typically it is used for timeseries data, but of course it can also draw any continuous curve when given x as well as y co-ordinates.
Min-Max or Hi-Lo Charts
This chart is often used in combination with a LineGraph or ScatterPlot to show range in addition to daily values. The first example creates a typical ‘High-Low-Close’ chart from daily share price information, and the second shows how errorbars can be added to a scatterplot of experimental data. However, it can be used on its own, for example to show the span of frost-free days across the year as a timeseries.
Multiples for small thumbnails
One of the best innovations in Tufte’s “The Visual Display of Quantitative Information” is the idea of using an array of miniature charts to display multi-dimensional data. Often a series of values are recorded at (say) several sites or on several days, then are superimposed on a single chart as a collection of dotted and dashed lines in various colors. This often makes it very hard to see the patterns and relationships in the data.
Pie Charts and Rose Diagrams
Piecharts are best used with a small number of data items where the values represent some part of a total. Typically the numbers will be percentages, and the sector values will differ significantly. If it is important for the user to be able to compare values accurately, a simple Barchart is almost always a better choice.
Polar and Radar Charts
The ‘Radar’ chart is logically similar to a Barchart, in that the given data is arranged at equal intervals. The difference is that the Radar chart arranges the values around a circle at equal angles, which is often a good way of comparing several sets of performance indicators.
Response Surfaces
The response surface is generally used with computed data to show a mathematical function of two variables. It may be combined with other 3D charts (typically the cloud chart) to show a theoretical fit in addition to the raw data plotted in 3 dimensions.
Scatter Plots for discrete XY data
The scatterplot (or scatter diagram) is almost always the first step in analysing any collection of data. Typically you are trying ti isolate one or more causes, in the attempt to predict some effect. These examples all use some data on house-prices, with the idea of being able to predict the price of any house given its type and floor area.
Step Charts for discontinuous data
Step charts are used for two main chart-types. They are a very convenient way of plotting a timeseries where there may be an instantaneous change between values, which then stay fixed for some time – government interest-rates are typical. Filled stepcharts work well in combination with Barcharts, and they can also be used instead of the Histogram where data has been aggregated into categories of varying widths.
Tabulating data
SharpPlot can tabulate as well as chart, but please be aware that these tables are not designed to display large amounts of complex data. They are for summaries and simple CrossTabs where a limited amount of data can be used to augment a complex chart. The examples show a table used as a chart in its own right, and some simple summaries and groupings added as ‘notes’ to typical timeseries data.
Tower Charts for 3D bars
Towercharts are good for visual impact, but are rarely an effective way to present numbers where the values are important. These examples parallel some of the examples in the tutorial on tables, as a Towerchart is really just a simple way to present a two-way tabulation in visual form.
Trace Charts for multiple series
Trace charts (or ECG plots) are often a convenient way to add an extra dimension to a two-dimensional chart. They are similar in principle to the small multiple, but save a lot of redundant ink when all the series share the same X-axis. Trace-charts are also used as a simple way to draw Kite Diagrams, which are a common graphical tool for botanical field studies.
Triangle Plots for proportions
The Triangle chart is used to analyse data where there are three important constituents, summing to unity. It is common in Geology and Chemical Engineering where a set of 3 key ingredients determines the outcome from some process.
Vector Fields and Directed Graphs
This style of plot can be used in two very different ways, to show either directed graphs, or to plot vector fields as a scatter diagram. The examples illustrate both of these.
Venn Diagrams
Venn diagrams are used to summarise set membership information. SharpPlot will draw a proportional diagram for two sets (and one intersection) but for the three set case the chart is purely diagrammatic, as it is impossible to scale all the regions in the correct proportion. Diagrams for higher numbers of sets are not supported.
X Bar Charts for positioned bars
Barcharts are usually drawn with a ‘logical’ X-axis. However there are times when you want to represent discrete values which occur at particular times. the XBarchart allows you to place bars exactly where you want them, and also to override the normal width for each bar.


SharpPlot 2.51 User Manual: Bar Charts for small series

Bar Charts for small series

The Barchart is probably the simplest and most commonly used graphic on the web. It is an ideal format for presenting summary data in multiple categories, and often works much better than a Piechart if the object is to allow the reader to compare values easily.

This short tutorial show 4 variations on a basic barchart, illustrating many of the common properties and styles of labelling that are available.

Grouped data in a vertical chart

data = new int[][]{new int[]{6,18,27,31,40,43},new int[]{17,33,42,54,71,78}};

sp.Heading = "Comparative Spend 2004-5";
sp.BarChartStyle = BarChartStyles.TicksBetween|BarChartStyles.ValueTags|
         BarChartStyles.ForceZero;
sp.XAxisStyle = XAxisStyles.MiddleLabels|XAxisStyles.GridLines;

sp.ValueTagStyle = ValueTagStyles.Vertical|ValueTagStyles.Inside|
         ValueTagStyles.SectorValues|ValueTagStyles.RecolorOutside;
sp.SetValueFont("Arial",10,FontStyle.Bold,Color.LightYellow);
sp.ValueTagFormat = "###0 Units";

sp.Gap = 0;
sp.GroupGap = 0.5;
sp.SetColors(new Color[]{Color.Green,Color.Maroon});

sp.XLabelFormat = "Proj-XX";
sp.SetXLabels(new string[]{"A2","18","Q5","T6","T8","32"});
sp.SetKeyText(new string[]{"Last Year","This Year"});

sp.DrawBarChart(data);

This simple barchart illustrates several SharpPlot features which are designed to make the programmer’s life easy. Notice how the value-tags hop on top of the bars when they run out of space. In this case the ‘Recolor’ style has been used to have them take on the color of the bar (rather than white) when this happens.

The gap between bars (within each group) has been closed up completely, and the gap between groups reduced to half the width of one bar. By setting both gaps ‘relative to bar’ in this way, SharpPlot will adapt automatically to new data series with more or fewer bars.

Notice how the XLabelFormat has been used to expand slightly on the project identifiers used as labels.

Stacked bars, drawn horizontally

data = new int[][]{new int[]{21,18,27,31,40,43,56},new int[]{12,33,42,54,71,78,88}};

sp.Heading = "Cumulative Resource Usage";
sp.BarChartStyle = BarChartStyles.TicksBetween|BarChartStyles.ValueTags|
         BarChartStyles.ForceZero|BarChartStyles.Horizontal|
         BarChartStyles.StackedBars;
sp.YAxisStyle = YAxisStyles.MiddleLabels|YAxisStyles.GridLines|YAxisStyles.CenteredCaption;
sp.ValueTagStyle = ValueTagStyles.Middle|ValueTagStyles.SectorValues;
sp.SetValueFont("Arial",8,FontStyle.Bold,Color.DarkSlateBlue);
sp.ValueTagFormat = "###0\nUnits";

sp.Gap = 0;
sp.MarginLeft = 48;

sp.SetColors(new Color[]{Color.Green,Color.Red});
sp.SetFillStyles(FillStyle.Halftone);

sp.YLabelFormat = "Project\n#0000";  // Allows newlines here
sp.SetYLabels(new int[] {12,18,5,67,8,32});
sp.SetKeyText(new string[]{"Last Year","This Year"});

sp.DrawBarChart(data);

Bars, colored by category

This is a very typical political graphic, where a small amount of data must be clearly presented with consistent coloring.

Party = new string[]{"Con","Lib","Lab"};
Vote2001 = new int[] {20711,15836,6470};

sp.SetMargins(42,48,36,18);
sp.Heading = "How Ryedale voted\nin 2001!";
sp.HeadingStyle = HeadingStyles.Right;

sp.SetHeadingFont("ARB",16,Color.Navy);
sp.SetValueFont("ARB",12,Color.Navy);
sp.SetLabelFont("ARB",12,Color.Black);

sp.SetColors(new Color[] {Color.Navy,ColorTranslator.FromHtml("#FAB32E"),
         ColorTranslator.FromHtml("#D3342C")});
sp.SetXLabels(Party);

sp.DataStyle = DataStyles.Rows;  // One series per value is required
sp.BarChartStyle = BarChartStyles.ValueTags;
sp.KeyStyle = KeyStyles.NoKey;

sp.ValueTagFormat = "Votes:\n##,###";
sp.YAxisStyle = YAxisStyles.NoAxis|YAxisStyles.ForceZero;
sp.DrawBarChart(Vote2001);

Horizontal, with ticks gridlines between bars

This chart of oil reserves is again designed for easy reading, and uses the horizontal style to allow space for the labels.

sp.SetBackground(Color.White,FillStyle.Solid);

country = new string[]{"Syria","Qatar","Oman","Kuwait","Iraq","UAE","Iran","Saudi Arabia"};
barrels = new int[] {560,715,910,2025,2505,2580,2550,8595};

sp.SetMargins(36,24,72,16);
sp.SetColors(Color.Firebrick);
sp.SetFillStyles(FillStyle.GradientLeft);

sp.BarChartStyle = BarChartStyles.Horizontal|BarChartStyles.ValueTags|
         BarChartStyles.TicksBetween;
sp.XAxisStyle = XAxisStyles.ForceZero|XAxisStyles.NoAxis;
sp.YAxisStyle = YAxisStyles.GridLines|YAxisStyles.MiddleLabels|YAxisStyles.InvisibleAxis;
sp.YTickStyle = YTickStyles.NoTicks;

sp.Gap = 0.3;

sp.SetLabelFont("Arial",10,Color.Black);

sp.SetValueFont("Arial",10,FontStyle.Bold,Color.Black);
sp.ValueTagFormat = "#,##0";
sp.ValueTagStyle = ValueTagStyles.Inside;

sp.Heading = "Middle East Oil Production";
sp.SetHeadingFont("ARB",14,Color.Black);
sp.HeadingStyle = HeadingStyles.Left;

sp.Subheading = "Production,1000s of Barrels/day";
sp.SetSubheadingFont("Arial",10,Color.Black);

sp.Footnote = "Source BP(1999 figures)";
sp.FootnoteStyle = FootnoteStyles.Right|FootnoteStyles.RuledAbove;
sp.SetFootnoteFont("Arial",8,Color.Black);

sp.SetYLabels(country);
sp.DrawBarChart(barrels);

See also ...

DrawBarChart Method


SharpPlot 2.51 User Manual: Box-and-Whisker Plots for multivariate data

Box-and-Whisker Plots for multivariate data

A selection of simple Box-and-Whisker charts are developed here, all using a ‘classic’ dataset from the 1930s showing barley yields at various farms in Canada. The trials were made at 6 farms over 2 years, with 10 varieties of barley, giving 120 data-points in total. The entire dataset is shown for reference in the glossary.

The object of the trial was to see what the significant effects were, and the boxplot is an ideal way to explore relationships between variables. You might also check on the histograms of various subsets of the data, maybe using a Multiple chart to split the data by various criteria.

Spread of a single series

This chart simple takes the entire yield vector, and determines the ‘shape’ of the distribution.

years = (int[])_barleyyear.Clone();
yield = (double[])_barleydata.Clone();
farm = (string[])_barleyfarm.Clone();

sp.Heading = "Barley Yield (uncategorised)";
sp.SetColors(Color.Orange);
sp.XAxisStyle = XAxisStyles.ForceZero;
sp.YAxisStyle = YAxisStyles.NoAxis;
sp.BoxPlotStyle = BoxPlotStyles.Horizontal;
sp.DrawBoxPlot(yield);

The chart shows the Median yield is about 32kg per acre, with 75% of the values falling in the range 26-42. There are outliers on both sides, and the shape of the data looks a little skewed. SharpPlot has been told not to draw a Y-Axis here, as the vertical dimension is meaningless.

Two categories, to compare distributions

The first obvious question to ask would be “were the years comparable?”. This is easily answered by splitting the dataset by year and repeating the chart.

sp.Heading = "Yields Compared by Year";
sp.SetColors(Color.Orange);
sp.YAxisStyle = YAxisStyles.ForceZero;
sp.BoxPlotStyle = BoxPlotStyles.DecileWhiskers;
sp.DrawBoxPlot(yield,years);

Note that the BoxPlot call now has 2 arguments, the first is the data, and the second the categorisation. This example is drawn with ‘Deciles’ shown in the whiskers, which indicate that the lower end of the range has a few outlying values. However it is fairly clear that there was not a big difference between the years.

Several categories, drawn horizontally

So maybe the farm was an important factor? Let’s try passing the farm name as the category, using a horizontal plot to leave plenty of room for the long names.

sp.SetBackground(Color.White,FillStyle.Solid);

sp.MarginLeft = 72;
sp.Heading = "Yields by Farm";
sp.SetColors(Color.Orange);
sp.XAxisStyle = XAxisStyles.ForceZero;
sp.BoxPlotStyle = BoxPlotStyles.Horizontal;
sp.DrawBoxPlot(yield,farm);

That looks clear enough! The best yield at Duluth is barely up to the poorest result at Waseca. Some farms are also much more variable, so maybe we should look at combinations of variables as well as a single factor.

Vertical, using a 2-way split

This chart takes another approach to the names, setting up a format string to force them to wrap nicely between the tickmarks. Two categories are given – the first spreads the data across the X-axis as before and the second (or inner category) adds an extra level of fine structure which is annotated automatically in the chart legend.

sp.Heading = "Yield Split by Farm and by Year";
sp.SetColors(new Color[]{Color.Orange,Color.GreenYellow});
sp.YAxisStyle = YAxisStyles.ForceZero;
sp.XAxisStyle = XAxisStyles.MiddleLabels|XAxisStyles.GridLines;
sp.BoxPlotStyle = BoxPlotStyles.TicksBetween;
sp.XLabelFormat = "XXXXXX;";
sp.DrawBoxPlot(yield,farm,years);

Interestingly, there were very big variations by year but they were very different at the different farms, so the simplistic split by year completely masked the effect. This style of chart makes the effect very clear indeed.

Summary

Boxplots are an excellent tool for exploring a complex dataset with many factors contributing to a single outcome. SharpPlot makes it easy to slice the data any way you like to bring the important variables to the fore.

See also ...

DrawBoxPlot Method


SharpPlot 2.51 User Manual: Bubble Charts for discrete XYZ data

Bubble Charts for discrete XYZ data

This tutorial builds four simple examples of bubble-charts, showing how the markers scale to represent an extra dimension in the data. Regression models may be used with the bubble-chart – naturally the area of the bubble weights the model-fit appropriately. User-defined markers can be used to good effect also, as the final example illustrates.

A Simple Weighted Scatter

This is the most obvious use of the bubblechart. Three vectors of data are provided, giving the x,y co-ordinates of each value and a count of the number of items at that point.

ydata = new int[] {190,270,310,120,190,230};
xdata = new int[] {17,31,29,14,16,24};
count = new int[] {12,65,77,7,9,112};

sp.Heading = "Incident count";

sp.SetXTickMarks(5);
sp.SetYTickMarks(50);

sp.SetMarkers(Marker.Bullet);
sp.SetMarkerScales(5);
sp.BubbleChartStyle = BubbleChartStyles.GridLines|BubbleChartStyles.ValueTags;
sp.SetValueTags(count);
sp.SetValueFont("Arial",10);
sp.DrawBubbleChart(ydata,xdata,count);
sp.SetKeyText("Number of Incidents");

Note that this chart adds Value tags to the markers to give an exact value for the count at that point.

Two categories, to compare series

This chart shows data collected from two similar experiments, and allows a quick comparison of the success of each (maybe the number of seeds which germinated under gven lighting and temperature).

ydata = new int[] {190,270,310,120,190,230,200,240,311,110};
xdata = new int[] {17,31,29,14,16,24,19,24,30,12};
count = new int[] {12,65,77,7,9,112,18,194,90,17};
type = new int[] {1,1,1,1,1,1,2,2,2,2};

sp.Heading = "Two Experiments Compared";

sp.SetMarkers(Marker.Bullet);
sp.SetMarkerScales(5);
sp.SetColors(new Color[] {Color.Orange,ColorTranslator.FromHtml("#80006666")});

sp.BubbleChartStyle = BubbleChartStyles.GridLines|BubbleChartStyles.ExplodeAxes;
sp.SetKeyText(new string[]{"Old method","New method"});
sp.SplitBy(type);
sp.DrawBubbleChart(ydata,xdata,count);

Note that the axes are ‘exploded’ here to keep them out of the way of the data. Note also the use of semi-transparent markers to avoid the second series obscuring results from the first.

Weighted modelfit

This example illustrates the way the regression line is weighted by the count at each data-point.

ydata = new int[] {190,270,310,120,190,230};
xdata = new int[] {17,31,29,14,16,24};
count = new int[] {12,15,77,97,9,112};

sp.Heading = "Weighted Regression";

sp.SetYTickMarks(50);

sp.SetMarkers(Marker.Lozenge);
sp.SetMarkerScales(5);
sp.BubbleChartStyle = BubbleChartStyles.GridLines|BubbleChartStyles.ModelFit|
         BubbleChartStyles.HaloMarkers;

sp.DrawBubbleChart(ydata,xdata,count);
sp.SetKeyText(new string[]{"Incident count","Weighted model"});

You can see that the fitted line is strongly biased towards the points with more data.

User-defined Markers showing categories

This example exploits two standard WingDings characters to show the number of contacts by phone and mail.

ydata = new int[] {190,270,310,120,190,230,200,240,311,110};
xdata = new int[] {17,31,29,14,16,23,19,24,30,12};
count = new int[] {12,65,77,7,9,112,18,194,90,17};
type = new int[] {1,1,1,1,1,1,2,2,2,2};

sp.Heading = "User-defined Markers";

sp.SetColors(new Color[]{Color.Orange,Color.Purple});

// Telephone and Letter symbols
sp.SetMarkers(new Marker[]{(new Marker("wingdings,9,)")),new Marker("wingdings,9,+")});
sp.SetMarkerScales(5);
sp.BubbleChartStyle = BubbleChartStyles.GridLines|BubbleChartStyles.ExplodeAxes;

sp.SplitBy(type);
sp.DrawBubbleChart(ydata,xdata,count);
sp.SetKeyText(new string[]{"Contacts by Phone","Contacts by Letter"});

Note that there is no need to have the markers drawn semi-transparently here as they are only drawn in outline. Several other characters in the WingDings font are extremely useful for categorised data, for example the circled numbers may be used to represent up to 20 categories very effectively.

Summary

The Bubblechart is an effective way of combining dimensions where you need to show how many events occurred at a particular combination of X and Y values (such as the number of artifacts found in each grid square on a field survey). Transparency can be used effectively where there are many overlapping bubbles.

See also ...

DrawBubbleChart Method


SharpPlot 2.51 User Manual: Cloud Charts for discrete XYZ data with perspective

Cloud Charts for discrete XYZ data with perspective

The CloudChart or XYZ Scatter is a surprisingly versatile method for diagramming data in 3 dimensions. The four examples shown here illustrate a few of the possibilities.

A Simple Scatter plot in XYZ space

sp.SetMargins(24,32,18,6);
sp.Heading = "XYZ Scatter";
sp.HeadingStyle = HeadingStyles.Right;

zdata = new int[] {12,65,77,117,9,112};
xdata = new int[] {17,31,29,21,30,21};
ydata = new int[] {190,270,310,300,190,230};

sp.CloudChartStyle = CloudChartStyles.WallShading|CloudChartStyles.Risers|
         CloudChartStyles.HaloMarkers;
sp.ZAxisStyle = ZAxisStyles.ForceZero;
sp.XAxisStyle = XAxisStyles.GridLines;
sp.YAxisStyle = YAxisStyles.GridLines|YAxisStyles.FlatText;
sp.SetZTickMarks(50);
sp.SetYTickMarks(20);
sp.SetMarkerScales(2);
sp.SetMarkers(Marker.Ball);

sp.DrawCloudChart(xdata,ydata,zdata);

This style of chart would often be used with a large dataset (several thousand points) to get a feel for the general shape of a distribution. In this example ‘risers’ have been drawn from the xy plane to give a better idea of where the points are placed.

Shaded planes to compare several series

sp.SetMargins(24,24,18,6);

series1 = new int[] {5,6,7,4,3,6,5,4};
series2 = new int[] {4,5,4,7,4,5,5,3};
xdata = new int[] {4,5,7,8,9,11,12,15};

sp.Heading = "Shaded\nPlanes";
sp.HeadingStyle = HeadingStyles.Right;

sp.SetViewpoint(33,18,54);
sp.SetColors(new Color[]{Color.OrangeRed,Color.ForestGreen});
sp.SetFillStyles(FillStyle.Opacity66);
sp.SetLineStyles(LineStyle.Solid);
sp.CloudChartStyle = CloudChartStyles.NoMarkers|CloudChartStyles.SurfaceShading|
         CloudChartStyles.Lines|CloudChartStyles.GridLines;
sp.SetYRange(0.5,2.5);
sp.YAxisStyle = YAxisStyles.PlainAxis;
sp.ZAxisStyle = ZAxisStyles.ForceZero;

sp.DrawCloudChart(xdata,new int[]{2,2,2,2,2,2,2,2},series2);  // First plane
sp.DrawCloudChart(xdata,new int[]{1,1,1,1,1,1,1,1},series1);

This diagram shows the cloud-chart being used in a similar way to the Excel Ribbon chart to compare series. This is generally done for visual effect rather than as a serious attempt to compare the data values. However it does illustrate the versatility of the Cloudchart when used as a general-purpose 3D drawing tool. If you start by setting fixed ranges on all 3 axes, you can draw any number of lines of filled shapes in the rctangular co-ordinate system within the chart walls.

This chart is also drawn with a slightly modified viewpoint. The best viewing angle for any particular dataset is obviously a matter of experiment.

Fitted quadratic surface

Just as the ScatterPlot can fit a regression-line to the data, the Cloudchart can fit a regression surface.

sp.SetMargins(24,32,18,6);

sp.Heading = "Modelled\nSurface";
sp.HeadingStyle = HeadingStyles.Right;

zdata = new int[] {12,65,77,117,9,112};
xdata = new int[] {17,31,29,21,30,24};
ydata = new int[] {190,270,310,300,190,230};

sp.SetZTickMarks(50);

sp.CloudChartStyle = CloudChartStyles.WallShading|CloudChartStyles.ModelFit;
sp.SetWallFillStyles(FillStyle.Halftone);

sp.SetOrderOfFit(2,1);
sp.EquationFormat = "z = C0 + C1x + C2xÂ² + C3y";

sp.ZAxisStyle = ZAxisStyles.ForceZero;
sp.YAxisStyle = YAxisStyles.FlatText;
sp.SetPenWidths(1.2);

sp.SetMarkers(Marker.Node);
sp.DrawCloudChart(xdata,ydata,zdata);
sp.SetKeyText(sp.Equation);

The model in this case is quadratic in the X-direction and linear in Y to give the simple folded surface shown. The order of fit may be up to 4 (quartic) in either direction.

Trend surface with contour lines

sp.SetMargins(24,32,18,6);

zdata = new int[] {100,15,27,117,19,112};
xdata = new int[] {17,31,29,21,30,24};
ydata = new int[] {190,270,310,300,190,230};

sp.Heading = "Trend\nSurface";
sp.HeadingStyle = HeadingStyles.Right;

sp.SetZTickMarks(50);  // Contour interval also

sp.CloudChartStyle = CloudChartStyles.WallShading|CloudChartStyles.TrendSurface|
         CloudChartStyles.Contours|CloudChartStyles.GridLines|
         CloudChartStyles.TiledSurface;

sp.Flexibility = 1;
sp.ZAxisStyle = ZAxisStyles.ForceZero;
sp.YAxisStyle = YAxisStyles.FlatText;
sp.SetFillStyles(FillStyle.Opacity30);
sp.SetMarkerScales(2);

sp.SetMarkers(Marker.Node);
sp.DrawCloudChart(xdata,ydata,zdata);

This is again the analagous style to the ‘trendline’ available in the ScatterPlot. The surface is a gaussian-weighted smooth which can be controlled with the Flexibility property. With so few points, the sample sets the flex very low indeed as otherwise the surface would resemble a series of plateaux around each point. With a realistically large data array (probably several hundred points) the default flexibility would be more suitable.

Contour lines are drawn at each Z-axis tickmark, and the ‘grid’ is computed at the intersection of each x-y tick. The MeshDensity property can be used to add more points into the mesh to make a smoother surface.

Summary

Cloudcharts can be a really effective way to visualize genuine 3D datasets. However for serious data analysis it is probably better to use a set of simple 2D charts to show appropriate sections through the data.

See also ...

DrawCloudChart Method


SharpPlot 2.51 User Manual: Contour Plots for XYZ interpolation

Contour Plots for XYZ interpolation

Contour plots offer a 2-dimensional alternative to CloudCharts when it is necessary to visualize ‘height’ data in addition to x and y values. The data may be geographic (rainfall totals from a number of weather stations) or simply a model of 3 variables (house prices as a function of the age of the property and its floor area).

Depending on the type of data, SharpPlot can fit a variety of models to generate the contours for the height dimension. These four examples show how very similar numbers can create very different maps depending on the chosen approach. The key properties are the order of fit (which creates an underlying model) and flexibility (which determines how far the computed surface can deviate from the model).

Note that the ContourPlot is just an extension of the simple ScatterPlot, and shares many of its style settings.

A Simple 2-variable Regression Surface

This example fits the same Quadratic surface as the third CloudChart tutorial. You can see that several of the points fall on the ‘wrong’ side of the line, which is very reasonable for a noisy dataset where the Z-values may be subject to a large random error.

sp.Heading = "Modelled Surface using Contours";

zdata = new int[] {12,65,77,117,9,112};
xdata = new int[] {17,31,29,21,30,24};
ydata = new int[] {190,270,310,300,190,230};

sp.SetOrderOfFit(2,1);
sp.Flexibility = 0;
sp.EquationFormat = "z = C0 + C1x + C2xÂ² + C3y";

sp.ContourPlotStyle = ContourPlotStyles.ValueTags|ContourPlotStyles.ExplodeAxes|
         ContourPlotStyles.Curves;
sp.SetMarkers(Marker.Bullet);

sp.DrawContourPlot(xdata,ydata,zdata);
sp.SetKeyText(sp.Equation);

The Cloudchart is probably a better tool for an initial visualisation, but the Contourplot is much more suitable if you want to answer questions like “what is the best estimate for z, given x and y” as you can easily read off he numbers.

An Approximate Trend Surface

The remaining examples all use the same set of data-points as the final example in the Cloudchart tutorial. The same data-set can produce very different ‘landscapes’ depending on the model chosen.

zdata = new int[] {100,15,27,117,19,112};
xdata = new int[] {17,31,29,21,30,24};
ydata = new int[] {190,270,310,300,190,230};

sp.Heading = "Trend Surface (Rough fit)";

sp.ContourPlotStyle = ContourPlotStyles.ValueTags|ContourPlotStyles.ExplodeAxes|
         ContourPlotStyles.Curves;
sp.SetMarkers(Marker.Bullet);

sp.Flexibility = 5;
sp.MeshDensity = 2;

sp.DrawContourPlot(xdata,ydata,zdata);

The first surface shows the effect of setting the flexibility quite low. Each computed point on the xy grid then ‘sees’ many of the nearby points and the effect is create a quite smooth (but strongly averaged) surface. This would be a suitable model if the data were known to be noisy, and a rough feel for the shape of the surface was all that was required.

Fitting an Accurate set of Spot-heights

If the z-values really represent accurately measured values (spot heights in a landscape) then the map should be forced to fit itself around them.

zdata = new int[] {100,15,27,117,19,112};
xdata = new int[] {17,31,29,21,30,24};
ydata = new int[] {190,270,310,300,190,230};

sp.Heading = "Trend Surface (Close Fit)";
sp.SetAltitudeColors(new Color[]{Color.Navy,Color.Green,Color.GreenYellow,
         Color.Khaki,Color.Silver,Color.White});
sp.ContourPlotStyle = ContourPlotStyles.ValueTags|ContourPlotStyles.ExplodeAxes|
         ContourPlotStyles.AltitudeShading;
sp.SetMarkers(Marker.Bullet);

sp.Flexibility = 8;
sp.MeshDensity = 5;

sp.DrawContourPlot(xdata,ydata,zdata);

This example increases the mesh-density (to compute the contours at many more points) and sets the flexibility high enough to force the contours to behave correctly with respect to the points nearby. Whether this map is any better than any other is (of course) arguable. It is an interesting exercise to take a set of points like this and attempt to make the map by hand. Altitude shading has been used with ‘realistic’ colouring to give the effect of an aerial view of a landscape.

Fitting a Flexible Cubic Model

The final example generates the most ‘satisfying’ map, from a purely visual point of view. This allows SharpPlot to fit a cubic regression surface in the x-direction, then apply a little flexibility to this to finalise the shape of the surface. No underlying model is assumed in the y-direction.

zdata = new int[] {100,15,27,117,19,112};
xdata = new int[] {17,31,29,21,30,24};
ydata = new int[] {190,270,310,300,190,230};

sp.Heading = "Cubic Model with False Colours";
sp.SetAltitudeColors(new Color[]{Color.SlateBlue,Color.Navy,Color.Green,Color.Red,
         Color.Orange,Color.Yellow});

sp.ContourPlotStyle = (ContourPlotStyles.ValueTags|ContourPlotStyles.ExplodeAxes|
         ContourPlotStyles.AltitudeShading|ContourPlotStyles.Curves);
sp.SetMarkers(Marker.Bullet);

sp.SetOrderOfFit(3,0);
sp.Flexibility = 8;
sp.MeshDensity = 3;

sp.DrawContourPlot(xdata,ydata,zdata);

This combination of modelfit and flexibility is a good approach when you know that the z-value is composed of several effects, some of which are expected to obey a known model, but some of which are effectively ‘random’ values. Altitude shading can be used with an array of suitable color values to help bring out the shape of the final surface.

Summary

Contour plots can be an excellent way to display 3-dimensional data on a 2-dimensional chart, but creating the ‘best’ surface for any given dataset will require some prior knowledge of the underlying model, and a certain amount of experimentation.

See also ...

Flexibility Property | SetOrderOfFit Method


SharpPlot 2.51 User Manual: Dials and Gauges for isolated numbers

Dials and Gauges for isolated numbers

The Dial chart is the only charttype in SharpPlot which typically takes a single number, rather than an array. It is possible to use charts like the XBarchart to imitate thermometers and other simple gauges, but the Dial has the benefit of showing some of the context of the data with warning zones, datum lines and other cues.

A Simple Dial to Show One Value

sp.SetMargins(24,24,12,12);
sp.Heading = "Simple Pointer and Scale";
sp.SetAxisStyle(Color.Navy,LineStyle.Solid,1.2);
sp.SetXLabelFont("Arial",12,FontStyle.Bold);

sp.SetPenWidths(2);
sp.SetXRange(30);
sp.SetXTickMarks(5,4);
sp.SetDatumLineStyle(Color.Red,LineStyle.Dash,0.8);
sp.SetXDatumLines(25);

sp.DrawDialChart(17);

This chart has a simple pointer, and adds a datum line to show a reasonable maximum value. Note that the x-range is used to range the dial here, and is always required as SharpPlot has no way to guess the correct range from a single data point.

Arrowed Pointer and a Warning Zone

sp.SetMargins(24,24,12,12);
sp.Heading = "Arrowed Pointer and Zone";
sp.SetAxisStyle(Color.White,LineStyle.Solid,2);
sp.SetXLabelFont("Arial",16,FontStyle.Bold,Color.White);
sp.SetChartBackground(Color.DarkSlateGray,FillStyle.Solid);

sp.SetPenWidths(2);
sp.SetColors(Color.Red);

sp.DialChartStyle = DialChartStyles.ArrowLines|DialChartStyles.WedgeZones;
sp.SetXRange(1000);
sp.SetXTickMarks(500,4);

xzone = new Zone(700,1000,Color.Red,FillStyle.ForwardDiagonal);
sp.SetXZones(xzone);

sp.XCaption = "rpm\nÃ—1000";
sp.SetXCaptionFont("Times",18,FontStyle.Italic|FontStyle.Bold,Color.Yellow);
sp.CaptionLineSpacing = 120;

sp.DrawDialChart(345);

This chart is designed to look as if it came from an instrument panel. The ‘red zone’ is very prominently marked with a wedge of color and the x-caption is used to label the value. A typical application might use several of these dials to make a ‘cockpit’ view of selected key parameters for a company healthcheck.

Two Warning Zones

sp.SetMargins(24,24,12,12);

sp.Heading = "Ranged, with Two Annular Zones";
sp.SetAxisStyle(Color.Black,LineStyle.Solid,2);
sp.SetXLabelFont("Arial",12,FontStyle.Bold);

sp.SetPenWidths(2);
sp.SetBackground(Color.Silver,FillStyle.Solid);
sp.SetChartBackground(Color.White,FillStyle.Solid);
sp.SetXRange(200,800);
sp.SetXTickMarks(100,1);

xzones = new Zone[]{new Zone(200,350,Color.Green),new Zone(700,800,Color.Orange)};
sp.SetXZones(xzones);

sp.XCaption = "psi";
sp.SetXCaptionFont("times",18,FontStyle.Italic,Color.Maroon);

sp.DrawDialChart(345);

This chart uses ‘annular’ zones (the default) to show two significant ranges in different colors. This gives a very clear indication of the health (or otherwise) of some key indicator of company performance.

Multiple Pointers and Zones

sp.SetMargins(24,24,12,12);

sp.Heading = "Multiple Pointers and Zones";
sp.SetBackground(Color.Silver);
sp.SetChartBackground(Color.White,FillStyle.Solid);
sp.SetAxisStyle(Color.Black,LineStyle.Solid,2);
sp.SetXLabelFont("Arial",12,FontStyle.Bold);

sp.SetColors(new Color[]{Color.Navy,Color.Maroon});
sp.DialChartStyle = DialChartStyles.ArrowLines;
sp.SetPenWidths(new double[] {2,1.2});
sp.SetLineStyles(LineStyle.Solid);

sp.SetXRange(100);
sp.SetXTickMarks(20,3);

xzones = new Zone[]{new Zone(0,10,Color.Lime),new Zone(40,70,Color.Orange),
         new Zone(70,100,Color.Red)};
sp.SetXZones(xzones);

radii = new int[] {100,50};
data = new int[] {25,56};

sp.DrawDialChart(data,radii);

The final chart has two values, which would typically by shown (as here) with pointers of different lengths. There is no limit to the number of pointers or Zones, but in practice this chart is probably at the limit of what the dial can reasonably display. It would be much better to make a matrix of dials using a trellis to show several related values.

See also ...

DrawDialChart Method


SharpPlot 2.51 User Manual: Gantt Charts for timewise bars

Gantt Charts for timewise bars

The Gantt chart was originally developed as a good way to represent activities across time, and was popularised by tools such as Microsoft Project. It may be used in a variety of planning scenarios, or simply to show the status of some activity or piece of machinery across time (say machine performance across the day).

A Simple Activity Schedule

This example shows four activities planned by week-number.

sp.Heading = "Work Schedule";
todo = new string[]{"","Clear ground","Dig drains","Lay foundations","Concrete floors"};
sp.SetYLabels(todo);

startwk = new int[] {24,28,34,50};
endwk = new int[] {30,36,48,54};
ydata = new int[] {1,2,3,4};

sp.MarginLeft = 72;
sp.YAxisStyle = YAxisStyles.ForceZero|YAxisStyles.GridLines;
sp.SetXTickMarks(5);

sp.DrawGanttChart(ydata,startwk,endwk);

The activity names have been used as axis labels here, but note that you must provide one label per tick-mark, so there is an extra dummy label to go opposite the X-axis. The left-margin will usually need to be made a little wider, even if the labels are wrapped into a preset width (as here).

Categorised and Labelled Activities

This example is very similar, but labels the activities rather than the axis.

sp.Heading = "Work in Progress";
sp.HeadingStyle = HeadingStyles.Right;
todo = new string[]{"Clear ground","Dig drains","Lay foundations","Concrete floors"};
startwk = new int[] {24,28,34,50};
endwk = new int[] {30,36,48,54};
ydata = new int[] {4,3,2,1};
status = new string[]{"Done","Done","Progressing","Not started"};
sp.SetValueFont("Arial",8,FontStyle.Bold);
sp.SetValueTags(todo);
sp.GanttChartStyle = GanttChartStyles.ValueTags;
sp.YAxisStyle = YAxisStyles.ForceZero|YAxisStyles.GridLines|YAxisStyles.NoLabels;
sp.SetXTickMarks(5);
sp.SplitBy(status);
sp.DrawGanttChart(ydata,startwk,endwk);

The activities have been classified depending on status, and are drawn with the earliest at the top of the chart this time.

Using the barwidths to show resources

The third variation on this basic chart uses the widths of each bar to indicate the number of people on site for each phase.

sp.Heading = "Resources";
sp.HeadingStyle = HeadingStyles.Right;
todo = new string[]{"Clear ground","Dig drains","Lay foundations","Floor"};
startwk = new int[] {24,28,34,50};
endwk = new int[] {30,36,48,54};
ydata = new int[] {4,3,2,1};
status = new string[]{"Done","Done","Progressing","Not started"};
resources = VectorMath.Multiply(0.33,new int[] {2,1,3,2});
sp.SetValueFont("Arial",8,FontStyle.Bold,Color.White);
sp.SetValueTags(todo);
sp.ValueTagStyle = ValueTagStyles.Inside;
sp.ValueTagFormat = "XXXXXXXX;";
sp.GanttChartStyle = GanttChartStyles.ValueTags;
sp.YAxisStyle = YAxisStyles.ForceZero|YAxisStyles.GridLines|YAxisStyles.NoLabels;
sp.SetXTickMarks(5);
sp.SetXZones(new Zone(40,44,Color.LightGreen));
sp.SplitBy(status);
sp.SetBarWidths(resources);
sp.DrawGanttChart(ydata,startwk,endwk);

This time the bars have been labelled inside – be sure there is enough space for the labels if you choose to do this with real data. The widths are given in terms of the Y-scale, so typically the largest bar should be scaled to around 1 unit here.

Note the use of an XZone to indicate a particular period of time – probably a holiday week. You can set an array of zone definitions here to mark out several time intervals if required.

Plant Status Chart

This final chart uses the Gantt style to show historical performance rather than a schedule. The times are given as decimal parts of the day – see DateTime.ToOADate in the .Net framework for the conversion from DateTime objects.

ydata = new int[] {1,2,2,1,2,2,3,1,2,3};
starttime = new double[] {0.5,0.52083,0.60278,0.57291,0.5243,0.62986,0.6041,0.5694,0.5,0.5};
endtime = new double[] {0.5694,0.5243,0.62986,0.6667,0.6028,0.6667,0.6667,0.57291,
         0.52083,0.6041};
// Colours are allocated by state
state = new int[] {2,2,2,3,3,3,3,1,1,1};
sp.Heading = "Machine Status Summary";
sp.SetChartBackground(Color.Silver,FillStyle.Halftone);
sp.SetColors(new Color[]{Color.Maroon,Color.Olive,Color.Green});
sp.SetFillStyles(FillStyle.Pipe);
sp.XAxisStyle = XAxisStyles.Time|XAxisStyles.GridLines|XAxisStyles.ArrowedAxis;
sp.YAxisStyle = YAxisStyles.ExactFit;
sp.SetYRange(0,3.5);  // Space above top bar
sp.SetYTickMarks(1);
sp.SetXRange(12,16);  // Lunchtime to 16:00
sp.BarEdgeNib = 0;
sp.YLabelFormat = "##";  // Eliminate zero
sp.SetKeyText(new string[]{"Out of Action","Running acceptably","Running well"});
sp.SplitBy(state);

sp.SetBarWidths(0.5);
sp.DrawGanttChart(ydata,starttime,endtime);

Assuming the state information is complete, each bar will be continous across time, and will show colored bands corresponding to the state of each machine during that period. The gradient fill looks quite good here, but obviously adds no extra information and makes the saved chart a little larger in any of the raster formats.

Summary

This is a fairly special-purpose chart, but is a very convenient way to outline blocks of activities or status across time.

See also ...

DrawGanttChart Method


SharpPlot 2.51 User Manual: Histograms for distributions

Histograms for distributions

All the examples which follow use the same set of values – the sum of three dice, thrown repeatedly. Clearly the range will vary from 3 to 18, with the more likely values falling in the middle.

Aggregating a Set of Samples

This first chart takes most of the SharpPlot defaults as they come and simply displays the distribution of samples.

sp.Heading = "Sum of 3 Dice Throws";
threedice = new int[] {9,8,6,11,9,14,11,8,9,14,12,7,6,11,15,14,11,7,5,8,7,9,6,7,12,
         7,13,8,9,13,7,7,8,12,11,16,12,9,11,12,12,12,9,14,8,9,13,11,10,13,11,13,9,
         10,10,4,14,8,9,11,12,5,12,15};
sp.HistogramStyle = HistogramStyles.SurfaceShading;
sp.SetXRange(3,18);
sp.XAxisStyle = XAxisStyles.MiddleLabels;
sp.DrawHistogram(threedice);

With integer data (one ‘bin’ per value) it clearly makes sense to label the bars, rather than the tickmarks. For some reason, thise set of throws produced very few 10s, but is otherwise unremarkable.

Grouping into Class Intervals

This example aggregates the same data into groups 2-4, 4-6 and so on. The groups are all labelled (including the groups with zero count, as this is perfectly valid data here).

sp.Heading = "3 Dice Throws (Grouped)";
sp.HistogramStyle = HistogramStyles.SurfaceShading|HistogramStyles.ValueTags;
sp.SetFillStyles(FillStyle.GradientBottom);
sp.SetValueFont("Arial",10,FontStyle.Bold);

sp.SetXRange(3,18);
sp.ClassInterval = 2;
sp.SetXTickMarks(2);

sp.DrawHistogram(threedice);

Very Plain, with Exploded Axes

This example is a style of histogram often seen in statistical journals.

sp.Heading = "Histogram with Exploded Axes";
sp.HistogramStyle = HistogramStyles.Risers|HistogramStyles.ExplodeAxes;

sp.SetXRange(3,18);
sp.ClassInterval = 2;
sp.SetXTickMarks(2);

sp.DrawHistogram(threedice);

Overlayed Normal Curve

The final example draws a theoretical bellcurve centred on the mean.

sp.Heading = "Histogram with Normal curve";
sp.HistogramStyle = HistogramStyles.SurfaceShading|HistogramStyles.Risers|
         HistogramStyles.NormalCurve;
sp.SetFillStyles(FillStyle.Halftone);
sp.SetPenWidths(2);

sp.SetXRange(3,18);
sp.ClassInterval = 3;
sp.SetXTickMarks(3);

sp.DrawHistogram(threedice);

Datumlines or an XZone could be added to show the ‘range’ of the data, typically the mean +/- 2 standard deviations.

See also ...

DrawHistogram Method


SharpPlot 2.51 User Manual: Line Graphs and Time Series

Line Graphs and Time Series

Although it is called ‘Linegraph’ this SharpPlot method can do markers, risers from the X-axis, filled surfaces and so on, in any combination. Typically it is used for timeseries data, but of course it can also draw any continuous curve when given x as well as y co-ordinates.

A Typical Timeseries with Averaging

SharpPlot offers several ways to smooth a typically noisy timeseries. You can use the ‘Trend’ style to add a gaussian-weighted moving average or you can use any combination of traditional smoothing methods. This example has the results of monitoring the fuel consumption of a typical family car (measured in miles per gallon of fuel) which has plenty of random variation and some clear cycles (probably winter and summer).

odo = new int[] {11061,11354,11689,11975,12300,12558,12856,13100,13455,13841,14239,
         14571,14721,15058,15546,15886,16220,16592,16944,17192,17552,17906,18252,
         18381,18611,18876,19224,19558,19907,20252,20584,20914,21188,21549,21901,
         22204,22563,22890,23232,23510,23847,24214,24589,24954,25291,25627,25977,
         26366,26708,27030,27396,27753,28107,28437,28792,29136,29459,29831,30153,
         30487,30796,31127,31440,31722,32018,32442,32755,33045,33385,33689,34031,
         34355,34715,34944,35281,35398,35618,35915,36225,36526,36878,37212,37496,
         37805,38152};
mpg = new double[] {0,37.6,39.4,37.2,39.7,38.2,37.2,39.6,40.2,41,43.1,39.9,40.1,
         38.3,41.9,38.8,41.3,41.4,44.2,36,44,39.2,43,41.6,41.8,36.9,39.3,40.9,38.4,
         40.3,37.9,38.8,38.6,39.9,37.2,38.9,38.8,40.4,35.9,40.6,39.8,39.8,38.1,39,
         38.8,39.2,39.1,40.7,39.7,42.4,41.4,41.3,41.9,42.4,39.5,41.8,41.7,39.5,41.3,
         40.6,38.6,40.2,39.2,37.3,37.1,37.5,38.8,35.7,39.5,38.9,37.6,39.2,37.8,42.5,
         36.6,37.2,40.7,35,38.4,41.3,38,37.9,39.8,36.6,39.8};

sp.Heading = "Plot of MPG against Miles Run";
sp.SetXTickMarks(5000);
sp.LineGraphStyle = LineGraphStyles.TrendLine|LineGraphStyles.OnTopModel;
sp.Flexibility = 5;
sp.MissingValue = 0;
sp.SetLineStyles(new LineStyle[]{LineStyle.Solid,LineStyle.Dash});
sp.SetPenWidths(new double[] {0.8,1.2});

sp.DrawLineGraph(mpg,odo);  // SharpPlot.DrawLineGraph

sp.SetKeyText(new string[]{"Raw MPG data","Gaussian smooth"});

Note that the very first value is a ‘dud’ and is removed from the plot by setting it as ‘missing data’. In this case the fitted curve has been emphasised over the raw series by drawing it with a heavier line, on top of the data.

Of course you may have your own routines to compute more sophisticated curves and just add them to the chart with more calls to DrawLineGraph. A typical trick used when monitoring market data is to plot several moving averages and look for the point where they cross.

Mountain-range shading

Sometimes it is best to show the accumulated values of several series as a stack of shaded surfaces. SharpPlot will accumulate the series for you and shade the surfaces if required.

sp.Heading = "Total Monthly Sales by Region";

home = new int[] {18,16,21,22,21,27,23,24,27,24,23,18};
export = new int[] {4,4,3,4,5,7,12,9,8,3,3,2};
months = new int[] {1,2,3,4,5,6,7,8,9,10,11,12};

sp.LineGraphStyle = LineGraphStyles.SurfaceShading;
sp.DataStyle = DataStyles.Relative;
sp.YAxisStyle = YAxisStyles.ForceZero;
sp.SetXLabels(new string[]{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep",
         "Oct","Nov","Dec"});

sp.SetFillStyles(FillStyle.GradientBottom);
sp.SetPenWidths(0.1);
sp.SetLineStyles(LineStyle.Solid);

sp.DrawLineGraph(new int[][]{home,export},months);  // SharpPlot.DrawLineGraph
sp.SetKeyText(new string[]{"Home trade","Exported"});

Note that any gradient fills are defined on the entire plotting region, so will always be consistently applied regardless of the range of the data. Clearly, you must pass all the series in the same call to have SharpPlot accumulate them for you in this way.

Drawing a Line given both x and y values

This example illustrates a mathematical curve, with computed x and y values. The ‘curves’ style also works well for examples like this, as many fewer intermediate points are required to give a pleasing result.

e = 2.718281828459045;
b = 0.30634896253003313;  // ln(phi) / (pi/2)
t = VectorMath.Multiply(-0.1,VectorMath.Range(0,1000));  // 1000 angles in [Â¯100;0] radians
mag = VectorMath.Pow(e,VectorMath.Multiply(b,t));  // multiplied by phi every quarter-turn
xdata = VectorMath.Multiply(mag,VectorMath.Cos(t));
ydata = VectorMath.Multiply(mag,VectorMath.Sin(t));

sp = new SharpPlot(300,300);
sp.Heading = "Golden logarithmic spiral";
sp.Subheading = "on orthonormal axes";
sp.SetMargins(60,10,35,35);  // make sure chart area is square, for orthonormal axes
sp.SetXRange(-1,1);
sp.SetYRange(-1,1);  // make sure ranges are square too
sp.XAxisStyle = (XAxisStyles.DuplicateAxes|XAxisStyles.GridLines);
sp.YAxisStyle = (YAxisStyles.DuplicateAxes|YAxisStyles.GridLines);
sp.DrawLineGraph(ydata,xdata);

It is called a Fibonacci spiral, and cuts the x-axis at the classic Fibonacci series values of 1 1 2 3 5 8 and so on.

The Playfair Plot

This chart (quoted in Tufte’s first book) was first used in 1760 to show the rising national debt in England. There are quite a lot of properties to set here, but it is tedious rather than hard, to get the feel of the original graphic.

years = new int[] {1688,1701,1714,1727,1739,1748,1755,1762,1775,1784};
debt = new double[] {0.2,1.3,3.2,2.4,2.1,3,2.2,4.8,4.4,9.2};

sp.LineGraphStyle = LineGraphStyles.SurfaceShading|LineGraphStyles.ValueTags;
sp.SetMargins(24,36,12,24);
sp.XAxisStyle = XAxisStyles.GridLines;
sp.YAxisStyle = YAxisStyles.GridLines|YAxisStyles.RightAxis;
sp.SetHeadingFont("times",12,(FontStyle.Bold|FontStyle.Italic));
sp.SetGridLineStyle(Color.LightGray,LineStyle.Solid,0.3);
sp.SetDatumLineStyle(Color.LightGray,LineStyle.Solid,1.5);
sp.SetXTickMarks(years);
sp.SetYRange(20);
sp.SetYTickMarks(1);
sp.SetFillStyles(FillStyle.Opacity42);
sp.Heading = "Interest of the NATIONAL DEBT from the Revolution";
sp.SetYDatumLines(10);

vtags = new string[]{"Revolution","Accession of Queen Anne",
         "Accession of George 1st","Accession of George 2nd",
         "Beginning of Spanish War","End of Spanish War",
         "Beginning of Continental War","End of Continental War",
         "Beginning of American War","End of American War"};

sp.SetValueTags(vtags);
sp.SetValueFont("Times",6,FontStyle.Regular,Color.Red);
sp.ValueTagStyle = ValueTagStyles.Vertical;

sp.DrawLineGraph(debt,years);

The most interesting design feature is the x-tick spacing where significant historical dates have been used to mark the years. The Y-axis is intentionally over-scaled to reduce the political impact of the graphic! Playfair’s first draft of this chart was much more dramatic. Opacity is used to give the effect of a water-color wash as used in the original drawing.

Summary

The Linegraph is by far the most versatile plotting method offered by the SharpPlot library, and is definitely the most widely used. It can be used in combination with any other 2D chart type to add extra lines and decorations as well as being a plotting tool in its own right.

See also ...

DrawLineGraph Method


SharpPlot 2.51 User Manual: Min-Max or Hi-Lo Charts

Min-Max or Hi-Lo Charts

This chart is often used in combination with a LineGraph or ScatterPlot to show range in addition to daily values. The first example creates a typical ‘High-Low-Close’ chart from daily share price information, and the second shows how errorbars can be added to a scatterplot of experimental data. However, it can be used on its own, for example to show the span of frost-free days across the year as a timeseries.

A Typical Hi-Lo-Close Plot

There are many variations on this chart, but most of them come down to a combination of a MinMax and an overlayed scatterplot.

hi = new int[] {123,118,119,125,132,135,140,141,138,136,131,132};
lo = new int[] {120,115,117,123,128,134,135,136,131,125,122,125};
close = new int[] {122,116,117,124,129,135,139,141,132,130,124,126};
wkno = new int[] {36,37,38,39,40,41,42,43,44,45,46,47};

sp.Heading = "Hi-Lo Close Chart";

sp.SetColors(Color.Navy);
sp.SetPenWidths(2);
sp.DrawMinMaxChart(hi,lo,wkno);  // SharpPlot.DrawMinMaxChart

sp.SetMarkers(Marker.RightTick);
sp.LineGraphStyle = LineGraphStyles.Markers|LineGraphStyles.NoLines;
sp.DrawLineGraph(close,wkno);

The ‘LeftTick’ and ‘RightTick’ markers are specifically designed for this type of chart – you could additionally use a LeftTick to show the opening level if required.

Adding Errorbars to a ScatterPlot

Experimental data may have errors on the y-dimension, the x-dimension or both. This chart is very similar to the Hi-Lo plot, but uses two MinMax charts to show errors in both X and Y directions.

yield = new int[] {6,8,12,11,17,32,20,28};
temp = new int[] {12,14,23,28,31,34,36,40};
error = new int[] {2,2,4,4,4,12,6,8};

sp.Heading = "Errorbars in 2 Dimensions";
sp.XCaption = "Temperature Â°C";
sp.YCaption = "Yield (gm)";

sp.SetColors(new Color[]{Color.Navy,Color.Navy,Color.Maroon});
sp.MinMaxChartStyle = MinMaxChartStyles.ErrorBars;
sp.DrawMinMaxChart(VectorMath.Sum(yield,error),VectorMath.Subtract(yield,error),temp);

sp.MinMaxChartStyle = MinMaxChartStyles.ErrorBars|MinMaxChartStyles.Horizontal;
sp.DrawMinMaxChart(VectorMath.Sum(temp,1),VectorMath.Subtract(temp,1),yield);

sp.SetMarkers(Marker.Bullet);

sp.DrawScatterPlot(yield,temp);

Note that the scatter is typically the last chart to be drawn, so that the errorbars set the Y-axis range. If the X-errors are very large it may be necessary to set the X-axis range explicitly here. This also has the effect of placing the markers on top of the errorbars, which looks much cleaner.

Frost-free days as a TimeSpan

This time, a horizontal chart style is used so that the years are stacked vertically up the page.

sp.SetMargins(12,20,24,12);

years = new int[] {89,90,91,92,93,94,95,96,97,98,99,0,1,2,3};
days = new int[] {31,29,31,30,31,30,31,31,30,31,30,31};
dmax = new int[] {324,294,293,288,333,309,313,298,291,279,305,309,292,295};
dmin = new int[] {108,118,95,107,108,118,97,127,106,108,106,130,109,102};

sp.SetXTickMarks(VectorMath.Catenate(0,VectorMath.RunningTotal(days)));
sp.XAxisStyle = XAxisStyles.GridLines|XAxisStyles.MiddleLabels|XAxisStyles.ForceZero;
sp.SetXLabels(new string[]{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep",
         "Oct","Nov","Dec"});
sp.YAxisStyle = YAxisStyles.ForceZero|YAxisStyles.AtEndCaption;
sp.YCaption = "Year";
sp.YLabelFormat = "00";
sp.SetYLabels(years);
sp.SetYTickMarks(1);

sp.MinMaxChartStyle = MinMaxChartStyles.Horizontal|MinMaxChartStyles.ArrowLines|
         MinMaxChartStyles.Envelope;
sp.SetFillStyles(FillStyle.Opacity30);

sp.SetArrowStyle(7,20,FillStyle.Saturate80);

sp.DrawMinMaxChart(dmax,dmin);

sp.SetNoteFont("Arial",24,FontStyle.Bold,Color.White);
sp.DrawNote("Frost-free Days",170,2,65);

This gives a clear picture of the ‘growing season’ from year to year. The arrowheads have been ‘customised’ a little here (the default shape is a little too fat) and an angled note is used to label the central region.

Using Envelope Fill as a Backcloth

Another good use of this chart is to show increasing uncertainty into the future. This example shows a projected cumulative spending pattern, with an overrun zone to allow for ‘contingencies’ which cannot be planned for.

sp.Heading = "Annual Budget with Overrun Zone";

budget = new int[] {0,5,15,17,20,34,53,66,72,87,92,102,104};
bmax = new int[] {0,6,18,22,27,44,66,82,91,109,118,131,137};
xdata = new int[] {0,1,2,3,4,5,6,7,8,9,10,11,12};

sp.XAxisStyle = XAxisStyles.GridLines|XAxisStyles.MiddleLabels|XAxisStyles.ForceZero;
sp.SetXLabels(new string[]{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep",
         "Oct","Nov","Dec"});

sp.SetColors(Color.Navy);
sp.MinMaxChartStyle = MinMaxChartStyles.Envelope|MinMaxChartStyles.NoLines;
sp.SetFillStyles(FillStyle.GradientBottom);

sp.DrawMinMaxChart(budget,bmax,xdata);

sp.SetPenWidths(2);
sp.DrawLineGraph(budget,xdata);
sp.SetKeyText(new string[]{"","Cumulative budget spend"});

This could be used with financial data to show deviation from budget, or the movement of some key variable within its ‘allowed’ band. It could also show the confidence limits around a modelfit or economic forecast.

Summary

The MinMax chart is ideal wherever data has a natural range. It can also be used as a backcloth to many other charts to show an allowed or predicted range for a data series.

See also ...

DrawMinMaxChart Method


SharpPlot 2.51 User Manual: Multiples for small thumbnails

Multiples for small thumbnails

One of the best innovations in Tufte’s “The Visual Display of Quantitative Information” is the idea of using an array of miniature charts to display multi-dimensional data. Often a series of values are recorded at (say) several sites or on several days, then are superimposed on a single chart as a collection of dotted and dashed lines in various colors. This often makes it very hard to see the patterns and relationships in the data.

The ‘Multiple’ plots each series on its own chart, and arranges them automatically in a trellis to allow easy comparison between them.

Comparing two datasets

This example is the simplest form of multiple chart. Two sets of data are compared by being plotted side-by-side as barcharts. Note that the multiple chart has very few styles of its own – here the example uses the YAxisStyle to have both charts constrained to show the zero point.

data = new int[][]{new int[]{1,2,3},new int[]{4,5,6}};

sp.SetPageLabels(new string[]{"1995","2005"});
sp.SetXLabels(new string[]{"Milk","Eggs","Bread"});

sp.YAxisStyle = YAxisStyles.ForceZero;
sp.SetLabelFont("Arial",13);
sp.SetCaptionFont("Arial",15,FontStyle.Bold,Color.Firebrick);

sp.DrawMultiple(ChartType.BarChart,data);

PageLabels are a useful way of labelling the cells in the trellis.

A Collection of Histograms

The barley-yield data could be shown on a single histogram, but often this conceals some systematic variation in the data. In this example, the farm is used to create a trellis of charts, each showing the spread of the data at the individual farms.

Although the experiment was designed to investigate various barley varieties, this plot makes it very clear that the farm is going to be a big factor in the outcome. A quick glance shows that yields at Wasaca may be quite variable, but that it easily beats both Grand Rapids and Duluth (which is consistently very poor).

sp.SplitBy(_barleyfarm);  // One cell per farm

sp.HistogramStyle = HistogramStyles.SurfaceShading;
sp.ClassInterval = 10;
sp.SetXRange(0,70);
sp.SetYRange(14);

sp.SetCaptionFont("Arial",14,FontStyle.Bold,Color.Firebrick);
sp.DrawMultiple(ChartType.Histogram,_barleydata);

The PageLabels have been automatically set to reflect the unique values in the dimension used to split the data.

Constructing a dashboard

This example automates a typical use of the dial chart, which are often grouped in arrays to show related values.

sp.SetXRange(100);
sp.SetXZones(new Zone(80,100,Color.Red,FillStyle.Solid));
sp.SetPenWidths(1.5);
sp.DialChartStyle = DialChartStyles.ArrowLines;

sp.SetPageLabels(new string[]{"Engine No.1","Engine No.2","Engine No.3","Engine No.4"});
sp.XCaption = "Coolant &deg;C";

sp.SetLabelFont("Arial",13);
sp.SetCaptionFont("Arial",15,FontStyle.Bold,Color.Firebrick);

sp.DrawMultiple(ChartType.DialChart,new int[]{23,34,78,12});

Note that the range and warning zone will be common to all the charts in the trellis.

Comparing several attributes

The final example shows a collection of polar charts, which readily allow various criteria to be compared across several cameras (the example came from a Swiss camera magazine). Notice how the distinct set of camera types is automatically used as page-labels to caption each chart in the trellis.

sp.SetMargins(36,12,20,0);

cameradata = new double[] {4.5,3.1,2,4.5,5,2.5,5,5,3,5,3.5,2.5,4.5,3,3,4.5,2,4,4.5,
         4.5,2.5,4.5,4.5,4.5};
cameratype = new int[] {1,1,1,1,1,1,2,2,2,2,2,2,3,3,3,3,3,3,4,4,4,4,4,4};
cameranames = new string[]{"Sony\nCyber-Shot\nDSC-V1","Canon\nPowerShot\nG5",
         "Nikon\nCoolPix\n5400","Olympus\nCamedia\nC-5060"};
cameracap = new string[]{"RÃ©solution","Rendu","Couleur","SensibilitÃ©","Flash",
         "Autofocus","RapiditÃ©"};

sp.SplitBy(cameratype);  // Sets trellis
sp.SetPageLabels(cameranames);  // Sets cell labels

sp.SetFillStyles(FillStyle.Opacity42);
sp.SetColors(Color.Red);
sp.SetMarkers(Marker.SmallBullet);
sp.SetLineStyles(LineStyle.Solid);
sp.SetPenWidths(1);

sp.PolarChartStyle = PolarChartStyles.SurfaceShading|PolarChartStyles.GridLines|
         PolarChartStyles.Markers;
sp.YAxisStyle = YAxisStyles.ForceZero;
sp.SetXLabels(cameracap);
sp.XLabelFormat = "XXXXXXXX;";
sp.SetLabelFont("Arial",6,Color.Black);
sp.SetCaptionFont("Arial",14,FontStyle.Bold,Color.Black);

sp.DrawMultiple(ChartType.PolarChart,cameradata);

This is likely to make visual comparison much easier than attempting to overlay the radar plots from several cameras on the same chart.

See also ...

DrawMultiple Method


SharpPlot 2.51 User Manual: Pie Charts and Rose Diagrams

Pie Charts and Rose Diagrams

Piecharts are best used with a small number of data items where the values represent some part of a total. Typically the numbers will be percentages, and the sector values will differ significantly. If it is important for the user to be able to compare values accurately, a simple Barchart is almost always a better choice.

A Basic Pie with Spider Tags

This example shows a piechart with most of the options left to default.

sp.SetMargins(16,0,6,6);
sp.Heading = "A Basic\nPiechart";
sp.HeadingStyle = HeadingStyles.Right;

sp.SetXLabels(new string[]{"Hello","World","This label will be wrapped"});
sp.SetLabelFont("Arial",10,FontStyle.Bold,Color.Navy);
sp.XLabelFormat = "XXXXXXXXXXXXXX;";
sp.DrawPieChart(new int[]{13,3,2},new int[]{0,20,0});

Note that SharpPlot treats piecharts as if they have an ‘x-axis’ so this example uses X-labels and wraps them with an X-axis formatter. The chart allows ‘reasonable’ headspace for the labels (within the chart margins) but it may be necessary to adjust either the positioning or radius of the pie if there is a lot of long label text.

Labelling inside the sectors

This chart complements the political graphic in the Barchart tutorial by showing the percentage of votes cast for each party.

sp.SetMargins(18,24,18,0);

Party = new string[]{"Con","Lib","Lab"};
Votepc = new int[] {48,37,15};

sp.Heading = "Share of\nVotes Cast";
sp.HeadingStyle = HeadingStyles.Left;
sp.SetHeadingFont("ARB",14);

sp.PieChartStyle = PieChartStyles.ValueTags;
sp.PieStartAngle = 90;
sp.SetEdgeStyle(Color.White,LineStyle.Solid,3);  // SharpPlot.SetEdgeStyle
sp.ValueTagStyle = ValueTagStyles.Inside;
sp.SetValueFont("ARB",18,Color.White);
sp.ValueTagFormat = "#0%";

sp.SetColors(new Color[]{Color.Navy,Color.Orange,Color.Red});  // Party colors
sp.DrawPieChart(Votepc);

sp.SetKeyText(Party);
sp.KeyStyle = KeyStyles.Vertical|KeyStyles.Boxed|KeyStyles.Rounded|
         KeyStyles.Shadowed|KeyStyles.LeftAlign|KeyStyles.BottomAlign;
sp.SetKeyFont("ARB",11,Color.Navy);

The numbers are written inside each sector here. Obviously, this approach only works if most of the sectors are reasonably large as SharpPlot will simply omit any labels which don’t fit. This pie starts drawing from the 3:00 line (rather than midnight) and uses a thick white edge to give a ‘dissected’ appearance.

Note that SharpPlot does not multiply the values by 100 here – the ‘%’ symbol is treated like any other insertion character and has no special meaning.

Merging values and labels

This is a very similar example, but instead of drawing a separate legend, it uses a special format string to merge the X-label text into the spider tags. The string ‘XL’ is treated as an insertion point for the corresponding value from the array of labels.

sp.SetMargins(12,0,18,0);

Party = new string[]{"Con","Lib","Lab"};
Votepc = new int[] {48,37,15};

sp.Heading = "Share of Votes Cast";
sp.HeadingStyle = HeadingStyles.Left;
sp.SetHeadingFont("ARB",14);

sp.PieChartStyle = PieChartStyles.ValueTags|PieChartStyles.Plain;
sp.SetEdgeStyle(Color.White,LineStyle.Solid,3);
sp.SetXLabels(Party);
sp.SetXLabelFont("ARB",12,Color.Navy);
sp.ValueTagFormat = "XL #0%";

sp.SetColors(new Color[]{Color.Navy,Color.Orange,Color.Red});

sp.DrawPieChart(Votepc);

The ‘plain’ style simply omits the spider lines.

Drawing a Rose Diagram

This is a fairly uncommon plot, but does illustrate the possibility of varying the sector radii as well as the angular values. The data is genuine, and shows that snowfields tend to stick around more on NE-facing slopes! Note that you must give 8 equal values for the angles, and set the appropriate style here to have the explosions treated as radii.

sp.Heading = "Distribution of\nCorrie Directions\nin Scotland";
sp.HeadingStyle = HeadingStyles.Bottom|HeadingStyles.Left;

corries = new int[] {6,7,5,3,3,2,3,5};

sp.PieChartStyle = PieChartStyles.ValueTags|PieChartStyles.RoseDiagram;
sp.SetValueTags(corries);
sp.ValueTagStyle = ValueTagStyles.Inside;
sp.SetValueFont("ARB",12,Color.White);

sp.SetColors(Color.ForestGreen);
sp.SetEdgeStyle(Color.White,LineStyle.Solid,2);

sp.PieRadius = 2400;  // Scale up entire pie

sp.SetFillStyles(FillStyle.Dome);

sp.DrawPieChart(new int[]{1,1,1,1,1,1,1,1,1},corries);

Note that the entire pie is scaled to about 20 times normal size, as the radii are taken as percentages of standard, which would result in very tiny sectors here. The ‘dome’ style of radial gradient works well with Pie and Polar charts as it is always drawn radially from the centre of the entire chart.

Summary

Piecharts are best used as top-level summaries, showing quite small numbers of values. They often make a good starting point for a ‘drilldown’ process, where the user may click on each sector to get a more detailed picture of some aspect of company performance.

See also ...

DrawPieChart Method


SharpPlot 2.51 User Manual: Polar and Radar Charts

Polar and Radar Charts

The ‘Radar’ chart is logically similar to a Barchart, in that the given data is arranged at equal intervals. The difference is that the Radar chart arranges the values around a circle at equal angles, which is often a good way of comparing several sets of performance indicators.

The ‘Polar’ chart is simply a variant of the Linegraph where the y-values become radii and the x-values angles around a circle. It is typically used to plot data which has a natural cycle, for example daily temperatures or annual rainfall. It can also be used as a type of scatterplot, where the angles represent compass directions or times of day.

Comparing Features with a Radar Chart

This chart compares two fictional vehicles based on seven criteria which are plotted as radial lines.

sp.Heading = "Two Cars\nCompared";
sp.HeadingStyle = HeadingStyles.Left;

Volvo = new int[] {20,36,29,42,31,36,34};
Saab = new int[] {30,24,28,34,23,34,28};
criteria = new string[]{"Speed and handling","Fuel consumption",
         "Comfort and legroom","Reliability record","Safety",
         "Seating and luggage space","Service interval"};

sp.PolarChartStyle = PolarChartStyles.GridLines|PolarChartStyles.SurfaceShading;
sp.YAxisStyle = YAxisStyles.ForceZero;
sp.MarginLeft = 12;
sp.MarginRight = 0;
sp.SetXLabels(criteria);
sp.XLabelFormat = "XXXXXXXXX;";
sp.LabelLineSpacing = 120;

sp.SetFillStyles(FillStyle.Opacity30);

polardata = new int[][]{Volvo,Saab};
sp.DrawPolarChart(polardata,new int[0]);

The semi-transparent overlay makes it very easy to compare the ‘shapes’ which characterise the two sets of data.

Summarizing Directional Data

This is also a Radar chart, although it could have been plotted with additional angular values, if the directions were not equally spaced around the circle. It shows an alternative presentation to the Rose diagram of the corrie data from the Scottish highlands.

sp.Heading = "Frequency of Corrie Directions in Scotland";

corries = new int[] {6,7,5,3,3,2,3,5};

sp.PolarChartStyle = PolarChartStyles.Risers|PolarChartStyles.ArrowLines|
         PolarChartStyles.NoLines;
sp.HeadingStyle = HeadingStyles.Bottom;
sp.SetPenWidths(0.8);
sp.SetMargins(0);
sp.YAxisStyle = YAxisStyles.NoAxis|YAxisStyles.ForceZero;
sp.XAxisStyle = XAxisStyles.NoAxis;
sp.SetArrowStyle(6,30);  // Size,angle

sp.DrawPolarChart(corries);

Scaled markers could be used instead of arrows with this chart style to give an indication of average size as well as frequency of occurence. This is probably a more ‘honest’ chart than the equivalent Rose diagram, as it does not exaggerate the larger numbers in the same way.

ScatterPlot of the Night Sky

This is genuinely Polar data, so it is best plotted around a circle. The y-values are altitude (but of course 90 is at the Zenith) and the x-values give the direction of the observation.

altitude = new int[] {8,42,1,38,20,35,34,28,22,50,52,40,30,10,7,41,41,17,11,30,5,8,
         42,42,19,24,57,38,32,4,19,40,41,49};
azimuth = new int[] {48,42,55,63,48,51,75,41,32,51,51,38,48,57,35,54,23,70,54,40,55,
         38,69,70,64,35,69,37,77,80,33,47,45,25};

sp.PolarChartStyle = PolarChartStyles.Markers|PolarChartStyles.GridLines|
         PolarChartStyles.CompassPlot|PolarChartStyles.NoLines;
sp.YAxisStyle = YAxisStyles.ForceZero;
sp.Heading = "Meteors sighted\n18th Nov";
sp.HeadingStyle = HeadingStyles.Left;

sp.SetMargins(24,12,0,0);

sp.SetXLabels(new string[]{"North","NE","East","SE","South","SW","West","NW"});
sp.SetXTickMarks(45,3);
sp.SetYTickMarks(new int[] {0,30,60,90});
sp.SetXLabelFont("arial",8,FontStyle.Regular,Color.Maroon);
sp.SetYLabelFont("arial",8,FontStyle.Regular,Color.White);
sp.YAxisStyle = YAxisStyles.InvertAxis|YAxisStyles.InvisibleAxis;
sp.SetChartBackground(Color.Navy,FillStyle.Saturate80);
sp.LabelStyle = LabelStyles.Opaque;  // Background for circle - also May 03
sp.SetMarkers(Marker.Bullet);
sp.SetColors(Color.White);

sp.DrawPolarChart(altitude,azimuth);

This chart could also be used with daily data, for example a count web-site hits over 24 hours.

Circular Linegraph of Daily Temperatures

This chart copies the typical pen-recorder often seen in computer rooms to track tempterature and humidity.

sp.Heading = "Daily Temperatures\nin Iceland";
sp.HeadingStyle = HeadingStyles.Left;
sp.SetMargins(48,12,12,0);

times = new double[] {0.8,2.3,3.8,5.3,6.8,8.3,9.8,11.3,12.8,14.3,15.8,17.3,18.8,
         20.3,21.8,23.3};
temps = new double[] {4.4,4.4,4.4,4.8,4.4,4.4,4.8,5.6,6,6,6,6.4,6.4,6.8,6.4,6.4};

sp.SetYRange(0,8);
sp.SetYTickMarks(2);
sp.SetXTickMarks(3,2);

sp.YLabelFormat = "#0Â°";

sp.YCaption = "Deg C";
sp.SetColors(Color.Red);
sp.SetPenWidths(1.5);

sp.SetXZones(new Zone(10,17,Color.SkyBlue,FillStyle.Dome));

sp.PolarChartStyle = PolarChartStyles.ClockFace|PolarChartStyles.GridLines|
         PolarChartStyles.Curves|PolarChartStyles.HollowCenter;
sp.DrawPolarChart(temps,times);

The data values become radii, and time is plotted around the circle as a 24-hour clock – the x-tickmarks are given in hours here. X-zones may be used to indicate times of day.

Summary

The polar plot is a fairly special-purpose chart, but for some types of data it is the only good way to make a readable layout.

See also ...

DrawPolarChart Method


SharpPlot 2.51 User Manual: Response Surfaces

Response Surfaces

The response surface is generally used with computed data to show a mathematical function of two variables. It may be combined with other 3D charts (typically the cloud chart) to show a theoretical fit in addition to the raw data plotted in 3 dimensions.

A Simple Mesh Surface

The data is an array of arrays of nodes in the surface, which must be strictly rectangular. Each inner array is drawn parallel to the X-axis, working from front to back.

mesh = new int[][]{new int[]{8,7,6,5,4,3},new int[]{12,11,10,9,8,7},new int[]{16,15,
         14,13,12,11}};

sp.SetMargins(48,12,24,0);
sp.Heading = "Simple Mesh Surface";
sp.ResponsePlotStyle = ResponsePlotStyles.WallShading|ResponsePlotStyles.Markers;
sp.SetMarkers(Marker.Node);

sp.DrawResponsePlot(mesh);

Mesh with Given X and Y Co-ordinates

This has the same arrays for the mesh, but the nodes are placed explicitly in both X and Y directions, so the effect is to stretch the surface.

mesh = new int[][]{new int[]{8,7,6,5,4,3},new int[]{12,11,10,9,8,7},new int[]{16,15,
         14,13,12,11}};
xvalues = new int[] {8,10,16,20,26,48};
yvalues = new int[] {8,12,20};

sp.SetMargins(48,12,24,0);
sp.Heading = "Stretched Mesh Surface";
sp.ResponsePlotStyle = ResponsePlotStyles.WallShading|ResponsePlotStyles.Markers;
sp.SetMarkers(Marker.Ball);

sp.DrawResponsePlot(mesh,xvalues,yvalues);

Tiling Two Surfaces

Tiled surfaces are most effectively drawn with semi-transparent fill styles, to allow the axes and any data to show through.

mesh = new int[][]{new int[]{8,7,6,5,4,3},new int[]{12,11,10,9,8,7},new int[]{16,15,
         14,13,12,11}};

sp.SetMargins(48,12,24,0);
sp.Heading = "Tiled Surface with Contours";
sp.ResponsePlotStyle = ResponsePlotStyles.WallShading|ResponsePlotStyles.GridLines|
         ResponsePlotStyles.TiledSurface|ResponsePlotStyles.Contours;
sp.SetFillStyles(FillStyle.Opacity42);

sp.SetContourStyle(Color.Navy,LineStyle.Dash,1.5);

sp.DrawResponsePlot(mesh);

This example shows two intersecting planes, each drawn with 30% opacity.

Altitude Shading

If the mesh genuinely represents ‘altitude’ it can be shaded to represent the range of the Z-axis.

terrain = new int[][]{new int[]{50,49,50,49,48,50,49,50,49,47,45,45,43,40,40,36,35,
         33,34,31,30,32,35,36,38,39,42,42,42,45,49,49,50},new int[]{51,51,49,49,47,
         49,48,49,50,46,47,44,43,43,41,41,39,36,33,32,30,32,34,36,38,40,42,44,41,43,
         48,49,52},new int[]{54,49,48,49,49,49,47,47,49,49,48,44,42,44,44,44,41,37,
         34,34,32,33,33,37,40,41,44,42,42,42,44,47,52},new int[]{57,51,51,48,47,48,
         48,51,51,51,49,47,43,43,43,44,43,37,35,34,34,34,35,37,42,41,42,42,44,46,46,
         48,51},new int[]{57,54,51,48,47,51,52,52,53,52,49,46,44,45,46,43,42,41,37,
         36,36,36,39,40,41,42,42,44,45,47,48,48,49},new int[]{56,55,54,49,46,48,52,
         54,55,51,47,46,43,43,45,44,42,40,41,40,37,41,41,43,44,45,42,43,45,45,47,46,
         49},new int[]{55,54,54,49,44,48,50,53,54,49,46,44,42,41,43,43,44,42,43,39,
         38,43,45,47,49,46,44,46,45,45,46,47,47},new int[]{53,54,53,47,47,47,50,51,
         52,50,47,44,43,44,41,44,40,41,41,41,42,44,49,50,51,51,46,45,45,45,46,47,
         48},new int[]{52,50,50,49,46,49,49,51,52,49,46,45,43,44,42,41,40,39,40,43,
         46,49,51,54,55,52,49,49,47,46,46,47,49},new int[]{53,51,53,50,49,49,51,54,
         53,48,46,45,43,42,41,40,39,40,39,41,45,46,49,52,56,54,52,51,51,50,49,49,
         52},new int[]{52,53,55,52,52,52,53,54,55,48,44,42,42,42,39,37,37,38,40,41,
         44,45,48,52,55,56,55,54,52,52,52,54,56},new int[]{56,55,56,55,57,56,57,55,
         55,48,43,43,40,40,38,38,38,39,43,44,45,49,49,53,55,55,54,52,52,53,55,58,
         58},new int[]{58,57,57,61,62,59,58,54,52,47,44,42,40,39,40,39,36,40,43,46,
         48,51,52,54,54,55,53,54,53,54,58,60,60},new int[]{62,60,59,62,61,59,58,53,
         49,48,46,42,37,36,35,37,35,39,42,46,48,50,52,52,56,55,54,51,52,53,58,59,
         61},new int[]{66,65,61,61,60,58,57,53,49,48,47,41,36,34,33,32,33,37,39,42,
         46,48,51,53,54,55,54,54,51,53,56,59,61},new int[]{66,65,64,63,61,59,57,54,
         49,46,46,39,36,34,33,30,30,32,34,39,42,46,49,51,53,55,53,54,54,53,57,57,
         59},new int[]{68,67,63,64,64,60,58,54,51,49,43,38,34,33,30,28,27,31,31,35,
         40,41,45,48,51,51,54,54,54,55,58,58,59},new int[]{65,62,62,64,63,59,53,53,
         49,46,42,40,36,32,31,28,24,29,33,36,39,41,44,47,48,49,51,52,53,53,55,57,
         57},new int[]{61,63,63,62,60,56,52,49,48,45,44,38,35,33,31,27,24,28,33,36,
         37,40,43,44,47,47,50,49,50,52,51,54,55},new int[]{60,58,61,57,55,53,52,48,
         49,47,44,39,34,33,31,26,25,29,31,33,34,37,40,44,49,47,49,50,49,50,49,52,
         51},new int[]{57,56,57,53,51,51,49,49,49,44,43,37,34,30,28,26,25,30,32,33,
         32,34,37,41,47,48,49,48,47,47,49,49,48},new int[]{58,55,55,53,49,48,46,45,
         45,42,39,36,36,35,32,29,27,30,31,34,35,37,37,41,46,48,46,44,44,47,49,48,
         50},new int[]{56,55,52,49,45,44,43,43,44,40,36,38,37,36,34,30,28,28,30,32,
         37,38,39,43,46,43,42,44,43,46,47,48,49},new int[]{52,49,49,45,42,44,41,43,
         42,39,37,36,36,35,34,30,30,32,30,35,37,36,38,39,42,42,43,41,41,42,44,47,
         48},new int[]{48,47,45,43,40,41,41,41,39,38,36,34,35,34,35,33,30,31,33,34,
         37,35,36,36,39,40,41,40,39,40,41,42,46},new int[]{48,45,43,43,40,40,40,40,
         39,38,38,36,36,35,33,34,32,32,34,34,35,36,36,36,39,40,42,40,39,42,43,44,
         47},new int[]{48,43,42,40,39,40,38,38,38,37,38,38,37,35,33,35,35,36,36,35,
         34,33,35,37,39,42,43,44,43,43,43,46,49},new int[]{44,45,43,40,40,38,40,37,
         36,35,37,39,39,36,34,34,35,35,36,33,35,35,38,40,41,40,41,42,43,44,44,47,
         50},new int[]{43,43,44,42,39,40,40,37,35,34,36,38,38,39,37,36,34,34,34,33,
         33,37,39,40,41,42,41,42,44,44,46,49,52},new int[]{46,44,45,43,41,41,38,37,
         36,37,36,37,35,36,35,35,34,34,35,34,37,38,37,40,41,40,41,41,40,43,47,51,
         52},new int[]{47,44,44,44,44,42,38,36,36,37,36,34,35,36,35,34,34,34,34,35,
         37,38,38,39,40,42,41,39,38,42,48,49,52},new int[]{48,47,47,43,42,40,40,38,
         39,37,36,36,36,34,35,35,34,34,35,37,35,37,35,35,37,38,38,37,36,39,46,47,
         50},new int[]{50,50,47,45,42,44,43,40,39,40,38,36,36,36,35,35,37,35,37,35,
         35,36,36,33,33,36,36,35,36,37,41,47,50}};

sp.SetMargins(48,12,24,0);
sp.Heading = "Altitude-shaded Terrain";
sp.ResponsePlotStyle = ResponsePlotStyles.WallShading|
         ResponsePlotStyles.TiledSurface|ResponsePlotStyles.AltitudeShading;
sp.XAxisStyle = XAxisStyles.PlainAxis;
sp.YAxisStyle = YAxisStyles.PlainAxis;

sp.SetFillStyles(FillStyle.Opacity66);
sp.SetColors(Color.ForestGreen);

sp.DrawResponsePlot(terrain);

This works very well with this style of generated fractal landscape.

Summary

The response plot can be a very good way to visualise a computed surface in 3 dimensions.

See also ...

DrawResponsePlot Method


SharpPlot 2.51 User Manual: Scatter Plots for discrete XY data

Scatter Plots for discrete XY data

The scatterplot (or scatter diagram) is almost always the first step in analysing any collection of data. Typically you are trying ti isolate one or more causes, in the attempt to predict some effect. These examples all use some data on house-prices, with the idea of being able to predict the price of any house given its type and floor area.

A Simple Scatter of 2 Variables

The first step is simply to plot the price against most likely cause (floor area) as a simple xy plot:

area = new int[] {1326,782,312,1460,1056,752,1120,904,1654,735,565,346,698,775,696,
         741,432,517,747,914,603,1292,551,1383,1580,754,850,518,634};
price = new int[] {60500,47500,46000,110000,148000,65000,79950,54000,120000,85000,
         65000,55000,70000,82500,78500,49950,46950,46950,77000,102000,37500,68000,
         65000,145000,98000,75000,96500,53950,75000};

sp.Heading = "Does Area Affect Price?";
sp.YAxisStyle = YAxisStyles.AtEndCaption;
sp.YCaption = "Price\n(Â£Thou)";
sp.YFactor = 1000;
sp.XCaption = "Floor Area (sq ft)";

sp.DrawScatterPlot(price,area);

So there is a relationship here, but there is also a lot of apparently random noise.

Using a Quadratic Model

The second example shows a ‘best fit’ model, assuming that there may be a quadratic relationship between floor area and price:

sp.Heading = "How Does Area Affect Price?";
sp.YAxisStyle = YAxisStyles.AtEndCaption;
sp.YCaption = "Price\n(Â£Thou)";
sp.YFactor = 1000;
sp.XCaption = "Floor Area (sq ft)";

sp.SetMarkers(Marker.Bullet);

sp.ScatterPlotStyle = ScatterPlotStyles.ModelFit|ScatterPlotStyles.GridLines|
         ScatterPlotStyles.ExplodeAxes;
sp.SetOrderOfFit(2);
sp.EquationFormat = "Price = C0 + C1Ã—area + C2Ã—areaÂ²";

sp.DrawScatterPlot(price,area);

sp.SetKeyText(sp.Equation);

The equation has been formatted, and used as the text for the key. Note that you cannot retrieve the equation of coefficients until after the plot has been run – this is one of the few places in SharpPlot where the order of the commands is crucial!

Using Logarithmic Axes

This example shows one obvious way of transforming the data, by making both X and Y axes logarithmic.

sp.Heading = "Maybe Logs would help?";
sp.YCaption = "Price\n(Â£Thou)";
sp.XCaption = "Floor Area (sq ft)";

sp.YAxisStyle = YAxisStyles.LogScale|YAxisStyles.AtEndCaption;
sp.XAxisStyle = XAxisStyles.LogScale;

sp.ScatterPlotStyle = ScatterPlotStyles.GridLines;

sp.DrawScatterPlot(price,area);

Transforming, scaling or shifting the data is often an essential part of helping to see patterns. However it made very little difference in this particular example!

Adding Another Dimension

Maybe the type of house is an important factor here?

Suddenly, this makes the prediction a lot more reliable. We can see that for terrace houses (the grey squares) the relationship between area and price is quite linear and has very little scatter. Semi-detached houses all cluster at the left-hand end, apart from one huge one which we may want to disregard, as being very atypical. Detached houses follow a different model entirely, and bungalows are apparently more sensitive to area, but we have very little data for them.

sp.Heading = "Split by House Type";
sp.YAxisStyle = YAxisStyles.AtEndCaption;
sp.YCaption = "Price\n(Â£Thou)";
sp.YFactor = 1000;
sp.XCaption = "Floor Area (sq ft)";

housetype = new int[] {1,2,2,3,3,2,1,1,2,4,4,1,2,2,3,2,1,1,2,3,1,1,4,3,1,2,2,2,4};
sp.SplitBy(housetype);

sp.ScatterPlotStyle = ScatterPlotStyles.ModelFit;
sp.EquationStyle = EquationStyles.SpanData;
sp.SetMarkers(new Marker[]{Marker.Block,Marker.Lozenge,Marker.Triangle,Marker.Bullet});
sp.SetColors(new Color[]{Color.Gray,Color.Gray,Color.Firebrick,Color.Firebrick,
         Color.Navy,Color.Navy,Color.ForestGreen,Color.ForestGreen});
sp.SetLineStyles(LineStyle.Dash);
sp.SetPenWidths(1.2);

sp.DrawScatterPlot(price,area);

sp.SetKeyText(new string[]{"Terrace","","Semi","","Detached","","Bungalow"});

Note the ‘placeholder’ entries in the key text here. SharpPlot adds a key placeholder for each series and for each modelfit (or trendline) added to it. This allows you to add specific legends to describe the model as well as to annotate each marker. However in this case the model is ‘obvious’ and we just have empty strings for the alternate entries in the legend.

This is also the reason why the color cycle is preset with pair of matching colors – the marker takes the first of the pair and the line takes the second.

Summary

By plotting the raw data, and trying a few splits on different dimensions, you can usually begin to understand the relationships involved. SharpPlot provides some simple tools for adding fitted models and showing the user the resulting equation.

See also ...

Bubble Charts for discrete XYZ data | Contour Plots for XYZ interpolation


SharpPlot 2.51 User Manual: Step Charts for discontinuous data

Step Charts for discontinuous data

Step charts are used for two main chart-types. They are a very convenient way of plotting a timeseries where there may be an instantaneous change between values, which then stay fixed for some time – government interest-rates are typical. Filled stepcharts work well in combination with Barcharts, and they can also be used instead of the Histogram where data has been aggregated into categories of varying widths.

A Simple Stepchart

This chart-type is unusual in that the x-data typically has one more value than the y-data, giving the endpoint of the final plateau in the data.

ydata = new int[] {4,8,12,6};
steps = new int[] {1,5,7,9,14};

sp.YAxisStyle = YAxisStyles.ForceZero;
sp.Heading = "Simple Stepchart";

sp.DrawStepChart(ydata,steps);

Rainfall Totals by Month

The Stepchart is ideal for showing aggregated data where the groups have varying widths (in this case the months are quite similar, but we should still be honest about February). Monthly totals are written using value-tags on the top of each block.

months = new int[] {0,31,59,90,120,151,181,212,243,273,304,334,365};
monthnames = new string[]{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep",
         "Oct","Nov","Dec"};
rudland = new int[] {50,67,55,103,23,95,46,61,139,98,70,87};

sp.StepChartStyle = StepChartStyles.SurfaceShading|StepChartStyles.ValueTags;
sp.SetXTickMarks(months);
sp.XAxisStyle = XAxisStyles.MiddleLabels;
sp.SetXLabels(monthnames);
sp.YAxisStyle = YAxisStyles.AtEndCaption;
sp.YCaption = "mm";

sp.SetFillStyles(FillStyle.GradientBottom);

sp.DrawStepChart(rudland,months);

Note that the month boundaries have been used for the step-points and also to set the tick-marks for the X-axis.

A Discontinuous Timeseries

This chart shows the values of the UK bank-rate over the last eight years.

sp.SetPenWidths(2.5);
sp.SetColors(Color.Orange);

sp.Heading = "UK interest rates (%)";
sp.HeadingStyle = HeadingStyles.Left;
sp.SetHeadingFont("arial",16,FontStyle.Bold,Color.Black);
sp.XAxisStyle = XAxisStyles.AnnualTicks|XAxisStyles.MiddleLabels|XAxisStyles.Clipped;
sp.YAxisStyle = YAxisStyles.GridLines|YAxisStyles.InvisibleAxis;
sp.YLabelFormat = "#.00";
sp.SetYRange(3,7.5);

changedates = new int[] {35582,35582,35612,35643,35726,35947,36130,36141,36160,
         36165,36192,36231,36323,36415,36495,36537,36568,36923,36951,36993,37105,
         37151,37169,37204,37658,37812,37929,38023,38113,38141,38148,38205,38387,
         38568,38580};
baserate = new double[] {6.25,6.5,6.75,7,7.25,7.5,7.25,6.75,6.25,6,5.5,5.25,5,5.25,
         5.5,5.75,6,5.75,5.5,5.25,5,4.75,4.5,4,3.75,3.5,3.75,4,4.25,4.25,4.5,4.75,
         4.75,4.5,4.5};

sp.DrawStepChart(baserate,changedates);

Note that the dates have been given in OLE-date format and the X-axis style is ‘Annual’ to have tickmarks placed at the year boundaries.

Budget as a Backcloth

This example combines a Stepchart with a standard Barchart to show the annual budget as a backdrop to the actual sales figures by month. In this case, the months all have a ‘notional’ width so no x-axis need be given for the steps.

budget = new int[] {1,3,7,6,9,8,9,7,9,10,7,5,5};
actual = new int[] {-1,2,9,5,8,9,8,6,7,9,6,9};

sp.Heading = "Sales in 2004";
sp.HeadingStyle = HeadingStyles.Left;

sp.SetColors(new Color[]{Color.Green,Color.Navy});
sp.SetFillStyles(new FillStyle[]{FillStyle.Halftone,FillStyle.GradientBottom});

sp.SetYRange(-3,10);
sp.Baseline = 0;

sp.XAxisStyle = XAxisStyles.MiddleLabels;
sp.SetXLabels(monthnames);

sp.StepChartStyle = StepChartStyles.SurfaceShading;

sp.DrawStepChart(budget);  // see Stepsuite

sp.DrawBarChart(actual);

sp.SetKeyText(new string[]{"Budget","Actual performance"});
sp.KeyStyle = KeyStyles.TopAlign|KeyStyles.RightAlign|KeyStyles.Boxed|KeyStyles.Rounded;

Note the use of a ‘baseline’ here to have the shading and bars drawn outwards from the zero-line rather than from the X-axis. The chart has been given an explicit Y-range to allow space for the extremes from both series.

Summary

The Stepchart may be used on its own, but is often most useful in combination with other chart types.

See also ...

DrawStepChart Method


SharpPlot 2.51 User Manual: Tabulating data

Tabulating data

SharpPlot can tabulate as well as chart, but please be aware that these tables are not designed to display large amounts of complex data. They are for summaries and simple CrossTabs where a limited amount of data can be used to augment a complex chart. The examples show a table used as a chart in its own right, and some simple summaries and groupings added as ‘notes’ to typical timeseries data.

A Simple Data Table

SharpPlot treats each array-element in the argument as a column of data, and uses the X-labels as the column headers, with the Y-labels as the row-stubs. The Y-caption is used here to label the cell in the top-left corner.

column1 = new int[] {18,27,31,1,1};
column2 = new int[] {120,34,27,18,8};

sp.SetYLabels(new string[]{"North","South","East","West","Other"});
sp.SetXLabels(new string[]{"2004","2005"});

sp.YCaption = "Regional\nTotals";

sp.TableStyle = TableStyles.Boxed|TableStyles.GridLines|TableStyles.Shadowed;
sp.SetValueFont("ARB",12);
sp.ValueTagFormat = "##0.0";
sp.SetLabelFont("ARB",13);
sp.SetCaptionFont("ARB",13);

sp.DrawTable(new int[][]{column1,column2});

If a simple array of numbers is passed, it is treated as a one-column table.

Average Price by House Type

This example adds a table of average prices to the house-price data used in the ScatterPlot tutorials. Another good use of a summary table would be to show the ‘count’ as a table to allow a quick check on the number of houses in each sample.

price = new int[] {60500,47500,46000,110000,148000,65000,79950,54000,120000,85000,
         65000,55000,70000,82500,78500,49950,46950,46950,77000,102000,37500,68000,
         65000,145000,98000,75000,96500,53950,75000};
area = new int[] {1326,782,312,1460,1056,752,1120,904,1654,735,565,346,698,775,696,
         741,432,517,747,914,603,1292,551,1383,1580,754,850,518,634};
housetype = new int[] {1,2,2,3,3,2,1,1,2,4,4,1,2,2,3,2,1,1,2,3,1,1,4,3,1,2,2,2,4};

sp.Heading = "Price vs Floor Area";
sp.HeadingStyle = HeadingStyles.Right;
sp.YLabelFormat = "Â£##,###,##0";

sp.DrawScatterPlot(price,area);

sp.GroupBy(housetype,new string[]{"Terrace","Semi-Detached","Detached","Bungalow"},
         GroupByFunction.Average);
sp.SetXLabels("Average\nPrice");
sp.YCaption = "House type";

sp.TableStyle = TableStyles.Boxed|TableStyles.GridLines|TableStyles.Opaque;
sp.ValueTagFormat = "Â£##,###,##0";

sp.SetTablePosition(350,180000);
sp.DrawTable(price);

Note that the table is placed using the axis co-ordinates here. It can also be placed with absolute co-ordinates (given in points) and the table-width may be given as an optional 3rd argument to scale the table to fit the available space.

Creating a CrossTab from the Barley Data

The barley-yield data from the Boxplot tutorial is a good candidate for a Cross-tab. The two methods that do this are GroupBy (to collect data into the rows) and SplitBy to spread the values across the columns.

sp.Heading = "Barley Crosstab";

sp.SplitBy(_barleyfarm);
sp.GroupBy(_barleyvariety,GroupByFunction.Average);

sp.TableStyle = TableStyles.GridLines;
sp.XLabelFormat = "xxxxxxxxx;";

sp.YCaption = "Average Yield";

sp.ValueTagFormat = "##0.00";
sp.ValueTagStyle = ValueTagStyles.Center;

sp.DrawTable(_barleydata);

Here it has been summarised by Variety and categorised by Year as a 2-way table. You can summarize or split by up to 2 levels here to create more complex tabulations.

Cross-tabulation with Two Levels

This example shows the same data, but split 2 ways to make a heirarchical summary. Note that a frame has already been drawn here (with the main chart heading) and the table is fitted automatically into the frame width.

sp.Heading = "Complete Barley Data Tabulation";
sp.SetMargins(36,0,0,0);
sp.DrawFrame();

sp.SplitBy(_barleyfarm);
sp.SplitBy(_barleyyear);
sp.GroupBy(_barleyvariety);

sp.TableStyle = TableStyles.GridLines|TableStyles.Spanned|TableStyles.FitWidth;
sp.YCaption = "Yield by\nVariety";
sp.ValueTagFormat = "##0.0kg";  // Formatter
sp.ValueTagStyle = ValueTagStyles.Center;

sp.DrawTable(_barleydata);

You can also add an extra level of Grouping to have an indented 2-level summary shown in the row-stubs.

Summary

Tables may be used on their own to provide summary information, or in combination with other charts as structured notes.

See also ...

DrawTable Method


SharpPlot 2.51 User Manual: Tower Charts for 3D bars

Tower Charts for 3D bars

Towercharts are good for visual impact, but are rarely an effective way to present numbers where the values are important. These examples parallel some of the examples in the tutorial on tables, as a Towerchart is really just a simple way to present a two-way tabulation in visual form.

A Simple Towerchart from Arrays of Data

SharpPlot expects the data as an array of arrays of values – each inner array is plotted parallel to the X-axis and they work back towards the backplane. This means that they are best drawn with the smaller values in the earlier arrays, each of which is itself arranged from larger to smaller values – this way the towers are less likely to hide each other.

towers = new int[][]{new int[]{8,7,6,5},new int[]{12,11,10,9},new int[]{16,15,14,13}};

sp.SetMargins(48,12,24,0);

sp.Heading = "Simple Towerchart";
sp.SetXLabels(new string[]{"North","South","East","West"});
sp.SetYLabels(new string[]{"Coats","Hats","Scarves"});

sp.TowerChartStyle = TowerChartStyles.WallShading;

sp.DrawTowerChart(towers);

Note that both the X and Y axes simply display the towers in sequence – there is no equivalent of XBarchart available here to allow towers to be placed in specific places on the XY grid. The axes will be automatically labelled with the tower number unless you give your own labels (as here).

Using Towers to Summarise Data

This example displays a one-way summary in a style very like the Excel Column chart. The perspective drawing has been turned off here to give the effect of an isometric projection.

housetype = new int[] {1,2,2,3,3,2,1,1,2,4,4,1,2,2,3,2,1,1,2,3,1,1,4,3,1,2,2,2,4};
price = new int[] {60500,47500,46000,110000,148000,65000,79950,54000,120000,85000,
         65000,55000,70000,82500,78500,49950,46950,46950,77000,102000,37500,68000,
         65000,145000,98000,75000,96500,53950,75000};

sp.Heading = "Maximum Price by House Type";

sp.GroupBy(housetype,GroupByFunction.Maximum);
sp.SetXLabels(new string[]{"Terrace","Semi","Detached","Bungalow"});

// Force isometric and horizontal X-Axis
sp.SetViewpoint(8,0,80);
sp.Perspective = 0;

sp.TowerChartStyle = TowerChartStyles.WallShading|TowerChartStyles.GridLines;

sp.ZFactor = 1000;
sp.ZCaption = "Â£Thousand";
sp.ZAxisStyle = ZAxisStyles.AtEndCaption;
sp.DrawTowerChart(price);

Note that the X-axis labels have been explicitly set here – for text categories they would be automatically created as the distinct elements in the group.

Two-way Summary shown as Towers

You can think of a Towerchart as a grouped barchart, with the splitting working away from the X-axis, rather than into collections of narrow bars.

region = new string[]{"North","North","North","North","South","South","South",
         "South","South","South","South","South"};
regions = new string[]{"South","North"};

month = new string[]{"Jan","Mar","May","Aug","Jan","Feb","Mar","May","Jun","Jul","Oct","Dec"};
sales = new int[] {3,4,3,5,4,2,5,4,3,5,4,1};
months = new string[]{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct",
         "Nov","Dec"};

sp.Heading = "Total Monthly Sales by Region";
sp.GroupBy(month,months);  // Sum is default
sp.SplitBy(region,regions);

sp.XAxisStyle = XAxisStyles.AngledLabels;
sp.YAxisStyle = YAxisStyles.AngledLabels;

sp.TowerChartStyle = TowerChartStyles.WallShading|TowerChartStyles.GridLines;
sp.DrawTowerChart(sales);

Towers are normally drawn with relatively few parallel sets of columns, so it is generally best to have the category with most entries as the ‘groups’ and the one with fewer entries as the ‘split’.

Adding Visual Pizzazz

This final chart shows some simple effects with gradient fills which can be used to add that ‘designer’ look to the chart.

towers = new int[][]{new int[]{8,7,6},new int[]{12,11,10},new int[]{16,15,14},
         new int[]{21,18,15}};

sp.SetMargins(12,6,18,0);

sp.TowerChartStyle = TowerChartStyles.WallShading|TowerChartStyles.GridLines|
         TowerChartStyles.Plain;
sp.ZAxisStyle = ZAxisStyles.ForceZero;

sp.SetTowerFillStyles(FillStyle.Saturate20,FillStyle.GradientBottomRight,FillStyle.Solid);
sp.SetWallFillStyles(FillStyle.GradientBottomRight,FillStyle.GradientBottomLeft,
         FillStyle.GradientTopLeft);
sp.SetViewpoint(22,15,50);

sp.TowerAspect = 2;
sp.BarEdgeNib = 0;

sp.DrawTowerChart(towers);

For charts rendered as vector graphics (SVG, VML etc) this adds very little to the size of the output file. For images (such as PNG) it will greatly increase the file size as the image compression will find very few areas of solid color.

Summary

The Towerchart is a good presentational tool for small amounts of data which falls naturally into categories. It is often necessary to arrange the categories to put the bigger towers at the back, as it is very easy to obscure data otherwise.

See also ...

DrawTowerChart Method


SharpPlot 2.51 User Manual: Trace Charts for multiple series

Trace Charts for multiple series

Trace charts (or ECG plots) are often a convenient way to add an extra dimension to a two-dimensional chart. They are similar in principle to the small multiple, but save a lot of redundant ink when all the series share the same X-axis. Trace-charts are also used as a simple way to draw Kite Diagrams, which are a common graphical tool for botanical field studies.

Several Parallel Timeseries

This chart takes the ‘delta’ of three popular stock prices and shows the daily volatility of each. Note that both BP and the Halifax Bank show the spike around day-50 (the invasion of Iraq) but Kelda (a utility stock) was completely unaffected.

sp.Heading = "Daily Volatility of 3 Stock Prices";

bp = VectorMath.Difference(new int[] {427,428,427,429,424,418,420,424,416,410,406,
         409,403,395,389,380,374,369,356,362,383,383,382,393,386,398,382,379,380,
         394,385,381,388,396,404,393,400,413,417,414,402,400,400,408,408,406,405,
         395,392,395,371,392,400,415,413,414,417,428,416,422,429,416,414,401,416,
         406,407,416,421,411,412,406,405,408,414,407,408,414,412,406,395,403,400,
         397,395,405,411,414,408,416,416,407,413,414,408,414,410,418,415,424,428,
         424,418,428,430,436,430,430,429,432,439,446,439,438,433,438,429,434,431,
         428,424,420,424,420,412,412,410,412,418,414,410,404,407,410,404,405,411,
         415,415,419,419,423,416,423,420,423,426,422,428,421,425,436,442,439,433,
         440,436,442,437,435,432,436,437,429,437,448,448,442,450,442,441,443,439,
         436,440,438,429,422,423,419,423,426,415,415,413,422,420,429,432,432,430,
         435,434,442,435,433,426,426,425,421});
kelda = VectorMath.Difference(new int[] {424,420,418,421,429,440,426,427,419,413,
         415,421,428,428,424,429,411,408,399,403,400,400,402,404,404,412,416,411,
         421,426,423,420,413,419,418,423,428,428,437,434,424,416,410,426,422,422,
         420,410,411,414,408,413,404,409,408,401,408,400,390,381,407,412,410,410,
         408,425,413,415,418,419,420,416,419,425,423,419,422,425,424,416,411,411,
         414,411,408,412,416,415,408,414,419,421,426,430,420,432,425,437,436,437,
         445,436,434,440,440,436,438,435,433,430,427,427,428,429,433,426,428,426,
         423,430,432,426,424,427,430,427,428,427,429,430,426,429,430,430,430,428,
         431,429,430,442,440,442,441,435,435,439,441,440,442,436,438,429,432,432,
         436,438,438,437,443,442,419,419,412,410,404,410,408,406,408,409,412,413,
         414,415,418,418,420,416,420,431,429,435,429,425,423,428,423,424,428,430,
         428,428,423,428,426,426,423,425,427,430});
hbos = VectorMath.Difference(new int[] {655,672,665,659,642,639,638,647,638,647,627,
         629,618,602,589,574,558,578,563,549,538,556,551,589,567,592,581,592,566,
         581,589,600,590,616,619,600,602,596,589,621,638,625,662,668,660,651,651,
         626,608,612,563,598,626,641,652,668,654,690,675,674,684,670,659,650,663,
         672,688,690,720,700,698,691,694,714,737,716,722,739,749,738,726,744,740,
         733,713,737,725,706,707,702,694,699,714,728,715,718,714,708,690,694,721,
         735,723,740,744,750,747,760,762,760,787,790,791,792,806,812,789,805,795,
         806,807,804,793,784,772,785,781,774,793,800,778,766,780,794,796,772,766,
         762,751,765,768,786,786,798,795,792,775,772,769,752,748,748,754,746,733,
         744,750,747,728,717,716,721,718,704,722,730,725,717,722,732,730,717,716,
         720,732,737,738,717,708,718,705,698,692,694,688,716,724,724,716,720,715,
         727,736,750,748,744,735,736,742,740});

sp.YAxisStyle = YAxisStyles.GridLines;
sp.IAxisStyle = IAxisStyles.PlainAxis;

sp.SetYLabels(new string[]{"Kelda","BP","HBOS"});
sp.IAllowance = 1.5;
sp.IIntercept = 0;

trace = new int[][]{kelda,bp,hbos};
sp.DrawTraceChart(trace);

If the series tend to move very closely together, you can set the Inner-axis range to quite a big number (say 1.8) to allow each series to stray into the band occupied by its neighbours. This would be typical of a multiple pen-plotter such as a seismograph.

Inventory Projection for a Tank Farm

An excellent use of the trace-chart is to show the inventory of various liquids as they move through some production process. This gives a very clear picture of what materials are available at each production stage.

sp.Heading = "Inventory in Processing Vessels";

raw = VectorMath.RunningTotal(new int[] {0,0,0,0,1,1,1,1,0,0,0,0,-1,-1,-1,0,0,0,0,1,
         1,1,1,1,0,0,0,0});
part = VectorMath.RunningTotal(new int[] {4,0,0,0,-1,-1,-1,0,0,0,0,0,1,1,1,0,0,0,0,
         1,1,1,0,0,-1,-1,-1,0});
done = VectorMath.RunningTotal(new int[] {2,0,0,0,1,1,1,0,0,0,0,0,-1,0,-1,-1,-1,0,0,
         0,0,0,0,0,1,1,1,0});

sp.IIntercept = 0;
sp.TraceChartStyle = TraceChartStyles.SurfaceShading;

sp.SetYLabels(new string[]{"Raw","Part\nDone","Finished"});
sp.SetXTickMarks(1);

sp.XAxisStyle = XAxisStyles.ArrowedAxis|XAxisStyles.CenteredCaption;
sp.XCaption = "Days forward from today";

sp.YCaption = "Vessel";
sp.YAxisStyle = YAxisStyles.AtEndCaption;

sp.SetFillStyles(FillStyle.GradientBottom);

trace = new int[][]{raw,part,done};
sp.DrawTraceChart(trace);

This variant of the chart is normally surface-shaded and scaled from ‘empty’ to ‘full’ for each vessel. The example would be a typical display from a production-planning system where the planner was scheduling the processes which moved liquids bwteen the various vessels.

The Kite Diagram

This is a very special-purpose chart, which is simply a reflected version of the surface-filled plot.

sp.Heading = "Sample Kite Chart";

oak = new int[] {0,0,1,2,2,3,3,3,2,1,1,0};
ash = new int[] {0,0,0,0,1,1,1,0,0,0,0,0};
birch = new int[] {0,1,1,1,2,2,2,2,2,2,1,1};
hazel = new int[] {0,1,1,2,2,2,1,0,0,0,0,0};

sp.YCaption = "Species\nobserved";
sp.YAxisStyle = YAxisStyles.AtEndCaption|YAxisStyles.GridLines;
sp.SetYLabels(new string[]{"Oak","Ash","Birch","Hazel"});
sp.XCaption = "Metres\nfrom\nShore";
sp.XAxisStyle = XAxisStyles.AtEndCaption|XAxisStyles.ArrowedAxis;
sp.MarginRight = 48;
sp.TraceChartStyle = TraceChartStyles.KiteDiagram;

sp.SetFillStyles(new FillStyle("25+#CCCC00"));  // NB - #.FillStyle.GradientRight + Orange
sp.SetColors(Color.ForestGreen);

trace = new int[][]{oak,ash,birch,hazel};
sp.DrawTraceChart(trace);

It is commonly used to show vegetation coverage or the results of a pollen analysis. The example shows a count of some common tree-species as we walk inland from a lake-shore into the forest.

Adding Categories

All styles of Tracechart can categorise data by cycling through colors of fill-styles.

sycamore = new int[] {0,0,0,0,0,0,0,1,2,2,2,2};
chestnut = new int[] {0,1,1,1,2,3,3,3,3,2,1,0};

sp.YCaption = "Species";
sp.YAxisStyle = YAxisStyles.AtEndCaption|YAxisStyles.GridLines;
sp.SetYLabels(new string[]{"Oak","Ash","Birch","Hazel","Sycamore","Horse Chestnut"});

sp.XAxisStyle = XAxisStyles.ArrowedAxis;
sp.YLabelFormat = "XXXXXXXX;";
sp.MarginLeft = 48;

sp.TraceChartStyle = TraceChartStyles.KiteDiagram;
sp.IAxisStyle = IAxisStyles.PlainAxis;
sp.SetFillStyles(FillStyle.Saturate80);

sp.KeyStyle = KeyStyles.Boxed|KeyStyles.Shadowed;
native = new string[]{"Native","Native","Native","Native","Alien","Alien"};
sp.SplitBy(native);

sp.SetColors(new Color[]{Color.Green,Color.OrangeRed});
sp.SetLineStyles(LineStyle.Solid);

trace = new int[][]{oak,ash,birch,hazel,sycamore,chestnut};
sp.DrawTraceChart(trace);

The example chooses to segregate two types of tree species.

Summary

Trace charts are a surprisingly versatile way of showing a high density of information on a single chart. They are worth considering as alternatives to the standard Linegraph whenever there are many series to be compared.

See also ...

DrawTraceChart Method


SharpPlot 2.51 User Manual: Triangle Plots for proportions

Triangle Plots for proportions

The Triangle chart is used to analyse data where there are three important constituents, summing to unity. It is common in Geology and Chemical Engineering where a set of 3 key ingredients determines the outcome from some process.

Plotting the Proportions of 3 values

alpha = new int[] {2,3,3};
bravo = new int[] {3,2,2};
charlie = new int[] {4,4,1};

sp.SetMargins(64,18,0,0);
sp.Heading = "Proportions for 3 Samples";
sp.Subheading = "Requires 3 sets of values as equal-length vectors";

sp.TriangleStyle = (TriangleStyles.Markers|TriangleStyles.Labelled|TriangleStyles.ValueTags|TriangleStyles.GridLines);
sp.XCaption = "Alpha";
sp.YCaption = "Bravo";
sp.ZCaption = "Charlie";
sp.SetValueTags(new string[]{"S1","S2","S3"});
sp.SetMarkers(Marker.Bullet);

sp.DrawTriangle(alpha,bravo,charlie);

This chart shows the proportions of 3 constituents found in samples S1,S2 and S3. The allocation of series to chart axes is entirely arbitrary – the convention used is to work around clockwise from 12:00.

The natural data structure for this chart is a 3-column matrix, but an array of 3 data arrays (of equal lengths) is accepted.

Illustrating a Danger Zone

methane = new int[] {2,3,3,2,2};
oxygen = new int[] {3,2,2,4,3};
nitrogen = new int[] {4,4,2,2,4};

sp.SetMargins(42,12,0,0);
sp.Heading = "Explosive Mixtures";

sp.SetPenWidths(1.2);
sp.SetColors(Color.Red);
sp.SetFillStyles(FillStyle.Opacity18);

sp.TriangleStyle = (TriangleStyles.Lines|TriangleStyles.Curves|TriangleStyles.Labelled|
                    TriangleStyles.ValueTags|TriangleStyles.GridLines|TriangleStyles.Percentage|
                    TriangleStyles.Filled|TriangleStyles.SideCaptions);

sp.SetChartBackground(ColorTranslator.FromHtml("#B4C287"),FillStyle.Solid,0);
sp.SetGridLineStyle(Color.White,LineStyle.Solid,0.12);
sp.Flexibility = 12;

sp.XCaption = "Methane";
sp.YCaption = "Oxygen";
sp.ZCaption = "Nitrogen";

sp.SetValueTags(new string[]{"","Danger Area"});
sp.ValueTagStyle = (ValueTagStyles.Inside|ValueTagStyles.Opaque);

sp.DrawTriangle(new int[][]{methane,oxygen,nitrogen});

This is very typical of charts used in the chemical and oil industry, where certain combinations are either desirable or dangerous. Typically a chart such as this would be used as a basis, over which to plot a set of samples.

Note the use of ValueTags (only one is non-null) to label the outline.

See also ...

DrawTriangle Method


SharpPlot 2.51 User Manual: Vector Fields and Directed Graphs

Vector Fields and Directed Graphs

This style of plot can be used in two very different ways, to show either directed graphs, or to plot vector fields as a scatter diagram. The examples illustrate both of these.

Plotting a Vector Field

This style of chart is common in oceanography or weather-forecasting. The first (xy) pair is used to plot the location of the reading, and the offset to the second pair represents the direction and value of some measured quantity like windspeed or current flow.

x1 = new int[] {77,25,43,42,93,32,81,14,64,4,71,98,22,51,89,53,24,22,55,45,48,50,59};
y1 = new int[] {17,48,55,24,52,74,31,98,70,63,63,43,7,33,72,55,81,91,83,82,65,62,89};
x2 = new int[] {93,31,51,50,114,40,99,19,78,7,86,121,28,62,108,65,30,28,67,56,58,62,72};
y2 = new int[] {24,57,65,31,63,85,41,110,83,75,75,53,12,42,84,67,93,103,97,96,78,74,101};

sp.Heading = "Map of Current Flow";
sp.VectorStyle = VectorStyles.ArrowLines;
sp.DrawVectors(new int[][]{x1,y1,x2,y2});

Typically the lines have arrowheads to indicate the flow direction. This chart can also be used for any kind of vector field, for example to show the slope at any point on a landscape.

Labelling the Vectors

This example adds value-tags to each vector (giving the length of the line) and shows the ‘root’ of each line as well as the length and direction.

sp.Heading = "Wind Direction and strength";
sp.VectorStyle = VectorStyles.Rooted|VectorStyles.ValueTags|VectorStyles.ArrowLines;
sp.ValueTagFormat = "##0";
sp.SetMarkers(Marker.Bullet);

sp.DrawVectors(new int[][]{x1,y1,x2,y2});

In most cases, you would set your own value data here as the scaling of the lines is generally quite arbitrary.

Simple Connected Graph

This chart can easily be used to draw simple diagrams, typically representing connected tasks, such as an assembly process.

// Links as 4 arrays
x1 = new int[] {1,1,1,2,2,2,2,3,3};
y1 = new int[] {1,2,2,1,2,2,3,2,3};
x2 = new int[] {2,2,2,3,3,3,3,4,4};
y2 = new int[] {1,2,3,2,2,3,3,2,2};

sp.SetPenWidths(1.4);
sp.SetMarkerScales(2);
sp.SetMarkers(Marker.Bullet);
sp.VectorStyle = VectorStyles.Terminated|VectorStyles.Rooted|VectorStyles.NoAxes;

sp.DrawVectors(new int[][]{x1,y1,x2,y2});

Alternatively, a ScatterPlot could be used to draw the nodes, and the Vector chart simply to add the map of connections.

Drawing a PERT Chart

The final example assumes that the arrows represent activities of some kind, and the diagram as a whole illustrates a project plan where activities must be carried out in the correct order.

// Nodes as two arrays
x = new int[] {1,2,1,2,3,2,3,2};
y = new int[] {1,1,2,2,2,3,3,4};

// Links as 4 arrays
x1 = new int[] {1,1,1,2,2,2,2,3,3,2};
y1 = new int[] {1,2,2,1,2,2,3,2,3,1};
x2 = new int[] {2,2,2,3,3,3,3,4,4,1};
y2 = new int[] {1,2,3,2,2,3,3,2,2,1};

sp.SetMargins(60,12,12,12);
sp.Heading = "PERT Chart with Labelled Activities";

sp.SetColors(new Color[]{Color.Navy,Color.Maroon});

// Draw the markers
sp.SetMarkers(Marker.Node);
sp.SetMarkerScales(2);
sp.SetPenWidths(2);

sp.ScatterPlotStyle = ScatterPlotStyles.NoAxes;
sp.DrawScatterPlot(x,y);

// Fill in the labelled lines
sp.VectorStyle = VectorStyles.ArrowLines|VectorStyles.Dissected|VectorStyles.ValueTags;
sp.SetValueTags(new string[]{"One","Two","Three",
         "Four has\n<b>two</b> lines","Five","Six","Seven\nis here",
         "Eight","Nine","Home"});
sp.SetArrowStyle(8,24);
sp.SetValueFont("Arial",9,Color.DarkGreen);

sp.DrawVectors(new int[][]{x1,y1,x2,y2});

Here, the activities have been labelled, and the nodes drawn with a separate scatterplot. Notice the use of the ‘Dissected’ style to prevent the arrows from colliding where several lines converge on the same node.

Summary

This chart has several good uses on its own, but is very likely to be combined with standard LineGraphs and ScatterPlots, typically to label bunches of points using indicator lines and notes, or to connect arbitrary points on a timeseries (for example Buy and Sell points in a historical price plot).

See also ...

DrawVectors Method


SharpPlot 2.51 User Manual: Venn Diagrams

Venn Diagrams

Venn diagrams are used to summarise set membership information. SharpPlot will draw a proportional diagram for two sets (and one intersection) but for the three set case the chart is purely diagrammatic, as it is impossible to scale all the regions in the correct proportion. Diagrams for higher numbers of sets are not supported.

A Simple 2-Area Diagram

This is very typical of the type of data Venn diagrams are used for. We have a population of students, of which 12 study maths and 23 are girls. Of these, 7 study maths.

data = new int[] {23,12,7};
sp.SetMargins(12,48,0,0);
sp.VennDiagramStyle = VennDiagramStyles.ValueTags;
sp.SetValueFont("arial",18,FontStyle.Bold,Color.Maroon);

sp.SetColors(new Color[]{Color.Green,Color.Maroon});
sp.SetEdgeStyle(Color.Black,LineStyle.Solid,2);

sp.SetXLabels(new string[]{"Females","Maths Students","Female Maths Students"});
sp.SetXLabelFont("times",12,FontStyle.Bold,Color.Maroon);
sp.XLabelFormat = "XXXXXX;";

sp.DrawVennDiagram(data);

The two circles are drawn with their areas in proportion to the size of each group, and the centres are placed so that the area of overlap represents the number in the intersection.

Shading and Outlining

When you choose to fill the circles, SharpPlot picks a suitable opacity setting so that the colours combine effectively.

sp.SetMargins(12,48,0,0);
sp.VennDiagramStyle = VennDiagramStyles.Filled|VennDiagramStyles.RedrawOutline|
         VennDiagramStyles.ValueTags;
sp.SetValueFont("arial",18,FontStyle.Bold,Color.White);

sp.SetColors(new Color[]{Color.Green,Color.Maroon});
sp.SetXLabels(new string[]{"Females","Maths Students","Female Maths Students"});
sp.SetXLabelFont("times",12,FontStyle.Bold,Color.Maroon);
sp.XLabelFormat = "XXXXXX;";

sp.DrawVennDiagram(data);

In this example the outline of each circle is redrawn over the filled areas.

Combining Values and Labels

For a simple chart like this, it may be better to combine the text with the values and write everything into the circles. This has the advantage of saving space and allowing the chart to be drawn a little bigger.

data = new int[] {23,18,9};
sp.SetMargins(6,6,0,0);

sp.VennDiagramStyle = VennDiagramStyles.Filled|VennDiagramStyles.RedrawOutline|
         VennDiagramStyles.ValueTags;
sp.SetValueFont("arial",14,FontStyle.Bold,Color.White);
sp.ValueTagFormat = "XL #0";
sp.ValueLineSpacing = 100;
sp.SetColors(new Color[]{Color.Green,Color.Maroon});
sp.SetEdgeStyle(Color.Navy);
sp.SetXLabels(new string[]{"Female","Maths","Female and Maths"});
sp.XLabelFormat = "XXXXXXX;";

sp.DrawVennDiagram(data);

Note that the Value-tag format patches in the X-labels, and then the entire string is wrapped using the X-label format.

Three Areas

For the Three-area chart, it is essential to add the Value tags, as the size of the circles gives no clue to the number of members of each category.

data = new int[] {23,12,7,8,4,3,2};
sp.SetMargins(12,12,6,6);

sp.VennDiagramStyle = VennDiagramStyles.Filled|VennDiagramStyles.RedrawOutline|
         VennDiagramStyles.ValueTags;

sp.SetValueFont("arial",18,FontStyle.Bold,Color.Maroon);

sp.ValueTagStyle = ValueTagStyles.Inside;
sp.ValueLineSpacing = 100;
sp.SetColors(new Color[]{Color.Green,Color.Wheat,Color.LightBlue});

sp.SetXLabels(new string[]{"Boys","Scientists","Golfers"});
sp.SetXLabelFont("times",14,FontStyle.Bold,Color.Teal);

sp.DrawVennDiagram(data);

Here we have 23 boys and 7 golfers. 3 of the boys play golf, and 2 of the golfing boys are scientists. For realistic data, some of the areas may have no members at all, but this does not affect the way the diagram is drawn.

Summary

The Venn diagram is a very special-purpose chart, and would normally be used for illustration rather than serious data-analysis. Charts with more circles have many more possibly intersections, and are almost impossible to draw in a way which provides any useful information to the reader. For the moment, SharpPlot limits you to the simple cases.

See also ...

DrawVennDiagram Method


SharpPlot 2.51 User Manual: X Bar Charts for positioned bars

X Bar Charts for positioned bars

Barcharts are usually drawn with a ‘logical’ X-axis. However there are times when you want to represent discrete values which occur at particular times. the XBarchart allows you to place bars exactly where you want them, and also to override the normal width for each bar.

Lottery winnings

This is a typical chart when a discrete event occurs occasionally. The data gives the year and value of the data rather than a continuous timeseries with many zero elements.

sp.Heading = "Lottery winnings";

year = new int[] {1993,1996,1998,1999,2001,2003};
won = new int[] {50,100,100,50,50,50};

sp.YAxisStyle = YAxisStyles.ForceZero;
sp.DrawXBarChart(won,year);

Using the bar widths to add Information

Supposing we sometimes were very lucky and won twice in the same year.

sp.Heading = "Lottery winnings";

year = new int[] {1993,1996,1998,1999,2001,2003};
won = new int[] {50,100,100,50,50,50};
count = new int[] {1,1,2,1,2,1};

sp.SetYTickMarks(50,4);
sp.YAxisStyle = YAxisStyles.GridLines;

sp.SetBarWidths(VectorMath.Multiply(count,0.25));

sp.DrawXBarChart(won,year);

Here the bars are drawn in proportion to the number of wins.

Summarizing Age Bands

The Histogram will summarize data into equal-width groups, and unequal groups may be represented by a filled Stepchart. The XBar offers another alternative here, as the bar-widths can be kept constant regardless of the width of the group.

sp.Heading = "Population by Age Group";
sp.XAxisStyle = XAxisStyles.MiddleLabels;
sp.SetXLabels(new string[]{"0-10","11-20","21-35","36-50","51-70","70+"});
sp.SetXTickMarks(new int[] {0,10,20,35,50,70,100});

midpoints = new int[] {5,15,27,42,60,85};
data = new double[] {12.5,14,30,28,12.5,3};

sp.DrawXBarChart(data,midpoints);

This is probably a more accurate view of the data, as the number in each sample is represented only by the height of the bar.

Faking a Grouped/Stacked Barchart

There are occasions when what you really need is a grouped barchart, with one half of the group shown as a stack of bars.

sp.Heading = "Requirement and Projected Manufacturing";

req = new int[] {30,24,22,18,24,28,21,23,40,42,66,22};  // Requirement
prd = new int[][]{new int[]{8,5,8,1,9,4,7,5,8,6,4,10},new int[]{11,11,16,11,18,24,
         14,21,17,6,18,22}};  // Production by Plant

sp.SetXLabels(new string[]{"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep",
         "Oct","Nov","Dec"});
sp.XAxisStyle = XAxisStyles.MiddleLabels;
sp.YAxisStyle = YAxisStyles.GridLines|YAxisStyles.ForceZero;

// Set barwidth explicitly here so we have exact positioning
sp.SetBarWidths(0.4);

xpos = VectorMath.Sum(0.3,VectorMath.Range(0,12));
sp.DrawXBarChart(req,xpos);

// Now set the style to be cumulative and draw stacked bars beside them ...
sp.DataStyle = DataStyles.Relative;
xpos = VectorMath.Sum(0.7,VectorMath.Range(0,12));

sp.DrawXBarChart(prd,xpos);

sp.SetKeyText(new string[]{"Required to\nmeet Sales","Plant-1","Plant-2"});

This example is typical of a production planning display, where the left-hand bar of each pair shows the total demand in the time period, and the right-hand is split to show supply from various production plants.

Summary

The XBarchart can be used on its own for time-based discrete series, or in combination with other charts to add blocks of color, or to fake particularly complex barcharts.

See also ...

DrawXBarChart Method


SharpPlot 2.51 User Manual: SharpPlot Class

SharpPlot Class

SharpPlot is a comprehensive library of business and scientific charts. See Constructors, Properties and Methods and Properties for the full list of chart types and the many properties which can be set for them.

public class SharpPlot

Example

With SharpPlot, you first set up any properties (like headings and labels), then you call one of the many Draw methods to build the chart, and finally you Render the result to your chosen format.

sp.SetMargins(0,0,0,0);
sp.PieChartStyle = PieChartStyles.ValueTags;
sp.ValueTagStyle = ValueTagStyles.Inside;
sp.SetValueFont("Arial",18,FontStyle.Bold,Color.White);
data = new int[] {31,23,16,8};
expl = new int[] {0,0,25,0};
sp.DrawPieChart(data,expl);

There are many more example charts in the Tutorial section of this guide.

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: SharpPlot Members

SharpPlot Members

SharpPlot Instance Properties

BarChartStyle | Barchart style
BarEdgeNib | Bar edge line-width
BarLimit | Maximum bars allowed
Baseline | Baseline for shading
BoxPlotStyle | Boxplot style
BubbleChartStyle | Bubblechart style
CaptionLineSpacing | Caption linespacing
CaptionStyle | Caption style
ChartChanged | Chart changed delegate
ClassInterval | Class interval
CloudChartStyle | Cloudchart style
ContourPlotStyle | Contourplot style
DataStyle | Data style
DatumTagFormat | Datum tag format
DatumTagStyle | Datum tag style
DialChartStyle | Dialchart style
Equation | Get Equation text
EquationFormat | Equation format
EquationIndex | Equation index
EquationStyle | Equation style
Flexibility | Flexibility
Footnote | Footnote text
FootnoteLineSpacing | Footnote linespacing
FootnoteStyle | Footnote style
FrameStyle | Frame style
GanttChartStyle | Ganttchart style
Gap | Inter-bar gap
GroupGap | Inter-group gap
Gutter | Gutter
Heading | Heading text
HeadingLineSpacing | Heading linespacing
HeadingStyle | Heading style
HistogramStyle | Histogram style
IAllowance | Inner axis allowance
IAxisStyle | Inner axis style
IIntercept | Inner axis intercept
ILabelFormat | Inner axis picture format
ITickStyle | Inner axis tickmark style
IndexOrigin | Index origin
InnerGap | Get Interbar spacing
Jitter | Jitter
KeyFormat | Key picture format
KeyGap | Key gap
KeyLimit | Keys used in this legend
KeyLineSpacing | Key linespacing
KeyStyle | Key style
LabelLineSpacing | Label linespacing
LabelStyle | Label style
LineGraphStyle | Linegraph style
MarginBottom | Bottom margin (pts)
MarginLeft | Left margin (pts)
MarginRight | Right margin (pts)
MarginTop | Top margin (pts)
MeshDensity | Density of mesh
MinMaxChartStyle | MinMax style
MissingValue | Missing value indicator
ModelFitKey | Modelfit gets a key
NotApplicableText | "Not Applicable" Filler
NoteLineSpacing | Note linespacing
NoteStyle | Note style
ParityStyle | Parity style
ParityTolerance | Parity limit as percentage
Perspective | 3D perspective
PieChartStyle | Piechart style
PieRadius | Pie radius (percent)
PieStartAngle | Pie start angle
PolarChartStyle | Polarchart style
ResetOption | Reset options
ResponsePlotStyle | Response style
ScalebarStyle | Scalebar style
ScatterPlotStyle | Scatterplot style
SeriesKey | Series gets a key
SoftHyphen | Softhyphen
StepChartStyle | Stepchart style
Subheading | Subheading text
TableStyle | Tablechart style
Tease | Tease
TickMarkWidth | Tickmark width
TitleBar | Title bar text
TowerAspect | Tower aspect
TowerChartStyle | Towerchart style
TowerLimit | Tower limit
TraceChartStyle | Traceplot style
TreeMapStyle | TreeMap style
TrellisStyle | Trellis style
TrendLineKey | Trendline gets a key
TriangleStyle | Triangle style
ValueLineSpacing | Value linespacing
ValueTagAngle | Value tag angle (degrees)
ValueTagFormat | Value picture format
ValueTagStyle | Value tag style
VectorStyle | Vector style
VennDiagramStyle | VennDiagram style
Version | Get Version
VmlHeader | Standard header code for VML webpage
WalkSort | Get Walksort for trees
XAxisLength | Get Calculated X Axis length
XAxisStyle | X axis style
XBarChartStyle | X-Bar style (shared)
XCaption | X captions (left,right)
XCaptionFormat | X Caption format
XDateFormat | Date picture (X axis)
XDatumThreshold | X datum threshold
XFactor | X labelling factor
XGridThreshold | X grid threshold
XIntercept | X intercept (Y target)
XLabelAngle | X label angle (degrees)
XLabelFormat | X picture format
XTickStyle | X tickmark style
XTimeFormat | Time fmt (X-axis) HH:MM
XTrackFormat | X-tracker format
YAxisLength | Get Calculated Y axis length
YAxisStyle | Y axis style
YCaption | Y captions (bottom,top)
YCaptionFormat | Y Caption format
YDateFormat | Date picture (Y axis)
YDatumThreshold | Y datum threshold
YFactor | Y labelling factor
YGridThreshold | Y grid threshold
YIntercept | Y intercept (X target)
YLabelFormat | Y picture format
YTickStyle | Y tickmark style
YTimeFormat | Time fmt (Y-axis) HH:MM
YTrackFormat | Y-tracker format
ZAxisStyle | Z axis style
ZCaption | Z caption (top only)
ZCaptionFormat | Z Caption format
ZFactor | Z labelling factor
ZLabelFormat | Z picture format
ZTickStyle | Z tickmark style

SharpPlot Methods

AddAttributes | Insert arbitrary content in the XML output for known text items
AddBookmark | Bookmark this page with name, level, openflag and weblink
AddComment | Insert a note with optional id and compression switch
AddEffect | Allow user to associate arbitrary SVG/XAML with any standard text item or subitem
AddHints | Apply an array of hints to a set of text items
AddHyperlinks | Apply an array of links to a set of text items
AddJavaPrologue | Include the definition of a JavaScript function in the output chart
AddTableShading | Add a combination of Color and Fill to an individual table cell
AddTips | Apply an array of tips to a set of text items
DefineFont | Create a definition for a font, including CSS details and PostScript name
DrawBarChart | Draws a grouped or stacked barchart from an array of arrays of values
DrawBoxPlot | Construct compound box-whisker plot from a data array and two integer category arrays
DrawBubbleChart | Scatterplot from 2 arrays of data with markers scaled by 3rd array
DrawCloudChart | 3D Scatter from x,y and multiple z values
DrawContourPlot | Contour plot from 3 arrays of double values
DrawDialChart | Draw a dial or gauge from data and pointer radii
DrawFrame | Draw current frame, with any fixed text such as headings and footnotes
DrawGanttChart | Gantt chart from 3 double arrays of Y-values, X-start and X-end values
DrawHistogram | Construct a histogram from a floating-point vector
DrawImage | Add artwork at actual size
DrawKey | This will draw and clear any pending keys, using the current setting of key text.
DrawLineGraph | Construct plot from array of arrays of y values and x-values
DrawMinMaxChart | Create hi-lo plot from arrays of max,min and optional axis values
DrawMultiple | Multiple plot from double array of arrays of y-values versus double x-values
DrawNote | Write text note given text, position, angle and maximum width
DrawPieChart | Piechart from data and sector explosions as percentages
DrawPolarChart | Polar plot from multiple series and times or angles
DrawPolygon | Draw polygon from x and y coordinates, with optional Color, FillStyle, line width and LineStyle
DrawResponsePlot | Create surface from multiple sets of z-values with matched x and y values
DrawScatterPlot | Make a scatter plot from x and y data
DrawStepChart | Stepped line from arrays of height data and step-start values
DrawTable | Build a table from an array of arrays of strings, giving cells in columns
DrawTowerChart | Tower chart from an array of arrays of height values
DrawTraceChart | Draw a set of parallel traces from an array of arrays of Y-values and an array of X-values
DrawTreeMap | Draw a treemap of a vector of items (may be paired with depth vector or a triplet of value,depth,altitude)
DrawTriangle | Construct triangle chart from data (3 series giving proportions or counts)
DrawVectors | Vector plot from a matrix of xyxy pairs
DrawVennDiagram | Draw a Venn diagram using supplied membership data
DrawXBarChart | XBarchart from multiple data series and x-values
FindExtremes | Determines the extreme values from an array of data, allowing for the ‘Curves’ style
GetCoefficients | Coefficients of modelfit
GetFittedValues | Fitted values from model
GetITickPositions | Calculated Inner ticks
GetResiduals | Residuals from modelfit
GetXTickPositions | Calculated X tickmarks
GetYTickPositions | Calculated Y tickmarks
GroupBy | Group by unique values
IncludeSource | Add arbitrary content passed as a simple string to either end of output
MapCoords | Maps a matched pair of (x,y) co-ordinate arrays to points
NewCell | Move to the next cell in the current trellis.
NewFrame | Clear the area for a new chart with new frame size and position.
NewPage | Page throw with option to skip full reset
NewYAxis | Partial reset to allow independent secondary Y-axis
NextNote | Returns the correct position for the next note text allowing given extra space in pts
ReadComment | Recover comments saved to file in any output format or passed as a string
ReadPdfStream | Recover any page from an encoded PDF
RedrawAxes | Overdraws the axes with optional framing
RenderBitmap | Return Bitmap rendered at given dpi and chosen antialiased text
RenderChartLog | Return completed chart as a readable log with optional prescan and extra information about chart ids
RenderEps | Return completed chart as EPS with monochrome switch and prefix information
RenderImageMap | Return tags to make an HTML imagemap for chart at given dpi
RenderJsonChartMap | Return JSON arrays to make a map for entire chart
RenderMetafile | Return or stream completed chart as Metafile with choice of formats and dpi settings
RenderPS | Return completed chart to file as raw PostScript with monochrome and mediabox flags and extra PS prologue
RenderPageMap | Return an instance of the PageMap class to allow active graphics applications
RenderPdf | Return completed chart rendered through through PDF engine.
RenderSvg | Return chart as an SVG file with aspect ratio setting and extra header text
RenderVml | Return completed chart rendered through VML engine as a div block to be incorporated in a webpage
RenderXaml | Return completed chart rendered through through XAML engine.
Reset | Clear SharpPlot to new paper size
ResetKey | Removes any accumulated key definitions
ResetProperties | All properties except trellis definitions are returned to default values.
SaveChartLog | Save completed chart as a readable log file with optional prescan and detail level
SaveEps | Save completed chart as EPS with monochrome switch and prefix information
SaveImage | Save image to file as Bitmap at default resolution
SavePS | Save completed chart to file as raw PostScript with monochrome and mediabox flags and extra PS prologue
SavePdf | Save completed chart to named file as PDF
SaveSvg | Save chart as an SVG file with aspect ratio setting and extra header text
SaveVml | Save completed chart rendered through VML engine as a complete webpage
SaveXaml | Save completed chart rendered through XAML engine to text file
SetAltitudeColors | Set Altitude Colors for contour plots or markers
SetArrowStyle | Set Arrow format from Arrow size, with optional sweep angle and fill pattern
SetAxisStyle | Set Axis format from any reasonable combination of color, lineStyle and lineweight
SetBackground | Set Paper from any reasonable combination of fillColor, fillStyle and edgeweight
SetBarWidths | Set Bar widths given an array of numbers or a single value
SetBaselineStyle | Set Baseline format from any reasonable combination of color, lineStyle and lineweight
SetCaptionFont | Set Caption font from a combination of fontname, size, style, colour
SetCellSize | Set Cellsize (width,height) from a single value or xvalue and yvalue pair
SetChartBackground | Set Chart background from any reasonable combination of fillColor, fillStyle and edgeweight
SetChartName | Assign a non-default name to the current chart
SetColors | Set a color or an array of colors to be used by upcoming series
SetContourStyle | Set Contour format from any reasonable combination of color, lineStyle and lineweight
SetContourTagFont | Set ContourTag font from a combination of fontname, size, style, colour
SetDataWindow | Set Window for data given an array of values or a single value
SetDatumLineStyle | Set DatumLine style from any reasonable combination of color, lineStyle and lineweight
SetDatumLineTags | Set Datumline tags from a delimited string or a string array
SetDatumTagFont | Set DatumTag font from a combination of fontname, size, style, colour
SetEdgeStyle | Set Edge format from any reasonable combination of color, lineStyle and lineweight
SetEffects | Set Effect cycle – string or string array
SetEquationPosition | Set Equation position from a single value or xvalue and yvalue pair
SetFillStyles | Set a fill-style or an array of fill-styles for use by upcoming series Set an array of fill-styles for use by upcoming series
SetFootnoteFont | Set Footnote font from a combination of fontname, size, style, colour
SetFrameBackground | Set Frame background from any reasonable combination of fillColor, fillStyle and edgeweight
SetGridLineStyle | Set Gridline format from any reasonable combination of color, lineStyle and lineweight
SetHeadingFont | Set Heading font from a combination of fontname, size, style, colour
SetHeadingNudge | Set Heading nudge(x,y) from given displacements
SetIDataRange | Set Inner data range given an array of numbers or a single value
SetILabelFont | Set Inner label font from a combination of fontname, size, style, colour
SetILabels | Set Inner axis labels from a simple string or an array of strings
SetIRange | Set Inner axis range range given maximum and optional minimum values
SetITickMarks | Set Inner axis tick marks given an array of numbers or a single value
SetIZones | Set Inner axis zones given one or more Zone definitions
SetKeyBackground | Set Key background fill from any reasonable combination of fillColor, fillStyle and edgeweight
SetKeyFont | Set Key font from a combination of fontname, size, style, colour
SetKeyFrame | Key frame (ltwh in pts) Frame given top corner and size
SetKeyIndices | Set Key indices given an array of values or a single value
SetKeyNudge | Set Key box nudge from given displacements
SetKeyText | Set Legend texts for key from a delimited string or a string array
SetLabelFont | Set Label font from a combination of fontname, size, style, colour
SetLabelMask | Set Label mask from a mask (always treated as flags)
SetLineStyles | Set a Line-style or an array of line-styles to be used by upcoming series.
SetMargins | Set chart margins individually or as a group
SetMarkerColors | Set Altitude-colored markers for contour plots or markers
SetMarkerScales | Set Marker scales given an array of numbers or a single value
SetMarkers | Set up a marker or an array of markers for upcoming series
SetModelSpan | Set Modelfit span range given maximum and optional minimum values
SetNewline | Set Newline to any single character
SetNoteBackground | Set Note background from any reasonable combination of fillColor, fillStyle and edgeweight
SetNoteFont | Set Note font from a combination of fontname, size, style, colour
SetNoteNudge | Set Note nudge from given displacements
SetOrderOfFit | Order of fit for x and y axes (3D charts or contour plots)
SetPageLabels | Set Page-labels from a simple string or an array of strings
SetParityLimitStyle | Set Parity limit style from any reasonable combination of color, lineStyle and lineweight
SetParityLineStyle | Set Parity axis style from any reasonable combination of color, lineStyle and lineweight
SetParityZoneStyle | Set Parity zone style from any reasonable combination of fillColor, fillStyle and edgeweight
SetPenWidths | Set a line-width or an array of line-widths for use by upcoming data series
SetPieCenter | Set Pie centre (xy) from a single value or xvalue and yvalue pair
SetSelection | Set Selection mask for data from a mask (always treated as flags)
SetSeriesNames | Assign a list of names to the upcoming data series
SetSubheadingFont | Set Subheading font from a combination of fontname, size, style, colour
SetTablePosition | Set Table position from x,y and optional width
SetTowerFillStyles | Tower ptns (top,face,edge) for Walls and towers (single value sets all three)
SetTrellis | Makes a trellis specification from a cell count or cell layout
SetValueFont | Set Value tag font from a combination of fontname, size, style, colour
SetValueNudge | Set Value nudge from a pair of displacements or matching arrays
SetValueTags | Set Value tags from a delimited string or a string array
SetViewpoint | Set 3D viewpoint given a set of roll,pitch,yaw values in degrees
SetWallFillStyles | Wall patterns (YZ,XZ,XY) for Walls and towers (single value sets all three)
SetWeightings | Set Weights for modelfit given an array of numbers or a single value
SetXCaptionFont | Set X Caption font from a combination of fontname, size, style, colour
SetXDataRange | Set X data range given an array of numbers or a single value
SetXDatumLines | Set X datum line(s) given an array of numbers or a single value
SetXGridLines | Set X gridline(s) given an array of numbers or a single value
SetXLabelFont | Set X label font from a combination of fontname, size, style, colour
SetXLabelNudge | Set X-label nudge from given displacements
SetXLabels | Set X labels from a delimited string or a string array
SetXRange | Set X axis range range given maximum and optional minimum values
SetXTickLengths | Set X tick lengths given an array of numbers or a single value
SetXTickMarks | Reset X tick marks major tick interval to default
SetXZones | Set X zone given one or more Zone definitions
SetYCaptionFont | Set Y Caption font from a combination of fontname, size, style, colour
SetYDataRange | Set Y data range given an array of numbers or a single value
SetYDatumLines | Set Y datum line(s) given an array of numbers or a single value
SetYGridLines | Set Y gridline(s) given an array of numbers or a single value
SetYLabelFont | Set Y label font from a combination of fontname, size, style, colour
SetYLabelNudge | Set Y-label nudge from given displacements
SetYLabels | Set Y labels from a delimited string or a string array
SetYRange | Set Y axis range range given maximum and optional minimum values
SetYTickLengths | Set Y-tick lengths given an array of numbers or a single value
SetYTickMarks | Reset Y tick marks major tick interval to default
SetYZones | Set Y zone given one or more Zone definitions
SetZCaptionFont | Set Z Caption font from a combination of fontname, size, style, colour
SetZDataRange | Set Z data range given an array of numbers or a single value
SetZDatumLines | Set Z datum line(s) given an array of numbers or a single value
SetZLabelFont | Set Z label font from a combination of fontname, size, style, colour
SetZLabels | Set Z labels from a simple string or an array of strings
SetZRange | Set Z axis range range given maximum and optional minimum values
SetZTickMarks | Reset Z tick marks major tick interval to default
SplitBy | Split by unique values
UseCmyk | Use a color defined by 4 inks rather than RGB intensities


SharpPlot 2.51 User Manual: SharpPlot Constructors

SharpPlot Constructors

Initialize a new instance of the SharpPlot class with default paper size (432 pts wide by 324 points high):

public SharpPlot();

Constructor for SharpPlot taking paper size (width,height in pts) which determines the SVG viewbox, the size of an image rendered at default dpi, and so on.

public SharpPlot(
  int width,
  int height
);

Example

sp = new SharpPlot(600,300);

This will also set the default chart frame to (0,300,600,300) to occupy all the available area. Call NewFrame to create a chart frame anywhere within the defined area of the paper.

See also ...

Reset Method | SetBackground Method


SharpPlot 2.51 User Manual: Properties

Properties

The properties of the SharpPlot class are listed below.

SharpPlot Instance Properties

BarChartStyle | Barchart style
BarEdgeNib | Bar edge line-width
BarLimit | Maximum bars allowed
Baseline | Baseline for shading
BoxPlotStyle | Boxplot style
BubbleChartStyle | Bubblechart style
CaptionLineSpacing | Caption linespacing
CaptionStyle | Caption style
ChartChanged | Chart changed delegate
ClassInterval | Class interval
CloudChartStyle | Cloudchart style
ContourPlotStyle | Contourplot style
DataStyle | Data style
DatumTagFormat | Datum tag format
DatumTagStyle | Datum tag style
DialChartStyle | Dialchart style
Equation | Get Equation text
EquationFormat | Equation format
EquationIndex | Equation index
EquationStyle | Equation style
Flexibility | Flexibility
Footnote | Footnote text
FootnoteLineSpacing | Footnote linespacing
FootnoteStyle | Footnote style
FrameStyle | Frame style
GanttChartStyle | Ganttchart style
Gap | Inter-bar gap
GroupGap | Inter-group gap
Gutter | Gutter
Heading | Heading text
HeadingLineSpacing | Heading linespacing
HeadingStyle | Heading style
HistogramStyle | Histogram style
IAllowance | Inner axis allowance
IAxisStyle | Inner axis style
IIntercept | Inner axis intercept
ILabelFormat | Inner axis picture format
ITickStyle | Inner axis tickmark style
IndexOrigin | Index origin
InnerGap | Get Interbar spacing
Jitter | Jitter
KeyFormat | Key picture format
KeyGap | Key gap
KeyLimit | Keys used in this legend
KeyLineSpacing | Key linespacing
KeyStyle | Key style
LabelLineSpacing | Label linespacing
LabelStyle | Label style
LineGraphStyle | Linegraph style
MarginBottom | Bottom margin (pts)
MarginLeft | Left margin (pts)
MarginRight | Right margin (pts)
MarginTop | Top margin (pts)
MeshDensity | Density of mesh
MinMaxChartStyle | MinMax style
MissingValue | Missing value indicator
ModelFitKey | Modelfit gets a key
NotApplicableText | "Not Applicable" Filler
NoteLineSpacing | Note linespacing
NoteStyle | Note style
ParityStyle | Parity style
ParityTolerance | Parity limit as percentage
Perspective | 3D perspective
PieChartStyle | Piechart style
PieRadius | Pie radius (percent)
PieStartAngle | Pie start angle
PolarChartStyle | Polarchart style
ResetOption | Reset options
ResponsePlotStyle | Response style
ScalebarStyle | Scalebar style
ScatterPlotStyle | Scatterplot style
SeriesKey | Series gets a key
SoftHyphen | Softhyphen
StepChartStyle | Stepchart style
Subheading | Subheading text
TableStyle | Tablechart style
Tease | Tease
TickMarkWidth | Tickmark width
TitleBar | Title bar text
TowerAspect | Tower aspect
TowerChartStyle | Towerchart style
TowerLimit | Tower limit
TraceChartStyle | Traceplot style
TreeMapStyle | TreeMap style
TrellisStyle | Trellis style
TrendLineKey | Trendline gets a key
TriangleStyle | Triangle style
ValueLineSpacing | Value linespacing
ValueTagAngle | Value tag angle (degrees)
ValueTagFormat | Value picture format
ValueTagStyle | Value tag style
VectorStyle | Vector style
VennDiagramStyle | VennDiagram style
Version | Get Version
VmlHeader | Standard header code for VML webpage
WalkSort | Get Walksort for trees
XAxisLength | Get Calculated X Axis length
XAxisStyle | X axis style
XBarChartStyle | X-Bar style (shared)
XCaption | X captions (left,right)
XCaptionFormat | X Caption format
XDateFormat | Date picture (X axis)
XDatumThreshold | X datum threshold
XFactor | X labelling factor
XGridThreshold | X grid threshold
XIntercept | X intercept (Y target)
XLabelAngle | X label angle (degrees)
XLabelFormat | X picture format
XTickStyle | X tickmark style
XTimeFormat | Time fmt (X-axis) HH:MM
XTrackFormat | X-tracker format
YAxisLength | Get Calculated Y axis length
YAxisStyle | Y axis style
YCaption | Y captions (bottom,top)
YCaptionFormat | Y Caption format
YDateFormat | Date picture (Y axis)
YDatumThreshold | Y datum threshold
YFactor | Y labelling factor
YGridThreshold | Y grid threshold
YIntercept | Y intercept (X target)
YLabelFormat | Y picture format
YTickStyle | Y tickmark style
YTimeFormat | Time fmt (Y-axis) HH:MM
YTrackFormat | Y-tracker format
ZAxisStyle | Z axis style
ZCaption | Z caption (top only)
ZCaptionFormat | Z Caption format
ZFactor | Z labelling factor
ZLabelFormat | Z picture format
ZTickStyle | Z tickmark style

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: BarChartStyle Property

SharpPlot.BarChartStyle Property

Set Barchart style as any combination of allowed styles.

public BarChartStyles BarChartStyle {get; set;}

Example

sp.BarChartStyle = BarChartStyles.RelativeData | BarChartStyles.Horizontal;

Options

CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FloatingBars | Floating bars (lowest bar of stack not drawn)
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Horizontal | Horizontal chart
Indexed | Data is indexed to the initial value = 100
Logarithmic | All chart axes are drawn logarithmically
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
StackedBars | Stacked barcharts (data is accumulated)
TicksBetween | Tickmarks are drawn between bars or groups of bars
ValueTags | Value tags are written for data items

See also ...

SharpPlot Members | DrawBarChart Method


SharpPlot 2.51 User Manual: BarEdgeNib Property

SharpPlot.BarEdgeNib Property

Set edge line-width for barcharts, gantt charts and Boxplots.

public double BarEdgeNib {get; set;}

Example

By default, all bars are edged in black with a 0.4pt line. To change this (or remove the edge)

sp.BarEdgeNib = 2.3;
sp.BarEdgeNib = 0;

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: BarLimit Property

SharpPlot.BarLimit Property

Set Maximum bars allowed (default 200) to prevent runaway charts.

public int BarLimit {get; set;}

Example

sp.BarLimit = 1000;

See also ...

SharpPlot Members | TowerLimit Property


SharpPlot 2.51 User Manual: Baseline Property

SharpPlot.Baseline Property

Set baseline to set a reference line from which the bars on barcharts hang, or from which surface charts are shaded.

public double Baseline {get; set;}

Example

sp.Baseline = 10;

The baseline is drawn with the current setting of the axis attributes, typically a black, medium-weight line. A typical use is for variance plots, where the bars are expected to run up and down from a zero line. For horizontal barcharts, the baseline is drawn vertically at the given x-value, and the bars are drawn left and right of it.

See also ...

SharpPlot Members | SetBaselineStyle Method


SharpPlot 2.51 User Manual: BoxPlotStyle Property

SharpPlot.BoxPlotStyle Property

Set Boxplot style as any combination of allowed styles.

public BoxPlotStyles BoxPlotStyle {get; set;}

Example

sp.BoxPlotStyle = BoxPlotStyles.DecileWhiskers;

Options

CroppedAxes | Crops all chart elements at the axis boundary
DecileWhiskers | BoxWhisker indicates deciles with dotted lines
ErrorBars | Shows errorbars on Hi-Lo charts and boxplots
ExplodeAxes | Axes are set back from the plotting area
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Horizontal | Boxes are drawn horizontally
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
Plain | Omits median line from boxplots
TabularData | Array elements represent categories of data, not categorisations
TicksBetween | Tickmarks are drawn between bars or groups of bars

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: BubbleChartStyle Property

SharpPlot.BubbleChartStyle Property

Set Bubblechart style to any combination of flags.

public BubbleChartStyles BubbleChartStyle {get; set;}

Example

sp.BubbleChartStyle = BubbleChartStyles.Exploded;

Options

AltitudeShading | Altitude shading is used with contour plots, bubble charts and response surfaces
AnnotateModel | Annotate model with computed equation
Clipped | Clip axes and all lines and markers at chart edge
CroppedAxes | Crops all chart elements at the axis boundary
Curves | Points are joined with smooth curves rather than straight lines
ExplodeAxes | Axes are set back from the plotting area
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Lines | Datapoints are connected with lines
Logarithmic | All chart axes are drawn logarithmically
ModelFit | Compute and show regression line or surface
NoAxes | No axes are drawn on the chart
NoMarkers | Do not draw markers at data points
OnTopModel | Modelfit is drawn ontop of data
OverlayGrid | Gridlines are drawn ontop of data
RadialScaling | Bubble charts scale using radius rather than area
ScaleBar | Bubble charts and altitude-shaded Contour plots add a nominal Z-Axis
ValueTags | Value tags are written for data items


SharpPlot 2.51 User Manual: CaptionLineSpacing Property

SharpPlot.CaptionLineSpacing Property

Set Caption linespacing for multiline axis captions.

public double CaptionLineSpacing {get; set;}

Example

sp.CaptionLineSpacing = 120;

The pitch may be given as a percentage, a factor of the font size, or an absolute distance in points. The default value is 110% of the font size, use negative values here to have the number treated as points regardless.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: CaptionStyle Property

SharpPlot.CaptionStyle Property

Set Caption style to any allowed combination.

public CaptionStyles CaptionStyle {get; set;}

Example

sp.CaptionStyle = CaptionStyles.Flat;

Captions on 3D charts are normally angled to match the slope of the axis. The text may be more readable at small sizes if written horizontally.

Options

FlatText | Flat text is used for 3D captions
LeftAlign | Left aligned caption
NoWrap | Captions are not wrapped automatically.
RightAlign | Right aligned caption

See also ...

SharpPlot Members | XCaption Property | YCaption Property | ZCaption Property


SharpPlot 2.51 User Manual: ChartChanged Property

SharpPlot.ChartChanged Property

Set ChartChanged delegate to run any suitable function.

public ChartChangedDelegate ChartChanged {get; set;}

Example

sp.ChartChanged += ChartWatcher;

SharpPlot will call your chosen delegate (which is passed the current instance as argument) whenever a redraw is required. This occurs whenever any of the DrawXxx functions is run, as well as at calls such as Reset.


SharpPlot 2.51 User Manual: ClassInterval Property

SharpPlot.ClassInterval Property

Set the Class interval for histograms.

public double ClassInterval {get; set;}

Example

sp.ClassInterval = 2.3;

The default is 1, but SharpPlot will attempt to make an intelligent judgement depending on the data you pass to DrawHistogram.

See also ...

SharpPlot Members | DrawHistogram Method


SharpPlot 2.51 User Manual: CloudChartStyle Property

SharpPlot.CloudChartStyle Property

Set Cloudchart style to any allowed combination.

public CloudChartStyles CloudChartStyle {get; set;}

Example

sp.CloudChartStyle = CloudChartStyles.Risers | CloudChartStyles.Walls;

Options

AltitudeShading | Altitude shading is used with contour plots, bubble charts and response surfaces
Contours | Draw contour lines between data points
Curves | Points are joined with smooth curves rather than straight lines
Fine | Altitude shading interpolated in fine detail
FlatText | Flat labels and captions are used on 3D charts
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Indexed | Data is indexed to the initial value = 100
Lines | Datapoints are connected with lines
ModelFit | Compute and show regression line or surface
NoAxes | No axes are drawn on the chart
NoMarkers | No markers are drawn (turns off default)
ProjectContours | Contours are drawn on the xy-plane in 3D charts
Risers | Draw risers to data points from axis or fitted model
ScaleBar | Bubble charts and altitude-shaded Contour plots add a nominal Z-Axis
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
TiledSurface | Tile surfaces on response plots
TrendSurface | Compute trend surface (2D Gaussian smooth)
WallShading | Shade walls on all 3D charts
XYPlot | First column gives the X-values for LinePlot

See also ...

SharpPlot Members | DrawCloudChart Method


SharpPlot 2.51 User Manual: ContourPlotStyle Property

SharpPlot.ContourPlotStyle Property

Set Contour plot style to any combination of flags.

public ContourPlotStyles ContourPlotStyle {get; set;}

Example

sp.ContourPlotStyle = ContourPlotStyles.ForceZero|ContourPlotStyles.GridLines;

Options

AltitudeShading | Altitude shading is used with contour plots, bubble charts and response surfaces
Clipped | Clip axes and all lines and markers at chart edge
Coarse | No refinement is done to colors on altitude-shaded plots
CroppedAxes | Crops all chart elements at the axis boundary
Curves | Points are joined with smooth curves rather than straight lines
ExplodeAxes | Axes are set back from the plotting area
Fine | Altitude shading interpolated in fine detail
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Lines | Datapoints are connected with lines
NoAxes | No axes are drawn on the chart
NoMarkers | Markers are not drawn at data points
NoTags | Contour lines are not tagged with the height values
OverlayGrid | Gridlines are drawn ontop of data
ScaleBar | Bubble charts and altitude-shaded Contour plots add a nominal Z-Axis
ValueTags | Value tags are written for data items


SharpPlot 2.51 User Manual: DataStyle Property

SharpPlot.DataStyle Property

Set the data style to any combination of flags.

public DataStyles DataStyle {get; set;}

Example

sp.DataStyle = DataStyles.Relative;

Options

Relative | Relative data (values are accumulated)
Rows | Series are presented in rows, not columns


SharpPlot 2.51 User Manual: DatumTagFormat Property

SharpPlot.DatumTagFormat Property

Set picture format for Datumline tags.

public string DatumTagFormat {get; set;}

Example

sp.DatumTagFormat = "##0%";

To show the numbers with a trailing % symbol and not more than 3 digits.


SharpPlot 2.51 User Manual: DialChartStyle Property

SharpPlot.DialChartStyle Property

Set Dialchart style.

public DialChartStyles DialChartStyle {get; set;}

Example

sp.DialChartStyle = DialChartStyles.WedgeZones;

Options

Anticlockwise | Scale on dialchart runs from right to left
ArrowLines | Draw arrows at ends of lines
WedgeZones | Use wedge zones on dialcharts rather than annular zones

See also ...

SharpPlot Members | DrawDialChart Method


SharpPlot 2.51 User Manual: Equation Property

SharpPlot.Equation Property

Get Equation text, as formatted.

public string Equation {get;}

Example

string mynote = sp.Equation;

This could be used to create a note from the text of a regression equation rather than have SharpPlot annotate the line.

See also ...

SharpPlot Members | EquationFormat Property | EquationStyle Property


SharpPlot 2.51 User Manual: EquationFormat Property

SharpPlot.EquationFormat Property

Set Equation formatter.

public string EquationFormat {get; set;}

Example

sp.EquationFormat = "Time = C0 + C1speed";

Simple Regression

The template is scanned for the strings C0,C1,C2 and so on, depending on the order of fit used. In the example, if the intercept was 2.3 and the slope was 0.42 the equation would read “Time = 2.3 + 0.42speed”. The “+” symbol in the template is a placeholder for the sign, so a negative slope would give a “-” sign here.

If a coefficient is zero, the matching term is omitted completely, so the above template could read “Time = 0.5speed” if the line went exactly through the origin.

You can use the special placeholder CC for correlation coefficient, and R2 for squared correlation coefficient, for example:

sp.EquationFormat = "Time = C0 + C1speed\nCorrelation = R2";

The formatted equation may be written on the fitted line, positioned according to the equation style, or recovered after the line has been drawn by referencing the “Equation” property. This may then be used as part of a note, or placed in the key text.

Multiple Regression

Note that for multiple regressions (Cloud charts and Scatterplots with the ‘contour’ option) the coefficients are generated in the order Int,x1,x2,...,y1,y2,...,y4 depending on the order of fit chosen for x and y. Set the EquationStyle to ‘forceOrigin’ to cut out the constant term and force the fit through the origin. In this case, the only way to display the equation is by referencing the ‘equation’ property and using this in a note or as part of the key.

See also ...

Formatting text with simple HTML tags | SharpPlot Members | Equation Property | EquationStyle Property


SharpPlot 2.51 User Manual: EquationStyle Property

SharpPlot.EquationStyle Property

When the equation of a curve is written on the line (chart style ‘modelfit,annotate’) the default is to place it above the curve, at the right-hand end. The placement and appearance can be modified with this property.

public EquationStyles EquationStyle {get; set;}

Example

sp.EquationStyle = EquationStyles.Middle;

Options

Absolute | Position is interpreted in points
AtEnd | Outside the line at the right-hand end
Below | Below the line
ForceOrigin | Force fitted line through the origin
Left | Left end of fitted line
LinearFit | Force a linear equation even if we have logarithmic axes
Middle | Middle of fitted line
Opaque | Opaque background to text
Percentage | Position is interpreted in percentage of axes
SpanData | Fitted line spans data range, not X-axis
Straddle | Straddling the line

See also ...

SharpPlot Members | Equation Property | SetEquationPosition Method


SharpPlot 2.51 User Manual: Flexibility Property

SharpPlot.Flexibility Property

When you use the ‘Trend’ style to draw an approximate curve through a scatter of points, it uses a default ‘flex’ value of 3 which actually sets the rate of die-away of the gaussian weighting used to emphasise nearby points.

public double Flexibility {get; set;}

A value of 0 will just draw an average (all points are weighted equally). A value of 100 will effectively force the line to visit every point. You will need to experiment with particular datasets to find the value that best hides the noise and reveals the underlying pattern in the data.

Example

sp.Flexibility = 4;

Technical data

For the statistically-minded, who want to know how this actually works!

It is a Gaussian-weighted moving average. The ‘Flexibility’ sets the exponent of the gaussian, so the way SharpPlot calculates it is to divide the x-axis range arbitrarily into 100 parts and for each point compute a y-value by adding up all the y-values from the data, weighted by the x-distance expressed as a classic ‘bell-curve’ function.

I think the more traditional approach is to use an inverse exponential weighting based on the absolute distance, but this ‘peaks’ very sharply and also tends to ‘whiplash’ at the ends, whereas the gaussian is more flat-topped, so the trend is effectively an average of nearby points with far-away points included but heavily discounted.

Basically, it just looks better for most reasonable timeseries!

Note that for very small datasets (below about 10 points) the weighting is adjusted to prevent the curve simply forming plateaux at each data point. This adjustment is simply to maintain visual consistency, and has no mathematical significance whatsoever.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: Footnote Property

SharpPlot.Footnote Property

Set Footnote text. This is wrapped into the entire width of the paper.

public string Footnote {get; set;}

Example

sp.Footnote = "Some Text";

Typically, this would be used to note the file name used for the chart data, the date and time of preparation, and so on. By default, it is drawn in the lower left corner of the chart area, but you can also choose centred or right alignment by setting the footnote style.

See also ...

Formatting | SharpPlot | FootnoteLineSpacing | FootnoteStyle | SetNewline


SharpPlot 2.51 User Manual: FootnoteLineSpacing Property

SharpPlot.FootnoteLineSpacing Property

Set Footnote linespacing for multi-line notes.

public double FootnoteLineSpacing {get; set;}

Example

sp.FootnoteLineSpacing = 150;

The pitch may be given as a percentage, a factor of the font size, or an absolute distance in points. The default value is 110% of the font size, use negative values here to have the number treated as points regardless.

See also ...

SharpPlot Members | Footnote Property


SharpPlot 2.51 User Manual: FootnoteStyle Property

SharpPlot.FootnoteStyle Property

Set Footnote style.

public FootnoteStyles FootnoteStyle {get; set;}

Example

sp.FootnoteStyle = FootnoteStyles.Center;

The footer is always written along the very bottom of the chart area. Use style ‘Ruled’ to rule across the entire chart area, just above the footer.

Options

Center | Centered footnote
NoWrap | Footers are not wrapped automatically.
Right | Right-aligned footnote
RuledAbove | Footnote is ruled above

See also ...

SharpPlot Members | Footnote Property


SharpPlot 2.51 User Manual: FrameStyle Property

SharpPlot.FrameStyle Property

Set Frame style (typically boxed or opaque).

public FrameStyles FrameStyle {get; set;}

Example

sp.FrameStyle = FrameStyles.Boxed;

The ‘boxed’ style simply draws a box around the entire chart area, with a small allowance (default 4 points) as gutter so that a trellis of boxed charts has some space between the cells. You can choose to shadow the box by adding ‘shadowed’ as well as ‘boxed’ to the style.

Options

Boxed | Boxed frame
Filled | Filled with background colour
Rounded | Rounded corners
Shadowed | Shadowed box

See also ...

SharpPlot Members | Gutter Property | DrawFrame Method | SetFrameBackground Method


SharpPlot 2.51 User Manual: GanttChartStyle Property

SharpPlot.GanttChartStyle Property

Set Ganttchart style to any combination of flags.

public GanttChartStyles GanttChartStyle {get; set;}

Example

sp.GanttChartStyle = GanttChartStyles.GridLines;

Options

CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
ValueTags | Value tags are written for data items

See also ...

SharpPlot Members | DrawGanttChart Method


SharpPlot 2.51 User Manual: Gap Property

SharpPlot.Gap Property

To set the gap between bars in the same group (default 0.618 of the bar width):

public double Gap {get; set;}

Example

sp.Gap = 0.5;

The gap is given as the fraction of a bar width. If the barchart is stacked (i.e. there are no groups) this sets the gap between bars. Small negative values are acceptable here, say -0.1 to give slightly overlapping bars. For tower charts it sets the gap between towers, and 0 is the smallest reasonable value.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: GroupGap Property

SharpPlot.GroupGap Property

Sets the gap between groups of bars or towers (default 1.618 of the bar width).

public double GroupGap {get; set;}

Example

sp.GroupGap = 2;

The gap is given as the fraction of a bar width. If the barchart is stacked (i.e. there are no groups) this has no effect.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: Gutter Property

SharpPlot.Gutter Property

When drawing chart borders, SharpPlot defaults to moving 4 points in from the edges to draw the boundary line. This is reduced in proportion to the chart size, but when it appears as a gap between tiles created with the ‘Trellis’ property, it may be excessive for a collection of very small plots. To over-ride this:

public double Gutter {get; set;}

Example

sp.Gutter = 2;

To have all the small charts abutting, set the gutter to 0.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: Jitter Property

SharpPlot.Jitter Property

Set random nudge in points for X-Y charts.

When an X-Y plot (typically a scatter plot) has repeated (X-Y) values, markers just draw exactly on top of each other.

Jitter allows to nudge them by pseudo-random values, so that it can be easily estimated how many markers collide on the same point. The nudges are pseudo-random so that they will be the same if you redraw the chart.

public double Jitter {get; set;}

Example

sp.Jitter = 2;    // nudge markers by approximately 2 points

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: Heading Property

SharpPlot.Heading Property

Set Heading text. This is centred over the top of the chart, and wrapped within the chart margins.

public string Heading {get; set;}

Example

sp.Heading = "Main Chart Title";

It is centred by default above the chart. New lines are generally forced with “\n” in the text, but you can choose your own line-break character if this is inconvenient.

You can also make a second heading line in a different font by specifying a subhead:

sp.SubHeading = "This is a subordinate heading";

Heading and subhead share the same placement, but you can set the subhead font independently.

See also ...

Formatting | SharpPlot | HeadingLineSpacing | HeadingStyle | Subheading | SetNewline


SharpPlot 2.51 User Manual: HeadingLineSpacing Property

SharpPlot.HeadingLineSpacing Property

Set Heading linespacing.

public double HeadingLineSpacing {get; set;}

Example

sp.HeadingLineSpacing = 140;

The pitch may be given as a percentage, a factor of the font size, or an absolute distance in points. The default value is 120% of the font size.

See also ...

SharpPlot Members | Heading Property


SharpPlot 2.51 User Manual: HeadingStyle Property

SharpPlot.HeadingStyle Property

Set Heading style.

public HeadingStyles HeadingStyle {get; set;}

Example

sp.HeadingStyle = HeadingStyles.Left;

Use style ‘ruled’ to rule across the entire chart area, just below the heading.

Options

Bottom | Bottom-aligned heading
Left | Left-aligned heading
NoWrap | Headings are not wrapped automatically.
Opaque | Opaque background to heading text
Right | Right-aligned heading
RuledBelow | Heading is ruled below

See also ...

SharpPlot Members | Heading Property


SharpPlot 2.51 User Manual: HistogramStyle Property

SharpPlot.HistogramStyle Property

Set Histogram style.

public HistogramStyles HistogramStyle {get; set;}

Example

sp.HistogramStyle = HistogramStyles.SurfaceShading;

You can superimpose a fitted Normal distribution, or add other control limits.

Options

CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Mean | Histogram marks the mean value with a datumline
NormalCurve | Histogram shows a fitted Normal Distribution
OverlayGrid | Gridlines are drawn ontop of data
Risers | Draw risers to data points from axis or fitted model
SDev1 | Histogram marks 1 StdDev with a datumline
SDev2 | Histogram marks 2 StdDev with a datumline
SDev3 | Histogram marks 3 StdDev with a datumline
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
ValueTags | Value tags are written for data items

See also ...

SharpPlot Members | DrawHistogram Method


SharpPlot 2.51 User Manual: IAllowance Property

SharpPlot.IAllowance Property

This sets the ‘allowance’ (default 0.8) as a fraction of the space between adjacent trace lines (determined by the major Y-ticks). A value of 1 allows the trace lines to range exactly between adjacent Y-tickmarks.

public double IAllowance {get; set;}

Example

sp.IAllowance = 1.2;

This may be set to a value >1 if you have a set of lines which move along very nearly parallel to one another like an ECG or seismograph trace. However this only works well with a plain inner axis as otherwise the ticks and labels collide.

See also ...

SharpPlot Members | DrawTraceChart Method


SharpPlot 2.51 User Manual: IAxisStyle Property

SharpPlot.IAxisStyle Property

Set I axis style to any combination of flags.

public IAxisStyles IAxisStyle {get; set;}

Example

sp.IAxisStyle = IAxisStyles.Plain;

Options

ExactFit | Exact fit (no extra ticks added)
ForceZero | Force zero in axis
GridLines | Draw gridlines parallel to inner axis
NoLabels | No Labels
PlainAxis | Plain axis (no ticks or labels)

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: IIntercept Property

SharpPlot.IIntercept Property

Set the point where the Inner-axis crosses the Y-axis:

public double IIntercept {get; set;}

Example

sp.IIntercept = 0;

This will move each Inner-axis from its default position to cross the Y-axis at zero.


SharpPlot 2.51 User Manual: ILabelFormat Property

SharpPlot.ILabelFormat Property

You can format the inner-axis labels with a simple picture format.

public string ILabelFormat {get; set;}

Example

sp.ILabelFormat = "#0∘";

This will show a degree symbol after each number, which would be appropriate for temperature data.

See also ...

Using Picture Formatters | SharpPlot Members


SharpPlot 2.51 User Manual: IndexOrigin Property

SharpPlot.IndexOrigin Property

The Index origin property allows you to set the ‘index origin’ of a generated x-scale. This is 1 by default, but could be 0 which is good for surface filled charts as the auto-ranging of the axis often forces it to include 0, and the surface looks ugly when it does not fill right back to the y-axis.

public double IndexOrigin {get; set;}

Example

sp.IndexOrigin = 0;

Although 1 and 0 are the normal values, IndexOrigin can take any integer (such as 36967 which is the OLE date value for 17th March, 2001) for date labelled axes where the data is daily from a given start date. To have the data-points set midway between ticks, use a value of 0.5 here and set the tick interval on the X-axis to 1.

See also ...

SharpPlot Members | SetXTickMarks Method


SharpPlot 2.51 User Manual: InnerGap Property

SharpPlot.InnerGap Property

Get Interbar spacing (in X-axis co-ordinates) to allow over-plotting of a grouped barchart with a secondary plot.

public double InnerGap {get;}

Example

double mygap = sp.InnerGap;

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: ITickStyle Property

SharpPlot.ITickStyle Property

Set Inner tickmark style.

public ITickStyles ITickStyle {get; set;}

Example

sp.ITickStyle = ITickStyles.CrossingTicks;

The ‘Crossing’ style works well here when combined with the default ‘Outside’ on the outer Y-axis. You might also consider ‘Inside’ which will label the inner axis down the inside of the Y-axis, so keeping the outer and inner labels well separated. For qualitative data (common on Kite charts) style ‘Noticks’ works best.

Options

CrossingTicks | Ticks cross the axis
InsideTicks | Ticks are drawn inside the axis
NoTicks | No ticks are drawn

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: KeyFormat Property

SharpPlot.KeyFormat Property

Set a picture format for key text.

public string KeyFormat {get; set;}

Example

sp.KeyFormat = "XXXXXXXX;";

To force the text to wrap into the space allowed for 8 ‘X’ characters. If the picture does not end with a semi-colon, the text will be truncated if necessary and terminated with an ellipsis character (→) to indicate that it has been clipped.

If you set Keytext to a an array of numbers (perhaps the categories represent numeric product codes) you can give a normal numeric formatter here such as “P0000” to create the text for the legend.

See also ...

Using Picture Formatters | SharpPlot Members | SetKeyText Method


SharpPlot 2.51 User Manual: KeyLimit Property

SharpPlot.KeyLimit Property

Set a maximum number of legend items to appear when a legend is next created.

public int KeyLimit {get; set;}

Example

sp.KeyLimit = 2;

This can be used to restrict the number of key items output (setting it to zero prevents the legend from being drawn) when a legend is created. This may be automatic (legends are flushed when the finished chart is rendered) or explicit (by a call to DrawKey).

The KeyStyle property may be used to reposition the legend frame between each call, for example to have the key split between two regions, top left and top right.

Resetting this to the default value of -1 will cause the remaining key items to be output at the next opportunity. To prevent SharpPlot from flushing unwanted items when the chart is rendered, call ResetKey to remove any pending items.

See also ...

KeyStyle Property | DrawKey Method | ResetKey Method


SharpPlot 2.51 User Manual: KeyLineSpacing Property

SharpPlot.KeyLineSpacing Property

Sets the line-spacing for multi-line key entries.

public double KeyLineSpacing {get; set;}

Example

sp.KeyLineSpacing = 120;

The pitch may be given as a percentage, a factor of the font size, or an absolute distance in points. The default value is 110% of the font size, use negative values here to have the number treated as points regardless.

See also ...

SharpPlot Members | KeyGap Property | DrawKey Method


SharpPlot 2.51 User Manual: KeyGap Property

SharpPlot.KeyGap Property

Sets the space between legend entries in a vertical key.

public double KeyGap {get; set;}

Example

sp.KeyGap = 1.5;

The gap may be given as a percentage, a factor of the font size, or an absolute distance in points. The default value is 132% of the font size.

See also ...

SharpPlot Members | KeyLineSpacing Property | DrawKey Method


SharpPlot 2.51 User Manual: KeyStyle Property

SharpPlot.KeyStyle Property

Set the Key style to any combination of flags.

public KeyStyles KeyStyle {get; set;}

Example

sp.KeyStyle = KeyStyles.Vertical;

Markers are normally included in keys if they are shown on each line – they can be omitted with style ‘plain’. When you use sp.DrawKey to place the key explicitly, the keys are normally positioned relative to the current (x,y) axes (style ‘Relative’) but you can choose to use absolute coordinates here, in which case you give the position of the key in Points from the chart origin (where the Axes would normally cross).

Any of the key layouts may be used with the autofit style. This starts with the type-size you specify and progressively reduces the font until the entire key fits into the available key frame. This may be a useful option if you are generating the key text from descriptions on a database, and hence do not know in advance how much space to allow for the key.

You would often want the ‘reversed’ ordering for stacked barcharts or surface charts. In this case the ‘reversed,vertical’ style means that the boxes in the key match the ordering of the bars or surfaces.

The ‘inline’ style is only used for LineGraphs. It writes the key text immediately to the right of the last point on the line, so is appropriate for timeseries data with well-separated lines. It may be necessary to increase the space in the right margin to make room for long series names.

Options

Absolute | Position is interpreted in points
AutofitText | Shrink text to fit within given frame
Baseline | Baselined legend (on first line of text)
BottomAlign | Bottom aligned key frame
Boxed | Boxed key
BoxFrame | Box given frame instead of text
CenterAlign | Center aligned key frame
InlineWithData | Legends are written inline with data
LeftAlign | Left aligned key frame
MiddleAlign | Middle aligned key frame
NoKey | No key (always omit key)
NoWrap | Key text is not wrapped to margin
Percentage | Position is interpreted in percentage of axes
Plain | Plain (no markers) key
Reversed | Reversed order of legend items
RightAlign | Right aligned key frame
Rounded | Rounded key box
Shadowed | Shadowed key box
TopAlign | Top aligned key frame
Vertical | Vertically arranged legend

See also ...

SharpPlot Members | DrawKey Method | SetKeyFrame Method


SharpPlot 2.51 User Manual: ScalebarStyle Property

SharpPlot.ScalebarStyle Property

Set the scale bar style to any combination of flags.

public ScalebarStyles ScalebarStyle {get; set;}

Options

Bottom | Scalebar is placed horizontally below the chart
Left | Scalebar is drawn in the left margin or at the bottom left
Right | Scalebar is drawn in the right margin or below the chart at the right
Small | Scalebar is drawn in minimalist style

See also ...

SharpPlot Members | ScalebarStyles Enumeration | Scale bar for Bubble and Altitude-shaded plots


SharpPlot 2.51 User Manual: LabelLineSpacing Property

SharpPlot.LabelLineSpacing Property

Set Label linespacing as a percentage of standard.

public double LabelLineSpacing {get; set;}

Example

sp.LabelLineSpacing = 120;

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: LabelStyle Property

SharpPlot.LabelStyle Property

Set Label style

public LabelStyles LabelStyle {get; set;}

Example

sp.LabelStyle = LabelStyles.FlatText;

To blank behind axis labels (useful if you have intercept axes and grid lines) set the label style to ‘opaque’:

sp.LabelStyle = LabelStyles.Opaque;

Labels are written by default to the left of the primary Y-axis and to the right of the secondary. Use style ‘centred’ to have them written (centre-aligned) on top of the axis. This would normally be used with the ‘opaque’ setting to make a white knockout over the axis line in which to write the text. Similarly, use style ‘middle’ to place the labels over the X-axis rather than below it.

sp.LabelStyle = LabelStyles.Opaque | LabelStyles.Middle;

Labels on 3D charts are normally angled to match the slope of the axis. The text may be more readable at small sizes if written horizontally, right-aligned to the tickmarks.

sp.LabelStyle = LabelStyles.FlatText;

will achieve this effect.

Options

Center | Centered (on y-axis) labels
FlatText | Flat text is used for 3D labels
LeftAlign | Left-align coltitles on table charts
Middle | Middled (on x-axis) labels
NoWrap | Labels are not wrapped automatically.
Opaque | Opaque background to label text
RightAlign | Right-align coltitles on table charts

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: LineGraphStyle Property

SharpPlot.LineGraphStyle Property

Set Linegraph style to any combination of flags.

public LineGraphStyles LineGraphStyle {get; set;}

Example

sp.LineGraphStyle = LineGraphStyles.XYPlot;

Options

AnnotateModel | Annotate model with computed equation
ArrowLines | Draw arrows at ends of lines
CellsCreated | Make cells at each marker for miniature plots
Clipped | Clip axes and all lines and markers at chart edge
CrispEdges | Turns off anti-aliasing on data lines
CroppedAxes | Crops all chart elements at the axis boundary
Curves | Points are joined with smooth curves rather than straight lines
ExplodeAxes | Axes are set back from the plotting area
Filled | Lines are completed back to the start and shaded inside the region created
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
GrowthCurve | Growth curve (exponential) is computed
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Indexed | Data is indexed to the initial value = 100
Markers | Markers are drawn at data points
ModelFit | Compute and show regression line or surface
NoAxes | No axes are drawn on the chart
NoLines | No lines are drawn (turns off default)
OnTopModel | Modelfit is drawn ontop of data
OverlayGrid | Gridlines are drawn ontop of data
Risers | Draw risers to data points from axis or fitted model
SegmentLines | Break lines at missing values rather than drawing across the gap
SkipRepeats | Repeated y-values are eliminated (treated as missing values)
SkipRuns | Runs of identical y-values are eliminated (preserves the first and last of each run)
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
TrendLine | Compute trend line (Gaussian smooth)
ValueTags | Value tags are written for data items
XYPlot | First column gives the X-values for LinePlot

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: MarginBottom Property

SharpPlot.MarginBottom Property

Set Bottom margin (pts).

public double MarginBottom {get; set;}

Example

sp.MarginBottom = 36;

This allows space (in points) for the X-axis caption, and the chart legend if you leave it in its default position.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: MarginLeft Property

SharpPlot.MarginLeft Property

Set Left margin (pts)

public double MarginLeft {get; set;}

Example

sp.MarginLeft = 48;

This allows space (in points) for the Y-axis labels and caption. If you have very large values to show here, you will almost certainly need to increase this value.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: MarginRight Property

SharpPlot.MarginRight Property

Set Right margin (pts)

public double MarginRight {get; set;}

Example

sp.MarginRight = 48;

This allows space (in points) from the end of the X-axis to the edge of the chart region. It is set by default to a small value, so you will need to increase it (say to 48 points) if you have a duplicate or right-hand Y-axis.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: MarginTop Property

SharpPlot.MarginTop Property

Set Top margin (pts)

public double MarginTop {get; set;}

Example

sp.MarginTop = 36;

This allows space (in points) for the chart heading and sub-heading. You will probably need to increase it if you have a heading that spans more than 2 lines. If you use left or right aligned headings for Pie or Polar charts, you can probably reduce this to zero as the headings will not clash with the chart in this case.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: MeshDensity Property

SharpPlot.MeshDensity Property

Set Density of mesh for response plots and contouring.

public double MeshDensity {get; set;}

Example

sp.MeshDensity = 2;

This will compute contours at double the normal frequency, giving a more accurate picture, but increasing the size of the finished graphic and the run-time needed to generate it.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: MinMaxChartStyle Property

SharpPlot.MinMaxChartStyle Property

Set MinMax style to any combination of flags.

public MinMaxChartStyles MinMaxChartStyle {get; set;}

Example

sp.MinMaxChartStyle = MinMaxChartStyles.Envelope;

Options

ArrowLines | Draw arrows at ends of lines
CroppedAxes | Crops all chart elements at the axis boundary
Curves | Points are joined with smooth curves rather than straight lines
DriftMarkers | Mark only the far end of bounds (2nd series)
Envelope | Shade region within bounds
ErrorBars | Show errorbars on ranges
ExplodeAxes | Axes are set back from the plotting area
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Horizontal | Horizontal chart
Indexed | Data is indexed to the initial value = 100
NoAxes | No axes are drawn on the chart
NoLines | No lines are drawn (turns off default)
OverlayGrid | Gridlines are drawn ontop of data
Plain | Plain axes or value tags on piechart
Terminated | Draw current marker on both bounds
ValueTags | Value tags are written for data items
XYPlot | First column gives the X-values for LinePlot

See also ...

SharpPlot Members | DrawMinMaxChart Method


SharpPlot 2.51 User Manual: MissingValue Property

SharpPlot.MissingValue Property

Tells SharpPlot to ignore specific values in data series.

public double MissingValue {get; set;}

Example

sp.MissingValue = 0;

The default setting is 32768. The effect of setting it to zero is to make line graphs skip over zero values, rather than drawing an annoying line down to the axis wherever zero is hit. When you plot an array of data with differing numbers of elements, SharpPlot automatically pads the shorter series with the current missing-value setting.

sp.MissingValue = -99;

This might be appropriate for data from some logging device, where negative numbers indicate various error conditions.

By default, line-graphs simply ‘bridge’ the missing points by joining the points on either side. Use the segmented lines style to have the line broken wherever data is missing.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: ModelFitKey Property

SharpPlot.ModelFitKey Property

Tells SharpPlot to include or omit the legend placeholder when generating a fitted curve. The default setting is to include it.

public bool ModelFitKey {get; set;}

Example

sp.ModelFitKey = false;

You can omit the legend entry by giving it an empty string, but this may be more convenient.

See also ...

SharpPlot Members | TrendLineKey Property


SharpPlot 2.51 User Manual: NotApplicableText Property

SharpPlot.NotApplicableText Property

Set “Not Applicable” Filler. By default, tables show missing values as “ – “ which may be reset with this property.

public string NotApplicableText {get; set;}

Example

sp.NotApplicableText = "n/a";

This will be shown in the case of a Cross-tab where no data is found for the particular combination of group and category which intersects at each cell.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: NoteLineSpacing Property

SharpPlot.NoteLineSpacing Property

Set the line-spacing for multi-line notes.

public double NoteLineSpacing {get; set;}

Example

sp.NoteLineSpacing = 150;

The pitch may be given as a percentage, a factor of the font size, or an absolute distance in points. The default value is 120% of the font size.

See also ...

SharpPlot Members | DrawNote Method


SharpPlot 2.51 User Manual: NoteStyle Property

SharpPlot.NoteStyle Property

Set Note style to any combination of flags.

public NoteStyles NoteStyle {get; set;}

Example

sp.NoteStyle = NoteStyles.Boxed;

Normally, notes are positioned relative to the current (x,y) axes (style ‘Relative’) but you can choose to use absolute coordinates here, in which case you give the position of the note in Points from the chart origin (the position where the axes would normally cross). For multi-line notes, the position gives the start of the baseline of the first line of the text unless you set it explicitly with styles such as Middle|Center which will use the note-boundingbox as a reference to compute the center.

To include a defined effect (such as an SVG shadow filter or animation) to the text:

sp.AddEffect(ScriptTarget.Notes,"<animate .... />"

You can add multiple effects to apply several filters or animations to the note. This could be used to have a note slide in from the side, then change colour or fade out.

Options

Absolute | Position is interpreted in points
Baseline | Baselined note box (on first line of text)
Bottom | Bottom-aligned note box
Boxed | Boxed notes
CenterAlign | Center aligned note box
Cropped | Eliminates entire note if text will be clipped
Middle | Middle-aligned note box
Opaque | Opaque text for notes
Percentage | Position is interpreted in percentage of axes
RightAlign | Right aligned note box
Rounded | Rounded box
Shadowed | Shadowed box
TopAlign | Top aligned note box

See also ...

SharpPlot Members | DrawNote Method


SharpPlot 2.51 User Manual: ParityStyle Property

SharpPlot.ParityStyle Property

Set ParityPlot style as any combination of allowed styles.

public ParityStyles ParityStyle {get; set;}

Example

sp.ParityStyle = ParityStyles.Percentage;

Options

Absolute | Tolerances are given as constant values
Percentage | Tolerances are given as percentages
Proportion | Tolerances are given as a proportion of the prediction

See also ...

ScatterPlotStyle Property | Parity plot


SharpPlot 2.51 User Manual: ParityTolerance Property

SharpPlot.ParityTolerance Property

This sets the tolerance limits for the parity style of scatterplot.

public double ParityTolerance {get; set;}

Example

sp.ParityTolerance = 10;

The default parity style is to treat the value as a percentage band, but you may also use ratio and absolute numbers here.

See also ...

Parity plot


SharpPlot 2.51 User Manual: Perspective Property

SharpPlot.Perspective Property

To get a good feel for the depth of a 3D chart it is essential to have a small degree of perspective distortion in the projection. This is controlled by how far away from the plot the ‘camera’ is placed – in SharpPlot the default is 12, meaning 12 chart-widths back from the virtual 3D image. To reduce the distortion, make this a big number (above 50 you will find that all the verticals become vertical); to increase it, move the ‘camera’ towards the plot.

public double Perspective {get; set;}

Example

sp.Perspective = 20;

You will find that 7 is about as close as you can reasonably go without producing very exaggerated effects. Numbers less than this will start to give spurious ‘inside-out’ views and (eventually) strange errors.

Isometric Projections

To make an Excel-style 3D chart, you should set the perspective to 0 which generates an isometric view, rather than a true perspective image. This can be used with the Towerchart to make simple ‘column charts’ in Excel style.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: PieChartStyle Property

SharpPlot.PieChartStyle Property

Set Piechart style to any combination of flags.

public PieChartStyles PieChartStyle {get; set;}

Example

sp.PieChartStyle = PieChartStyles.ValueTags;

Options

FarthestFirst | Drawing order allows 3D extrusion
Plain | Plain axes or value tags on piechart
RoseDiagram | Exploded pie sectors are drawn from centre to form a Rose Diagram
ValueTags | Value tags are written for data items

See also ...

SharpPlot Members | DrawPieChart Method


SharpPlot 2.51 User Manual: PieRadius Property

SharpPlot.PieRadius Property

Set Pie radius (percent of standard).

public int PieRadius {get; set;}

Example

sp.PieRadius = 80;

This will reduce all sectors in the piechart to 80% of the standard value.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: PieStartAngle Property

SharpPlot.PieStartAngle Property

By default, piecharts are drawn clockwise from 12:00. This property may be used to start at any position.

public double PieStartAngle {get; set;}

Example

sp.PieStartAngle = 90;

The only commonly used alternative value is 90 to start the pie at the 3:00 position.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: PolarChartStyle Property

SharpPlot.PolarChartStyle Property

Set Polarchart style to any combination of flags.

public PolarChartStyles PolarChartStyle {get; set;}

Example

sp.PolarChartStyle = PolarChartStyles.Risers;

Options

ArrowLines | Draw arrows at ends of lines
ClockFace | Polar chart represents a 24-hour clock
CompassPlot | Treat X-values as degrees in Polar plots
Curves | Points are joined with smooth curves rather than straight lines
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
HollowCenter | Polar gridlines radiate from first tick rather than centre
Indexed | Data is indexed to the initial value = 100
Markers | Markers are drawn at data points
NoAxes | No axes are drawn on the chart
NoLines | No lines are drawn (turns off default)
OriginMarker | Mark centre of polar plot with a bold dot
OverlayGrid | Gridlines are drawn ontop of data
Risers | Draw risers to data points from axis or fitted model
SkipRepeats | Repeated y-values are eliminated (treated as missing values)
SkipRuns | Runs of identical y-values are eliminated (preserves the first and last of each run)
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
ValueTags | Value tags are written for data items
XYPlot | First column gives the X-values for LinePlot

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: ResetOption Property

SharpPlot.ResetOption Property

Set Reset options, to preserve some settings across a reset. This will be used by :

  • ResetProperties
  • NewFrame
  • NewPage(true)
  • NewCell
public ResetOptions ResetOption {get; set;}

Example

sp.ResetOption = ResetOptions.KeysPersist;
CyclesPersist | Cycles persist across reset
KeysPersist | Keys persist across reset

See also ...

SharpPlot Members | ResetProperties Method


SharpPlot 2.51 User Manual: ResponsePlotStyle Property

SharpPlot.ResponsePlotStyle Property

Set Response Surface style to any combination of flags.

public ResponsePlotStyles ResponsePlotStyle {get; set;}

Example

sp.ResponsePlotStyle = ResponsePlotStyles.WallShading;

Options

AltitudeShading | Altitude shading is used with contour plots, bubble charts and response surfaces
Contours | Draw contour lines between data points
Curves | Points are joined with smooth curves rather than straight lines
Fine | Altitude shading interpolated in fine detail
FlatText | Flat labels and captions are used on 3D charts
ForceZero | Force zero (all axes include origin)
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Markers | Markers are drawn at data points
NoAxes | No axes are drawn on the chart
NoLines | No lines are drawn (turns off default)
Risers | Draw risers to data points from axis or fitted model
ScaleBar | Bubble charts and altitude-shaded Contour plots add a nominal Z-Axis
TiledSurface | Tile surfaces on response plots
WallShading | Shade walls on all 3D charts

See also ...

SharpPlot Members | DrawResponsePlot Method


SharpPlot 2.51 User Manual: ScatterPlotStyle Property

SharpPlot.ScatterPlotStyle Property

Set Scatterplot style to any combination of flags.

public ScatterPlotStyles ScatterPlotStyle {get; set;}

Example

sp.ScatterPlotStyle = ScatterPlotStyles.ForceZero;

Options

AnnotateModel | Annotate model with computed equation
ArrowLines | Draw arrows at ends of lines
CellsCreated | Make cells at each marker for miniature plots
Clipped | Clip axes and all lines and markers at chart edge
Contours | Draw contour lines between data points
CroppedAxes | Crops all chart elements at the axis boundary
Curves | Points are joined with smooth curves rather than straight lines
ExplodeAxes | Axes are set back from the plotting area
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
GrowthCurve | Growth curve (exponential) is computed
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Lines | Datapoints are connected with lines
Logarithmic | All chart axes are drawn logarithmically
ModelFit | Compute and show regression line or surface
NoAxes | No axes are drawn on the chart
NoMarkers | No markers are drawn (turns off default)
OnTopModel | Modelfit is drawn ontop of data
OverlayGrid | Gridlines are drawn ontop of data
Parity | Axes are made square and a diagonal is drawn with tolerance lines
Risers | Draw risers to data points from axis or fitted model
TrendLine | Compute trend line (Gaussian smooth)
ValueTags | Value tags are written for data items

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: SeriesKey Property

SharpPlot.SeriesKey Property

Tells SharpPlot to include or omit the legend placeholder for the main data series. The default setting is to include it.

public bool SeriesKey {get; set;}

Example

sp.SeriesKey = false;

You can omit the legend entry by giving it an empty string, but this may be more convenient.

See also ...

ModelFitKey Property | TrendLineKey Property


SharpPlot 2.51 User Manual: SoftHyphen Property

SharpPlot.SoftHyphen Property

Set Softhyphen for wrapped notes and other text.

public char SoftHyphen {get; set;}

Example

sp.SoftHyphen = '@';

By default, SharpPlot uses the tilde character ‘~’ as an optional word-break point in wrapped text, so that a word such as ‘Con~trib~ution’ could appear as:

Con-
tribution

or as

Contrib-
ution

or as

Contribution

... depending on the available width. If you require the ‘~’ character as normal text, you could do your own wrapping, or you could switch to a different soft hyphen.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: StepChartStyle Property

SharpPlot.StepChartStyle Property

Set Stepchart style to any combination of flags.

public StepChartStyles StepChartStyle {get; set;}

Example

sp.StepChartStyle = StepChartStyles.Indexed;

Options

CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Horizontal | Horizontal chart
Indexed | Data is indexed to the initial value = 100
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
Risers | Draw risers to data points from axis or fitted model
SegmentLines | Break lines at missing values rather than drawing across the gap
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
ValueTags | Value tags are written for data items

See also ...

SharpPlot Members | DrawStepChart Method


SharpPlot 2.51 User Manual: Subheading Property

SharpPlot.Subheading Property

Set Subheading text. This is wrapped between the chart margins to match the heading.

public string Subheading {get; set;}

Example

sp.Subheading = "Some Text for my Subhead";

The font and size are set by the SubheadFont property. The alignment and positioning are determined by the style of the main heading. Lines may be split with ‘\n’ as for the main heading.

See also ...

Formatting text with simple HTML tags | SharpPlot Members


SharpPlot 2.51 User Manual: TableStyle Property

SharpPlot.TableStyle Property

Set Tablechart style to any combination of flags.

public TableStyles TableStyle {get; set;}

Example

sp.TableStyle = TableStyles.Spanned;

Options

Absolute | Position is interpreted in points
Boxed | Chart elements are boxed
Center | Centre-align within chart frame
FitHeight | Tables are sized to fit frame height
FitWidth | Tables are sized to fit frame width
GridLines | Draw gridlines (all axes)
Merged | Matching row-labels are merged
Opaque | Background area is filled with current background style
Right | Right-align within chart frame
Rounded | Boxes are drawn with rounded corners
Shadowed | Boxes are drawn with a drop-shadow
Spanned | Matching column labels are merged
UseHeaders | Tables pick up headers and footers

See also ...

SharpPlot Members | DrawTable Method


SharpPlot 2.51 User Manual: Tease Property

SharpPlot.Tease Property

This property is designed to let you ‘tease out’ a 3rd dimension from a scatter-plot to show the effect of a category variable.

public double Tease {get; set;}

Example

sp.Tease = 6;

This effectively adds a 3rd dimension to the normal 2-D scatter plot by pulling the categories apart in the X-direction. The ‘tease’ value is the distance in points to separate each category; the separated categories are teased symmetrically about each x-value. If you have a large number of categories, you will need to use a low value here to prevent adjacent groups merging into one another.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: TickMarkWidth Property

SharpPlot.TickMarkWidth Property

Override inherited tickmark line-width with an explicit value.

public double TickMarkWidth{get; set;}

Example

sp.TickMarkWidth = 0.5;

The default is set to -1, which allows the tickmarks to scale naturally with the line-width used for the chart axes..

See also ...

SetAxisStyle Method


SharpPlot 2.51 User Manual: TitleBar Property

SharpPlot.TitleBar Property

Set Title bar text.By default, SharpPlot picks up the first heading in the chart and uses this as the ‘title’ of the chart. To over-ride this:

public string TitleBar {get; set;}

Example

sp.TitleBar = "First Chart";

The title is used in the browser titlebar (for SVG output), as the document title in a saved PDF, and as the visible title in the placeholder box of an EPS when it is imported into MS Word or other publishing tool.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: TowerAspect Property

SharpPlot.TowerAspect Property

Set Tower aspect (default towers are square).

public double TowerAspect {get; set;}

Example

sp.TowerAspect = 2;

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: TowerChartStyle Property

SharpPlot.TowerChartStyle Property

Set Towerchart style to any combination of flags.

public TowerChartStyles TowerChartStyle {get; set;}

Example

sp.TowerChartStyle = TowerChartStyles.WallShading;

Options

FlatText | Flat labels and captions are used on 3D charts
ForceZero | Force zero (all axes include origin)
GridLines | Draw gridlines (all axes)
Indexed | Data is indexed to the initial value = 100
NoAxes | No axes are drawn on the chart
Plain | Plain axes or value tags on piechart
WallShading | Shade walls on all 3D charts

See also ...

SharpPlot Members | DrawTowerChart Method


SharpPlot 2.51 User Manual: TowerLimit Property

SharpPlot.TowerLimit Property

Set Tower limit. This parameter simply prevents ‘runaway’ towercharts if you accidentally plot a silly amount of data (for example you forgot a ‘where’ setting on a big database, or omitted a grouping command).

public int TowerLimit {get; set;}

Example

sp.TowerLimit = 500;

The default is set to 200, which is the total number of data items above which towercharts will simply generate a blank page with an error message.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: TraceChartStyle Property

SharpPlot.TraceChartStyle Property

Set Traceplot style to any combination of flags.

public TraceChartStyles TraceChartStyle {get; set;}

Example

sp.TraceChartStyle = TraceChartStyles.Lines;

Options

CrispEdges | Turns off anti-aliasing on data lines
CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
KiteDiagram | Draw Trace chart in Kite-diagram form
NoAxes | No axes are drawn on the chart
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
XYPlot | First column gives the X-values for LinePlot

See also ...

SharpPlot Members | DrawTraceChart Method


SharpPlot 2.51 User Manual: TreeMapStyle Property

SharpPlot.TreeMapStyle Property

Set Treemap style to any combination of flags.

public TreeMapStyles TreeMapStyle {get; set;}

Options

AltitudeShading | Altitude shading is used with contour plots, bubble charts and response surfaces
FrameAxes | Axes are completed to frame chart and all data is cropped
Logarithmic | Area of rectangles scales to log of data value in TreeMap
ScaleBar | Bubble charts and altitude-shaded Contour plots add a nominal Z-Axis
SquareRoot | Area of rectangles scales to square root of data value in TreeMap
ValueTags | Value tags are written for data items

See also ...

SharpPlot Members | DrawTreeMap Method


SharpPlot 2.51 User Manual: TriangleStyle Property

SharpPlot.TriangleStyle Property

Set Triangle chart style to any combination of flags.

public TriangletStyles TriangleStyle {get; set;}

Example

sp.TriangleStyle = TriangleStyles.Markers+TriangleStyles.Labelled;

Options

Curves | Points are joined with smooth curves rather than straight lines
Filled | Lines are completed back to the start and shaded inside the region created
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Labelled | Triangle plot is drawn with labelled sides
Lines | Datapoints are connected with lines
Markers | Markers are drawn at data points
Percentage | Triangle plots are labelled in the range 0-100
RedrawOutline | Chart outline is redrawn over filled areas
SideCaptions | Triangle captions are moved to the sides
ValueTags | Value tags are written for data items


SharpPlot 2.51 User Manual: TrellisStyle Property

SharpPlot.TrellisStyle Property

Set Trellis style to any combination of flags.

public TrellisStyles TrellisStyle {get; set;}

Example

sp.TrellisStyle = TrellisStyles.SnakingCells;
Gridlines | Trellis is gridded like a table
PagedMultiples | Paged multiples, rather than trellised
ResetAtEachCell | Reset all properties on completing each cell
SnakingCells | Cells go down, then across the trellis

See also ...

SharpPlot Members | SetTrellis Method


SharpPlot 2.51 User Manual: TrendLineKey Property

SharpPlot.TrendLineKey Property

Tells SharpPlot to include or omit the legend placeholder when generating a gaussian trend. The default setting is to include it.

public bool TrendLineKey {get; set;}

Example

sp.TrendLineKey = false;

You can omit the legend entry by giving it an empty string, but this may be more convenient.

See also ...

SharpPlot Members | ModelFitKey Property


SharpPlot 2.51 User Manual: ValueLineSpacing Property

SharpPlot.ValueLineSpacing Property

Set linespacing for multi-line value-tags.

public double ValueLineSpacing {get; set;}

Example

sp.ValueLineSpacing = 120;

The pitch may be given as a percentage, a factor of the font size, or an absolute distance in points. The default value is 110% of the font size, use negative values here to have the number treated as points regardless.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: ValueTagAngle Property

SharpPlot.ValueTagAngle Property

Set the value-tag angle (degrees). When you set the value tags to be angled, the default angle is 34 degrees. You can set this to any value from 0-360.

public double ValueTagAngle {get; set;}

Example

sp.ValueTagAngle = 12.5;

Angled tags are always drawn to the right of the markers, with the center of rotation at the marker. Multi-line tags are positioned so that the middle line is drawn along the rotated baseline.

See also ...

ValueTagStyle Property


SharpPlot 2.51 User Manual: ValueTagFormat Property

SharpPlot.ValueTagFormat Property

Set Value-tag picture format.

public string ValueTagFormat {get; set;}

Example

sp.ValueTagFormat = "##0.00%";

To show the tags to 2 decimal places with a trailing % symbol. When contour lines are drawn on scatterplots, this format specification is used to create the labels on each line. Note that the trailing ‘%’ does not multiply the values by 100 here (this is one of the few differences from the default formatter in C#).

Piecharts

This format specification is also used for the numeric sector labels on piecharts if you set the ‘values’ style here. You can also use a simple format such as ‘XXXXXXX;’ to get text labels wrapped into a limited width, or ‘XXXXXX’ which will simply truncate them, suffixed with an ellipsis if necessary.

In addition, you may want to merge the sector labels with the sector values. You can do this with a format such as ‘The XL = ##0’ which will take each sector in turn and substitute the corresponding label into the value string at the XL marker.

See also ...

Formatting text with simple HTML tags | Using Picture Formatters | SharpPlot Members


SharpPlot 2.51 User Manual: ValueTagStyle Property

SharpPlot.ValueTagStyle Property

Set Value tag style to any combination of flags.

public ValueTagStyles ValueTagStyle {get; set;}

Example

sp.ValueTagStyle = ValueTagStyles.Inside;

Options

Angled | Angled text is used for values
Center | Values are centered above markers
CumulativeValues | Cumulative values are used on stacked barcharts
Duration | Numeric values are formatted to base-60
Hints | Values are set as status-line hints
InheritColor | Values inherit color from data points
Inside | Values are written inside bars, pie-sectors, markers
Left | Values are written to the left of markers
Middle | Values are vertically centred in each bar
Normal | Values are written as text (default)
Opaque | Value text is drawn with opaque background
Radial | Values are displaced outward along a radius (Polar charts only)
RecolorOutside | Values on bars match the bar colour when forced outside the bar
Right | Values are right-aligned above markers
SectorValues | Sector values are used on stacked barcharts
ShowAllTags | Value tags are drawn even if they have too little space
Tips | Values are set as pop-up tips
Vertical | Vertical text is used for values

See also ...

SharpPlot Members | ValueTagAngle Property


SharpPlot 2.51 User Manual: VectorStyle Property

SharpPlot.VectorStyle Property

Set Vector style to any combination of flags.

public VectorStyles VectorStyle {get; set;}

Example

sp.VectorStyle = VectorStyles.ArrowLines;

Options

ArrowLines | Draw arrows at ends of lines
CroppedAxes | Crops all chart elements at the axis boundary
Dissected | Vectors are spaced away from target points
ExplodeAxes | Axes are set back from the plotting area
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Middle | Markers in the middle of vectors
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
Rooted | Markers at the source of vectors
Terminated | Markers on target of vectors
ValueTags | Value tags are written for data items

See also ...

DrawVectors Method


SharpPlot 2.51 User Manual: VennDiagramStyle Property

SharpPlot.VennDiagramStyle Property

Set VennDiagram style to any combination of flags.

public VennDiagramStyles VennDiagramStyle {get; set;}

Example

sp.VennDiagramStyle = VennDiagramStyles.ValueTags;

Options

Filled | Lines are completed back to the start and shaded inside the region created
RedrawOutline | Chart outline is redrawn over filled areas
ValueTags | Value tags are written for data items

See also ...

SharpPlot Members | DrawVennDiagram Method


SharpPlot 2.51 User Manual: Version Property (ReadOnly)

SharpPlot.Version Property (ReadOnly)

Returns the current SharpPlot version as a string.

public string Version {get;}

Example

string ver = sp.Version;
sp.Footnote = "Produced by SharpPlot version " + sp.Version;

This may be used in debug reports, or to add a footnote to any chart to acknowledge the use of SharpPlot in your graphics application.


SharpPlot 2.51 User Manual: VmlHeader Property

SharpPlot.VmlHeader Property

Retrieve a standard header code for a VML webpage:

public string VmlHeader {get; }

Example

string vmlHeader = sp.VmlHeader;

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: XAxisLength Property (ReadOnly)

SharpPlot.XAxisLength Property (ReadOnly)

Returns the calculated length of the X-axis given the current settings of page size, gutter and vertical margins.

public double XAxisLength {get;}

Example

double xl = sp.XAxisLength;

This may be useful if you want to size an image to paint the entire chart background exactly. The value (in conjunction with the matching Y-axis property) will give you the exact width and height required.


SharpPlot 2.51 User Manual: XAxisStyle Property

SharpPlot.XAxisStyle Property

Set X axis style to any combination of flags.

public XAxisStyles XAxisStyle {get; set;}

Example

sp.XAxisStyle = XAxisStyles.ForceZero;

Options

AngledLabels | Angled labels are used
AnnualTicks | Annual ticks are used for dates
ArrowedAxis | Axis ends with an arrowhead
AtEndCaption | Caption is drawn at the end of the axis
BalancedAxis | Tickmarks are ranged around zero and the Y-axis is horizontally centred
CenteredCaption | Caption is centered below axis
Clipped | Axis and data is clipped at the first and last tickmarks
Date | X-values are taken as OLE dates
DuplicateAxes | Duplicate X-axes are drawn
Duration | Format X axis labels using base-60 rather than 10
ExactFit | Axis is not rounded up to the next whole tickmark interval
FlatText | Flat text is used for 3D charts
ForceZero | The X-axis always includes zero
GridLines | Grid lines are drawn vertically at major ticks
InsideLabels | Labels are written within the chart area
InvisibleAxis | Axis and ticks are invisible, but labels will be drawn as normal
LogScale | Log scale is used
Longitude | Longitude scale is drawn for GPS data
MaskedLabels | Labels are already masked so must not be thinned further
MiddleLabels | Labels are placed between tickmarks
MonthlyTicks | Monthly ticks are used for dates
NoAxis | No axis is generated
NoLabels | No labels are drawn
OmitLastLabel | Drops off rightmost label to avoid potential collisions
OverlayGrid | Grid lines are drawn over the data
PlainAxis | Plain axis (no ticks or labels)
RightCaption | Right-aligned axis caption (default)
SpannedLabels | Repeated labels are blanked and spanned across the repeated range
StayAtEdge | Labels stay at edge when axis is centrally placed
Time | X-values are taken as OLE date-time numbers
TopAxis | Axis is drawn at the top of the chart

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: XBarChartStyle Property

SharpPlot.XBarChartStyle Property

Set X-Bar style to any combination of flags.

public XBarChartStyles XBarChartStyle {get; set;}

Example

sp.XBarChartStyle = XBarChartStyles.RelativeData;

Options

CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FloatingBars | Floating bars (lowest bar of stack not drawn)
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Horizontal | Horizontal chart
Indexed | Data is indexed to the initial value = 100
Logarithmic | All chart axes are drawn logarithmically
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
StackedBars | Stacked barcharts (data is accumulated)
TicksBetween | Tickmarks are drawn between bars or groups of bars
ValueTags | Value tags are written for data items

See also ...

SharpPlot Members | DrawXBarChart Method


SharpPlot 2.51 User Manual: XCaption Property

SharpPlot.XCaption Property

Sets the X-axis caption or captions. A single caption is written below the end of the axis, spaced to allow room for labels (if any).

public string XCaption {get; set;}

Example

sp.XCaption = "Weeks (2005)";

You can control the positioning with the X-axis style to place the caption centred (below the axis) or at the right-hand end. The caption text will be split over more than one line if you include a ‘\n’ in the text, for example:

sp.XCaption = "Elapsed days\nfrom start of project";

Use the CaptionLineSpacing property to control the vertical pitch here.

Setting a pair of captions

If you pass a pair of captions separated by the tab character, they are written at the left and right-hand ends of the axis.

sp.XCaption = "Low end\tHigh end";

This is a useful technique when the Y-axis is horizontally centered.

sp.XAxisStyle = XAxisStyles.ArrowedAxis|XAxisStyles.BalancedAxis|XAxisStyles.AtEndCaption;

sp.YCaption = "Cooler\tHotter";
sp.XCaption = "Drier\tMuch\nWetter";

sp.YAxisStyle = YAxisStyles.ArrowedAxis|YAxisStyles.BalancedAxis|YAxisStyles.AtEndCaption;

See also ...

Formatting | SharpPlot | CaptionLineSpacing | CaptionStyle | SetXCaptionFont


SharpPlot 2.51 User Manual: XCaptionFormat Property

SharpPlot.XCaptionFormat Property

Set X Caption format to force multi-line text or truncation.

public string XCaptionFormat {get; set;}

Example

sp.XCaptionFormat = "XXXXX;";

To force the captions to wrap at the length of the given string. If the string is simply ‘XXXXXXX’ then longer captions are truncated, and end with ‘...’ to indicate this.

See also ...

Formatting text with simple HTML tags | Using Picture Formatters | SharpPlot Members


SharpPlot 2.51 User Manual: XDateFormat Property

SharpPlot.XDateFormat Property

Set Date picture (X axis). When the X-axis is set to style ‘Date’, ‘Annual’ or ‘Monthly’, the date labels may be formatted with a standard picture format.

public string XDateFormat {get; set;}

Example

sp.XDateFormat = "MMM-yy";

Dates are formatted according to the current locale. Note that newlines are accepted in the format string to allow multi-line labels to be created easily for timeseries axes:

sp.XDateFormat = "MMMM\nyyyy";

This will create a 2-line set of labels which works well with the ‘Spanned’ style to centre the year below each set of 12 months.

Shortening month names

Timeseries are often labeled with the first character of the month name JFMAM ... D which cannot be generated with a standard date formatter. To have SharpPlot label the time-axis like this, use the MMM date format and set the XLabelFormat to a picture such as ‘X~~’ which will truncate the month name down to one character.

See also ...

Formatting | Using | SharpPlot | XAxisStyle | XLabelFormat


SharpPlot 2.51 User Manual: XDatumThreshold Property

SharpPlot.XDatumThreshold Property

Set X datum threshold to draw vertical datum lines at major tickmarks which exceed this value.The default is 160% of standard, or 8pt if XTickStyle is Absolute. This setting can be used in conjunction with spanned X-axis labels to create hierarchical timeseries plots, for example with datum lines every quarter.

public double XDatumThreshold {get; set;}

Example

sp.XDatumThreshold = 150;

This will draw vertical datum lines at any major tickmarks which are above 150% of standard.

sp.XDatumThreshold = 5.6;

This will draw vertical datum lines at any major tickmarks which are above 5.6pt if the XTickStyle has been set to Absolute.

See also ...

SharpPlot Members | XTickStyle Property | SetXTickLengths Method


SharpPlot 2.51 User Manual: XFactor Property

SharpPlot.XFactor Property

Set X labelling factor.

public double XFactor {get; set;}

Example

sp.XFactor = 1000;

This allows you to use default (numeric) labelling for scaled data. The values will be drawn normally, but will be divided by the given factor to generate the labels.

This does not affect the positioning of Datum Lines, Notes or Zones where you always give the unscaled co-ordinates.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: XGridThreshold Property

SharpPlot.XGridThreshold Property

Set X grid threshold which will draw gridlines at major ticks. The default value is 80% of standard tick length, or 4pt if XTickStyle is Absolute.

public double XGridThreshold {get; set;}

Example

sp.XGridThreshold = 50;

This will draw gridlines at any major ticks above 50% of the standard length. Typically this would be used with spanned X-labels to create a hierarchical timeseries, for example gridlines at year boundaries with monthly (small) tickmarks and standard tickmarks at the year-end.

sp.XGridThreshold = 1.5;

This will draw vertical grid lines at any major tickmarks which are above 1.5pt if the XTickStyle has been set to Absolute.

See also ...

SharpPlot Members | XTickStyle Property | SetXTickLengths Method


SharpPlot 2.51 User Manual: XIntercept Property

SharpPlot.XIntercept Property

To set the point where the Y-axis intercepts the X-axis.

public double XIntercept {get; set;}

Example

sp.XIntercept = 0;

This will move the Y-axis from its default position (at the left-hand side of the plotting region) to cross the X-axis at zero. You have the option of leaving the tickmarks and labels at the left edge, or having them stay with the axis using the Ystyle ‘stay’.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: XLabelAngle Property

SharpPlot.XLabelAngle Property

Set X label angle (degrees). When you set the X-labels to be angled, the default angle is 34 degrees. You can set this to any value from 0-360.

public double XLabelAngle {get; set;}

Example

sp.XLabelAngle = 45;

Angled labels are normally right-aligned on the tick marks for a lower x-axis and left-aligned on a top axis. This will be switched around if you use angles above 270 (which you may give as negative angles, such as -90 which is the same as 270). They will not be automatically thinned if the ticks get too crowded.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: XLabelFormat Property

SharpPlot.XLabelFormat Property

Set a picture format for X-Labels.

public string XLabelFormat {get; set;}

This uses the normal C# format string, with two small variations. The ‘%’ symbol has no effect on the scale of the data, and you may use the ‘~’ character anywhere in the picture to suppress the digit at that position.

Example

sp.XLabelFormat = "Week #0";

To label the tickmarks ‘Week 1’ ‘Week 2’ .... ‘Week 52’ as appropriate.

Wrapping text labels

Text labels may be wrapped into a preset width with a format such as:

sp.XLabelFormat = "XXXXXX;";

This will force the labels to wrap at the length of the given string. If the string is simply ‘XXXXXXX’ then longer labels are clipped, and are ended with an ellipsis ‘...’ unless the pattern length is only one or two characters when the labels are simply truncated.

Formatting multi-line labels

Normally the entire pattern applies to each line of a multi-line label, however a pattern such as ‘XX\nXXXX; will be applied line by line. This can be used to handle spanned date labels quite effectively, for example a date picture like ‘MMM\nyyyy’ could be used with a label formatter like ‘X\nXXXX’ to make a set of spanned labels showing the first letter of each month in the top line and the full year in the line below.

See also ...

Formatting text with simple HTML tags | Using Picture Formatters | SharpPlot Members | XDateFormat Property


SharpPlot 2.51 User Manual: XTickStyle Property

SharpPlot.XTickStyle Property

Set X tickmark style to one of the allowed alternatives.

public XTickStyles XTickStyle {get; set;}

Example

sp.XTickStyle = XTickStyles.CrossingTicks;

Options

Absolute | Tick-lengths are in points, not percent of standard
CrossingTicks | Ticks cross the axis
DuplicateTicks | Ticks repeat on the alternate axis
InsideTicks | Ticks are drawn inside the axis
MinorTicks | Minor ticks are added automatically
NoTicks | No ticks are drawn

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: XTimeFormat Property

SharpPlot.XTimeFormat Property

Set Time formatter for X-axis labels.

public string XTimeFormat {get; set;}

Example

sp.XTimeFormat = "HH:mm-ss";

See also ...

Using Date and Time Axes | SharpPlot Members


SharpPlot 2.51 User Manual: XTrackFormat Property

SharpPlot.XTrackFormat Property

Set a formatter for X-axis tracking.

public string XTrackFormat {get; set;}

Example

sp.XTrackFormat = "##0.0kg";   // for a scatterplot
sp.XTrackFormat = "MMM/yyyy";  // for timeseries data

Description

When you use the PageMap class to enable an active chart viewer, it may be helpful to translate the mouse position into the co-ordinate system shown on the chart. This allows the user to point the mouse at a data value and read off the associated numbers directly.

The default is to show the x-position as “x:value” where the value is rounded to 3 significant figures. You can override the default by specifying any valid format string here, including date formats if the X-axis is time-based.

See also ...

PageMap Class – Introduction | GetTracker Method


SharpPlot 2.51 User Manual: YTrackFormat Property

SharpPlot.YTrackFormat Property

Set a formatter for primary Y-axis tracking.

public string YTrackFormat {get; set;}

Example

sp.YTrackFormat = "$#,##0";

Description

When you use the PageMap class to enable an active chart viewer, it may be helpful to translate the mouse position into the co-ordinate system shown on the chart. This allows the user to point the mouse at a data value and read off the associated numbers directly.

The default is to show the y-position as “y:value” where the value is rounded to 3 significant figures. Note that only the primary y-axis is tracked.

See also ...

PageMap Class – Introduction | GetTracker Method


SharpPlot 2.51 User Manual: YAxisLength Property (ReadOnly)

SharpPlot.YAxisLength Property (ReadOnly)

Returns the calculated length of the Y-axis given the current settings of page size, gutter and horizontal margins.

public double YAxisLength {get;}

Example

double yl = sp.YAxisLength;

This may be useful if you want to size an image to paint the entire chart background exactly. The value (in conjunction with the matching X-axis property) will give you the exact width and height required.


SharpPlot 2.51 User Manual: YAxisStyle Property

SharpPlot.YAxisStyle Property

Set Y axis style to any combination of flags.

public YAxisStyles YAxisStyle {get; set;}

Example

sp.YAxisStyle = YAxisStyles.ForceZero;

Options

AboveGrid | Labels are written above gridlines and tickmarks
AngledLabels | Angled labels are used on 3D charts
ArrowedAxis | Axis ends with an arrowhead
AtEndCaption | The caption is written horizontally above the top of the axis
BalancedAxis | Tickmarks are ranged around zero and the X-axis is vertically centred
CenteredCaption | The caption is vertically centred
ClampToAxis | Data is clamped to fit within the axis range
Clipped | Data and axes are clipped at the extreme tick marks
Date | The data is assumed to be OLE dates
DuplicateAxes | Duplicate axes are drawn
Duration | Format Y axis labels using base-60 rather than 10
ExactFit | The axis will not be extended to the nearest whole tick interval
FlatText | Flat text is used for 3D captions and labels
ForceZero | Axis range always includes zero
GridLines | Horizontal gridlines are drawn at major ticks
InsideLabels | Labels are written within the chart area
InvertAxis | The axis is drawn with data values increasing from the top down
InvisibleAxis | No axis or ticks are drawn, but labels are written normally
Latitude | The scale is formatted as latitude values for GPS data
LeftAxis | The axis is drawn and labelled at the left even for secondary axes
LogScale | A logarithmic scale is used
MiddleLabels | Axis labels are written on the middle of the axis
NoAxis | No axis is drawn
NoLabels | No labels are added
OverlayGrid | Gridlines are drawn on top of data
PlainAxis | No labels or ticks are created
RightAxis | The axis is drawn at the right
StayAtEdge | Labels stay at the chart edge when the axis intercept is explicitly set
Synchronised | Secondary axis will match tick positions of primary
Time | The data is assumed to be OLE date/time values

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: YCaption Property

SharpPlot.YCaption Property

Sets the Y caption or a pair of captions. The Y-axis caption is written by default vertically alongside the axis.

public string YCaption {get; set;}

Example

sp.YCaption = "Tonnes";

It may also be placed above the top of the axis:

sp.YAxisStyle = YAxisStyles.AtEnd;

This is a better placement for short captions such as ‘mm’ or ‘kg’. Captions written at the top of the axis will be split into multiple lines if you include ‘\n’ in the text, for example ‘Height\n(cm)’ will give a two-line caption. The Caption style controls the alignment of the text for captions placed ‘atend’.

For centred ‘atend’ captions the centred text is wrapped into an effective width of twice the appropriate margin, and left or right aligned text is wrapped into the margin width.

Setting a pair of captions

If you pass a pair of captions separated by the tab character, they are written at the lower and upper ends of the axis.

sp.YCaption = "Cooler\tHotter";

This is a useful technique when the X-axis is vertically centered.

sp.XAxisStyle = XAxisStyles.ArrowedAxis|XAxisStyles.BalancedAxis|XAxisStyles.AtEndCaption;

sp.YCaption = "Cooler\tHotter";
sp.XCaption = "Drier\tMuch\nWetter";

sp.YAxisStyle = YAxisStyles.ArrowedAxis|YAxisStyles.BalancedAxis|YAxisStyles.AtEndCaption;

See also ...

Formatting text with simple HTML tags | SharpPlot Members | CaptionStyle Property | YCaptionFormat Property


SharpPlot 2.51 User Manual: YCaptionFormat Property

SharpPlot.YCaptionFormat Property

Set Y Caption format to wrap long captions.

public string YCaptionFormat {get; set;}

Example

sp.YCaptionFormat = "XXXXX;";

See also ...

Using Picture Formatters | SharpPlot Members


SharpPlot 2.51 User Manual: YDateFormat Property

SharpPlot.YDateFormat Property

Set Date picture (Y axis labels).

public string YDateFormat {get; set;}

Example

sp.YDateFormat = "MMM-yyy";

Note that newlines are accepted in the format string to allow multi-line labels to be created easily for timeseries axes:

sp.YDateFormat = "MMMM\nyyyy";

This will show each label split onto 2 lines.

See also ...

Formatting text with simple HTML tags | Using Date and Time Axes | SharpPlot Members


SharpPlot 2.51 User Manual: YDatumThreshold Property

SharpPlot.YDatumThreshold Property

Set Y datum threshold as a percentage of standard tickmark length. The default is 160% of standard, or 8pt if YTickStyle is Absolute.

public double YDatumThreshold {get; set;}

Example

sp.YDatumThreshold = 150;

Datum-lines will be drawn across the chart for any tickmarks which exceed this value.

sp.YDatumThreshold = 8.4;

This will draw horizontal datum lines at any major tickmarks which are above 8.4pt if the YTickStyle has been set to Absolute.

See also ...

SharpPlot Members | YTickStyle Property | SetYTickLengths Method


SharpPlot 2.51 User Manual: YFactor Property

SharpPlot.YFactor Property

Set Y labelling factor.

public double YFactor {get; set;}

Example

sp.YFactor = 1000;

This allows you to use default (numeric) labelling for scaled data. The values will be drawn normally, but will be divided by the given factor to generate the labels.

This does not affect the positioning of Datum Lines, Notes or Zones where you always give the unscaled co-ordinates.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: YGridThreshold Property

SharpPlot.YGridThreshold Property

Set Y grid threshold. The default value is 80% of standard tick length, or 4pt if YTickStyle is Absolute.

public double YGridThreshold {get; set;}

Example

sp.YGridThreshold = 80;

This will draw horizontal gridlines for any major ticks which exceed this value.

sp.YGridThreshold = 3.2;

This will draw horizontal gridlines at any major tickmarks which are above 3.2pt if the YTickStyle has been set to Absolute.

See also ...

SharpPlot Members | YTickStyle Property | SetYTickLengths Method


SharpPlot 2.51 User Manual: YIntercept Property

SharpPlot.YIntercept Property

Set the point where the X-axis crosses the Y-axis:

public double YIntercept {get; set;}

Example

sp.YIntercept = 0;

This will move the X-axis from its default position (at the bottom of the plotting region) to cross the Y-axis at zero.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: YLabelFormat Property

SharpPlot.YLabelFormat Property

Set picture format for Y-axis labels.

public string YLabelFormat {get; set;}

This uses the normal C# format string, with two small variations. The ‘%’ symbol has no effect on the scale of the data, and you may use the ‘~’ character anywhere in the picture to suppress the digit at that position.

Example

sp.YLabelFormat = "##0.00%";

To show the numbers to 2 decimal places with a trailing % symbol. Note that this does not automatically multiply the values by 100 (unlike VB and many OCX controls such as the Flexgrid).

Wrapping text labels

Text labels may be wrapped into a preset width with a format such as:

sp.YLabelFormat = "XXXXXX;";

This will force the labels to wrap at the length of the given string. If the string is simply ‘XXXXXXX’ then longer labels are clipped, and are ended with an ellipsis ‘...’ unless the pattern length is only one or two characters when the labels are simply truncated.

See also ...

Formatting text with simple HTML tags | Using Picture Formatters | SharpPlot Members


SharpPlot 2.51 User Manual: YTickStyle Property

SharpPlot.YTickStyle Property

Set Y tickmark style to one of the allowed values.

public YTickStyles YTickStyle {get; set;}

Example

sp.YTickStyle = YTickStyles.CrossingTicks;

Options

Absolute | Tick-lengths are in points, not percent of standard
CrossingTicks | Ticks cross the axis
DuplicateTicks | Ticks repeat on the alternate axis
InsideTicks | Ticks are drawn inside the axis
MinorTicks | Minor ticks are added automatically
NoTicks | No ticks are drawn

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: YTimeFormat Property

SharpPlot.YTimeFormat Property

Set Time formatter for Y-axis labels.

public string YTimeFormat {get; set;}

Example

sp.YTimeFormat = "HH-mm";

See also ...

Using Date and Time Axes | SharpPlot Members


SharpPlot 2.51 User Manual: ZAxisStyle Property

SharpPlot.ZAxisStyle Property

Set Z axis style to any combination of flags.

public ZAxisStyles ZAxisStyle {get; set;}

Example

sp.ZAxisStyle = ZAxisStyles.Flat;

Options

AtEndCaption | The caption is written above the top of the axis
ExactFit | The axis is not extended to the nearest whole tickmark
FlatText | Flat text is used for the caption and labels
ForceZero | The axis is forced to include zero
GridLines | Grid lines are drawn around the chart walls
NoLabels | No labels are drawn
PlainAxis | No ticks or labels are drawn

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: ZCaption Property

SharpPlot.ZCaption Property

The Z-axis caption is written vertically alongside the axis. It will be automatically repositioned depending on the chart viewpoint.

public string ZCaption {get; set;}

Example

sp.ZCaption = "Yield";

You may also choose to place it at the end of the axis with the ‘atend’ Z-style.

See also ...

Formatting text with simple HTML tags | SharpPlot Members | CaptionStyle Property


SharpPlot 2.51 User Manual: ZCaptionFormat Property

SharpPlot.ZCaptionFormat Property

Set Z Caption format.

public string ZCaptionFormat {get; set;}

Example

sp.ZCaptionFormat = "XXXXX;";

See also ...

Using Picture Formatters | SharpPlot Members


SharpPlot 2.51 User Manual: ZFactor Property

SharpPlot.ZFactor Property

Set Z labelling factor.

public double ZFactor {get; set;}

Example

sp.ZFactor = 100;

This allows you to use default (numeric) labelling for scaled data.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: ZLabelFormat Property

SharpPlot.ZLabelFormat Property

Set picture format for Z-axis labels.

public string ZLabelFormat {get; set;}

Example

sp.ZLabelFormat = "##0%";

To show the numbers with a trailing % symbol and not more than 3 digits.

See also ...

Using Picture Formatters | SharpPlot Members


SharpPlot 2.51 User Manual: ZTickStyle Property

SharpPlot.ZTickStyle Property

Set Z tickmark style to an allowed value.

public ZTickStyles ZTickStyle {get; set;}

Example

sp.ZTickStyle = ZTickStyles.NoTicks;

Options

NoTicks No ticks are drawn

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: Methods

Methods

The methods of the SharpPlot class are listed below.

SharpPlot Methods

AddAttributes | Insert arbitrary content in the XML output for known text items
AddBookmark | Bookmark this page with name, level, openflag and weblink
AddComment | Insert a note with optional id and compression switch
AddEffect | Allow user to associate arbitrary SVG/XAML with any standard text item or subitem
AddHints | Apply an array of hints to a set of text items
AddHyperlinks | Apply an array of links to a set of text items
AddJavaPrologue | Include the definition of a JavaScript function in the output chart
AddTableShading | Add a combination of Color and Fill to an individual table cell
AddTips | Apply an array of tips to a set of text items
DefineFont | Create a definition for a font, including CSS details and PostScript name
DrawBarChart | Draws a grouped or stacked barchart from an array of arrays of values
DrawBoxPlot | Construct compound box-whisker plot from a data array and two integer category arrays
DrawBubbleChart | Scatterplot from 2 arrays of data with markers scaled by 3rd array
DrawCloudChart | 3D Scatter from x,y and multiple z values
DrawContourPlot | Contour plot from 3 arrays of double values
DrawDialChart | Draw a dial or gauge from data and pointer radii
DrawFrame | Draw current frame, with any fixed text such as headings and footnotes
DrawGanttChart | Gantt chart from 3 double arrays of Y-values, X-start and X-end values
DrawHistogram | Construct a histogram from a floating-point vector
DrawImage | Add artwork at actual size
DrawKey | This will draw and clear any pending keys, using the current setting of key text.
DrawLineGraph | Construct plot from array of arrays of y values and x-values
DrawMinMaxChart | Create hi-lo plot from arrays of max,min and optional axis values
DrawMultiple | Multiple plot from double array of arrays of y-values versus double x-values
DrawNote | Write text note given text, position, angle and maximum width
DrawPieChart | Piechart from data and sector explosions as percentages
DrawPolarChart | Polar plot from multiple series and times or angles
DrawPolygon | Draw polygon from x and y coordinates, with optional Color, FillStyle, line width and LineStyle
DrawResponsePlot | Create surface from multiple sets of z-values with matched x and y values
DrawScatterPlot | Make a scatter plot from x and y data
DrawStepChart | Stepped line from arrays of height data and step-start values
DrawTable | Build a table from an array of arrays of strings, giving cells in columns
DrawTowerChart | Tower chart from an array of arrays of height values
DrawTraceChart | Draw a set of parallel traces from an array of arrays of Y-values and an array of X-values
DrawTreeMap | Draw a treemap of a vector of items (may be paired with depth vector or a triplet of value,depth,altitude)
DrawTriangle | Construct triangle chart from data (3 series giving proportions or counts)
DrawVectors | Vector plot from a matrix of xyxy pairs
DrawVennDiagram | Draw a Venn diagram using supplied membership data
DrawXBarChart | XBarchart from multiple data series and x-values
FindExtremes | Determines the extreme values from an array of data, allowing for the ‘Curves’ style
GetCoefficients | Coefficients of modelfit
GetFittedValues | Fitted values from model
GetITickPositions | Calculated Inner ticks
GetResiduals | Residuals from modelfit
GetXTickPositions | Calculated X tickmarks
GetYTickPositions | Calculated Y tickmarks
GroupBy | Group by unique values
IncludeSource | Add arbitrary content passed as a simple string to either end of output
MapCoords | Maps a matched pair of (x,y) co-ordinate arrays to points
NewCell | Move to the next cell in the current trellis.
NewFrame | Clear the area for a new chart with new frame size and position.
NewPage | Page throw with option to skip full reset
NewYAxis | Partial reset to allow independent secondary Y-axis
NextNote | Returns the correct position for the next note text allowing given extra space in pts
ReadComment | Recover comments saved to file in any output format or passed as a string
ReadPdfStream | Recover any page from an encoded PDF
RedrawAxes | Overdraws the axes with optional framing
RenderBitmap | Return Bitmap rendered at given dpi and chosen antialiased text
RenderChartLog | Return completed chart as a readable log with optional prescan and extra information about chart ids
RenderEps | Return completed chart as EPS with monochrome switch and prefix information
RenderImageMap | Return tags to make an HTML imagemap for chart at given dpi
RenderJsonChartMap | Return JSON arrays to make a map for entire chart
RenderMetafile | Return or stream completed chart as Metafile with choice of formats and dpi settings
RenderPS | Return completed chart to file as raw PostScript with monochrome and mediabox flags and extra PS prologue
RenderPageMap | Return an instance of the PageMap class to allow active graphics applications
RenderPdf | Return completed chart rendered through through PDF engine.
RenderSvg | Return chart as an SVG file with aspect ratio setting and extra header text
RenderVml | Return completed chart rendered through VML engine as a div block to be incorporated in a webpage
RenderXaml | Return completed chart rendered through through XAML engine.
Reset | Clear SharpPlot to new paper size
ResetKey | Removes any accumulated key definitions
ResetProperties | All properties except trellis definitions are returned to default values.
SaveChartLog | Save completed chart as a readable log file with optional prescan and detail level
SaveEps | Save completed chart as EPS with monochrome switch and prefix information
SaveImage | Save image to file as Bitmap at default resolution
SavePS | Save completed chart to file as raw PostScript with monochrome and mediabox flags and extra PS prologue
SavePdf | Save completed chart to named file as PDF
SaveSvg | Save chart as an SVG file with aspect ratio setting and extra header text
SaveVml | Save completed chart rendered through VML engine as a complete webpage
SaveXaml | Save completed chart rendered through XAML engine to text file
SetAltitudeColors | Set Altitude Colors for contour plots or markers
SetArrowStyle | Set Arrow format from Arrow size, with optional sweep angle and fill pattern
SetAxisStyle | Set Axis format from any reasonable combination of color, lineStyle and lineweight
SetBackground | Set Paper from any reasonable combination of fillColor, fillStyle and edgeweight
SetBarWidths | Set Bar widths given an array of numbers or a single value
SetBaselineStyle | Set Baseline format from any reasonable combination of color, lineStyle and lineweight
SetCaptionFont | Set Caption font from a combination of fontname, size, style, colour
SetCellSize | Set Cellsize (width,height) from a single value or xvalue and yvalue pair
SetChartBackground | Set Chart background from any reasonable combination of fillColor, fillStyle and edgeweight
SetChartName | Assign a non-default name to the current chart
SetColors | Set a color or an array of colors to be used by upcoming series
SetContourStyle | Set Contour format from any reasonable combination of color, lineStyle and lineweight
SetContourTagFont | Set ContourTag font from a combination of fontname, size, style, colour
SetDataWindow | Set Window for data given an array of values or a single value
SetDatumLineStyle | Set DatumLine style from any reasonable combination of color, lineStyle and lineweight
SetDatumLineTags | Set Datumline tags from a delimited string or a string array
SetDatumTagFont | Set DatumTag font from a combination of fontname, size, style, colour
SetEdgeStyle | Set Edge format from any reasonable combination of color, lineStyle and lineweight
SetEffects | Set Effect cycle – string or string array
SetEquationPosition | Set Equation position from a single value or xvalue and yvalue pair
SetFillStyles | Set a fill-style or an array of fill-styles for use by upcoming series Set an array of fill-styles for use by upcoming series
SetFootnoteFont | Set Footnote font from a combination of fontname, size, style, colour
SetFrameBackground | Set Frame background from any reasonable combination of fillColor, fillStyle and edgeweight
SetGridLineStyle | Set Gridline format from any reasonable combination of color, lineStyle and lineweight
SetHeadingFont | Set Heading font from a combination of fontname, size, style, colour
SetHeadingNudge | Set Heading nudge(x,y) from given displacements
SetIDataRange | Set Inner data range given an array of numbers or a single value
SetILabelFont | Set Inner label font from a combination of fontname, size, style, colour
SetILabels | Set Inner axis labels from a simple string or an array of strings
SetIRange | Set Inner axis range range given maximum and optional minimum values
SetITickMarks | Set Inner axis tick marks given an array of numbers or a single value
SetIZones | Set Inner axis zones given one or more Zone definitions
SetKeyBackground | Set Key background fill from any reasonable combination of fillColor, fillStyle and edgeweight
SetKeyFont | Set Key font from a combination of fontname, size, style, colour
SetKeyFrame | Key frame (ltwh in pts) Frame given top corner and size
SetKeyIndices | Set Key indices given an array of values or a single value
SetKeyNudge | Set Key box nudge from given displacements
SetKeyText | Set Legend texts for key from a delimited string or a string array
SetLabelFont | Set Label font from a combination of fontname, size, style, colour
SetLabelMask | Set Label mask from a mask (always treated as flags)
SetLineStyles | Set a Line-style or an array of line-styles to be used by upcoming series.
SetMargins | Set chart margins individually or as a group
SetMarkerColors | Set Altitude-colored markers for contour plots or markers
SetMarkerScales | Set Marker scales given an array of numbers or a single value
SetMarkers | Set up a marker or an array of markers for upcoming series
SetModelSpan | Set Modelfit span range given maximum and optional minimum values
SetNewline | Set Newline to any single character
SetNoteBackground | Set Note background from any reasonable combination of fillColor, fillStyle and edgeweight
SetNoteFont | Set Note font from a combination of fontname, size, style, colour
SetNoteNudge | Set Note nudge from given displacements
SetOrderOfFit | Order of fit for x and y axes (3D charts or contour plots)
SetPageLabels | Set Page-labels from a simple string or an array of strings
SetParityLimitStyle | Set Parity limit style from any reasonable combination of color, lineStyle and lineweight
SetParityLineStyle | Set Parity axis style from any reasonable combination of color, lineStyle and lineweight
SetParityZoneStyle | Set Parity zone style from any reasonable combination of fillColor, fillStyle and edgeweight
SetPenWidths | Set a line-width or an array of line-widths for use by upcoming data series
SetPieCenter | Set Pie centre (xy) from a single value or xvalue and yvalue pair
SetSelection | Set Selection mask for data from a mask (always treated as flags)
SetSeriesNames | Assign a list of names to the upcoming data series
SetSubheadingFont | Set Subheading font from a combination of fontname, size, style, colour
SetTablePosition | Set Table position from x,y and optional width
SetTowerFillStyles | Tower ptns (top,face,edge) for Walls and towers (single value sets all three)
SetTrellis | Makes a trellis specification from a cell count or cell layout
SetValueFont | Set Value tag font from a combination of fontname, size, style, colour
SetValueNudge | Set Value nudge from a pair of displacements or matching arrays
SetValueTags | Set Value tags from a delimited string or a string array
SetViewpoint | Set 3D viewpoint given a set of roll,pitch,yaw values in degrees
SetWallFillStyles | Wall patterns (YZ,XZ,XY) for Walls and towers (single value sets all three)
SetWeightings | Set Weights for modelfit given an array of numbers or a single value
SetXCaptionFont | Set X Caption font from a combination of fontname, size, style, colour
SetXDataRange | Set X data range given an array of numbers or a single value
SetXDatumLines | Set X datum line(s) given an array of numbers or a single value
SetXGridLines | Set X gridline(s) given an array of numbers or a single value
SetXLabelFont | Set X label font from a combination of fontname, size, style, colour
SetXLabelNudge | Set X-label nudge from given displacements
SetXLabels | Set X labels from a delimited string or a string array
SetXRange | Set X axis range range given maximum and optional minimum values
SetXTickLengths | Set X tick lengths given an array of numbers or a single value
SetXTickMarks | Reset X tick marks major tick interval to default
SetXZones | Set X zone given one or more Zone definitions
SetYCaptionFont | Set Y Caption font from a combination of fontname, size, style, colour
SetYDataRange | Set Y data range given an array of numbers or a single value
SetYDatumLines | Set Y datum line(s) given an array of numbers or a single value
SetYGridLines | Set Y gridline(s) given an array of numbers or a single value
SetYLabelFont | Set Y label font from a combination of fontname, size, style, colour
SetYLabelNudge | Set Y-label nudge from given displacements
SetYLabels | Set Y labels from a delimited string or a string array
SetYRange | Set Y axis range range given maximum and optional minimum values
SetYTickLengths | Set Y-tick lengths given an array of numbers or a single value
SetYTickMarks | Reset Y tick marks major tick interval to default
SetYZones | Set Y zone given one or more Zone definitions
SetZCaptionFont | Set Z Caption font from a combination of fontname, size, style, colour
SetZDataRange | Set Z data range given an array of numbers or a single value
SetZDatumLines | Set Z datum line(s) given an array of numbers or a single value
SetZLabelFont | Set Z label font from a combination of fontname, size, style, colour
SetZLabels | Set Z labels from a simple string or an array of strings
SetZRange | Set Z axis range range given maximum and optional minimum values
SetZTickMarks | Reset Z tick marks major tick interval to default
SplitBy | Split by unique values
UseCmyk | Use a color defined by 4 inks rather than RGB intensities

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: AddAttributes Method

SharpPlot.AddAttributes Method

Set property/value pairs for one or more data points or a standard chart object.

Overloads

  • public void AddAttributes(string propName,string propValue);
  • public void AddAttributes(string propName,string[] propValue);
  • public void AddAttributes(string propName,string[][] propValue);
  • public void AddAttributes(string propName,string[] propValue,string seriesName);
  • public void AddAttributes(string propName,string propValue,int itemNumber);
  • public void AddAttributes(string propName,string propValue,int itemNumber,string seriesName);
  • public void AddAttributes(ScriptTarget targetId,string propName,string propValue);
  • public void AddAttributes(ScriptTarget targetId,string propName,string[] propValue);
  • public void AddAttributes(ScriptTarget targetId,string XmlContent);
  • public void AddAttributes(ScriptTarget targetId,string[] XmlContent);

Description

Every VML or SVG object is a namespace, so you can set arbitrary variables for each chart data item (typically you would set its value), or on headings, keys etc. You can set any of the standard JavaScript event handlers here, for example onMouseOver and onMouseOut to have data items highlight as you track the mouse over them. Simple onClick handlers will work as you expect on PNG output, using an associated imagemap. If you want to set the text of headings or other chart items, you can refer to them by the standard names listed as viewer hotspots. (This capability is only supported in charts rendered as VML and SVG).

Setting properties or handlers on all data-points

This is the simplest call, and would be appropriate if the object was to have all the points or bars behave identically. For example to highlight the outline of the bar under the mouse:

sp.AddAttributes("onMouseOver","this.strokecolor='Red';");
sp.AddAttributes("onMouseOut","this.strokecolor='black';");

A common strategy is to define a standard handler (common to all points) and then to pass a value (or an identifier) to this depending on which point was clicked. A typical handler would be:

sp.AddAttributes("onMouseDown","AddMe(this.value);");

This runs a (previously defined) JavaScript function with the ‘value’ property associated with the point which the user clicked. To distribute these properties across all the points, replace the second argument to the function with either a simple array or an array of arrays (one element per series) giving the parameter values:

sp.AddAttributes("value",Col_Vals);
sp.AddAttributes("value",new string[] {"34","27","16","62});
sp.AddAttributes("product_code",new string[][] {EastIds_DD,EastIds_RR} )

The second example would be typical for a barchart, where a product identifier could be associated with each bar segment to assist with a subsequent database query.

Another possibility is to use ‘unnamed’ properties, in which case the entire property value is written into the output stream exactly as it appears. This could be used to set a collection of properties in a single call:

sp.AddAttributes("",''onMouseOver="this.strokecolor='green'; onMouseOut="this.strokecolor='black';");

The series name may be included as a third argument if you have more than one series on the chart, and want the handlers to be applied to one series only. By default they are replicated across all series (unless the second argument is an array of arrays, one per series).

sp.SetSeriesNames(new string[] {"FirstSeries",Second Series"});
sp.AddAttributes("value",new string[] {"34","27","16","6"},"FirstSeries");

Setting properties on selected data-values

In all the examples above, the argument is passed as a 2-element set. An alternative syntax is to pass 3 or 4 arguments giving the item number and optional series name, and the specific handler for just that data value:

sp.AddAttributes("onMouseOver","this.strokecolor='green'; ",3,"MyBars");

This would set the handler only on the data point from the 3rd item of the series called “MyBars”. A useful ‘special’ setting is that if you give a handler for row=0, this is interpreted as the ‘line’ in a chart with both lines and markers. You could use this to highlight the line the mouse is over, without affecting the markers. Here is an example (using the SVG style) which highlights any of 3 lines – note that the highlight is cancelled by a generic call as it is the same for all of them:

sp.AddAttributes("onmouseover","evt.target.setAttribute('style','stroke:Red;');",0,"First line");
sp.AddAttributes("onmouseover","evt.target.setAttribute('style','stroke:Lime;');",0,"Second line");
sp.AddAttributes( "onmouseover","evt.target.setAttribute('style','stroke:Blue;');",0,"Third line");
// We can reset any of them with the same call (generic setting)
sp.AddAttributes("onmouseout","evt.target.setAttribute('style','');"

If you don’t explicitly name your series, they will be named “series-1” and so on for you, but explicit names are strongly recommended here as they are then added to the output VML or SVG as item ids, which makes debugging the finished scripts much simpler.

Setting properties on chart boilerplate

You can use the ‘target’ element to attach handlers to any of the following standard items:

Heading ... The main chart heading
Subhead ... The subsidiary heading
Footnote ... The chart footer
Pagelabels ... The page-label array
XCaption ... The X-axis caption
YCaption ... The Y-axis caption
XLabels ... The set of all X-axis labels
YLabels ... The set of all Y-axis labels
Key ... The set of chart keys (series marker and text)

Values ... Value tags on data items

XZones ... Any background regions (also YZones and XYZones)

string GoRed = "this.style.color='Red';";
ch.AddAttributes(ScriptTarget.Heading,"onMouseOver",GoRed);

If you name a target with multiple elements (such as the Key) you may pass an array of handlers, which will be associated with individual elements of the given item. An option here would be to pass an array of values (one per key element) and also attach a single Javascript fragment to all the keys which used the value to process accordingly.

sp.AddAttributes(ScriptTarget.Key,"ColorMe",new string[] {"","Lime","Fuchsia"})

The sample function Jscript has some simple ideas to show some of the possibilities. For more information on JavaScript, see any good textbook, such as the “Rhino” book from O’Reilly. Please note that scripting is possible on SVG charts, but requires considerably more JavaScript expertise and a good understanding of the SVG DOM.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: AddAttributes Method (String,String)

SharpPlot.AddAttributes Method (String,String)

Define a single handler for all values in all series.

public void AddAttributes(
    string propName,
    string propValue
);

Example

sp.AddAttributes("onMouseDown","AddMe(this.value);");

This runs a standard handler for every data-point.

See also ...

SharpPlot Members | AddAttributes Method


SharpPlot 2.51 User Manual: AddAttributes Method (ScriptTarget,String[])

SharpPlot.AddAttributes Method (ScriptTarget,String[])

Insert arbitrary content in the XML output for known text items.

public void AddAttributes(
    ScriptTarget targetId,
    string[] XmlContent
);

Example

sp.AddAttributes(ScriptTarget.Key,"ColorMe",new string[] {"","Lime","Fuchsia"})

A practical use of this capability would be to have mouse-over on the key emphasise the corresponding line in a multiple timeseries.

See also ...

SharpPlot Members | AddAttributes Method


SharpPlot 2.51 User Manual: AddAttributes Method (String,String,Int32)

SharpPlot.AddAttributes Method (String,String,Int32)

Set a single handler for a specific X value.

public void AddAttributes(
    string propName,
    string propValue,
    int itemNumber
);

Example

sp.AddAttributes("onMouseOver","this.strokecolor='green'; ",3);

This will turn the edge of the 3rd bar to green in all series (generally this call would be used when there is a single series).

See also ...

SharpPlot Members | AddAttributes Method


SharpPlot 2.51 User Manual: AddAttributes Method (String,String,Int32,String)

SharpPlot.AddAttributes Method (String,String,Int32,String)

Set a single handler for a specific X value in this series.

public void AddAttributes(
    string propName,
    string propValue,
    int itemNumber,
    string seriesName
);

Example

sp.AddAttributes("onMouseOver","this.strokecolor='green'; ",3,"MyBars");

See also ...

SharpPlot Members | AddAttributes Method


SharpPlot 2.51 User Manual: AddAttributes Method (String,String[])

SharpPlot.AddAttributes Method (String,String[])

Apply an array of handlers to all the XValues in the first series.

public void AddAttributes(
    string propName,
    string[] propValue
);

Example

sp.AddAttributes("value",new string[] {"34","27","16","62});

This will apply on ‘value’ property individually to 4 bars or markers (one item per data-element is required).

See also ...

SharpPlot Members | AddAttributes Method


SharpPlot 2.51 User Manual: AddAttributes Method (String,String[],String)

SharpPlot.AddAttributes Method (String,String[],String)

Apply an array of handlers that apply to all the XValues in a given series.

public void AddAttributes(
    string propName,
    string[] propValue,
    string seriesName
);

Example

sp.AddAttributes("value",new string[] {"34","27","16","6"},"FirstSeries");

This will apply 4 ‘value’ properties to the matching items in the series called “FirstSeries”.

See also ...

SharpPlot Members | AddAttributes Method


SharpPlot 2.51 User Manual: AddAttributes Method (String,String[][])

SharpPlot.AddAttributes Method (String,String[][])

Apply handlers to matching data items in all series.

public void AddAttributes(
    string propName,
    string[][] propValue
);

Example

sp.AddAttributes("product_code",new string[][] {EastIds_DD,EastIds_RR} )

This will apply each array of product codes to the matching items (e.g. bars in a stacked barchart) in each of 2 series.

See also ...

SharpPlot Members | AddAttributes Method


SharpPlot 2.51 User Manual: AddAttributes Method (ScriptTarget,String,String)

SharpPlot.AddAttributes Method (ScriptTarget,String,String)

Apply a handler to a known text item.

public void AddAttributes(
    ScriptTarget targetId,
    string propName,
    string propValue
);

Example

Put a simple handler pair on the subhead:

sp.AddAttributes(ScriptTarget.Subhead,"onMouseOver","this.style.color='Fuchsia';");
sp.AddAttributes(ScriptTarget.Subhead,"onMouseOut","this.style.color='Navy';");

For multi-part items (axis labels or keys) the items will have the handler applied individually, rather than as a group.

See also ...

SharpPlot Members | AddAttributes Method


SharpPlot 2.51 User Manual: AddAttributes Method (ScriptTarget,String,String[])

SharpPlot.AddAttributes Method (ScriptTarget,String,String[])

Apply an array of handlers to a set of text items.

public void AddAttributes(
    ScriptTarget targetId,
    string propName,
    string[] propValue
);

Example

sp.AddAttributes(ScriptTarget.XLabels,"onClick",my_Handlers);

Here my_Handlers is an array of strings with one handler per X-label. This could be used to drill-down to summary data for that time period.

See also ...

SharpPlot Members | AddAttributes Method


SharpPlot 2.51 User Manual: AddAttributes Method (ScriptTarget,String)

SharpPlot.AddAttributes Method (ScriptTarget,String)

Insert arbitrary content in the XML output for a known text item.

public void AddAttributes(
    ScriptTarget targetId,
    string XmlContent
);

Example

sp.AddAttributes(ScriptTarget.Heading,"onMouseOver = \"this.style.color='Red';\"");

See also ...

SharpPlot Members | AddAttributes Method


SharpPlot 2.51 User Manual: AddBookmark Method

SharpPlot.AddBookmark Method

Creates a bookmark at this point in the output stream. This will be used in PDF output to create an entry in the outline for the document.

Overloads

  • public void AddBookmark(string title);
  • public void AddBookmark(string title,int outlineLevel);
  • public void AddBookmark(string title,int outlineLevel,bool opened);
  • public void AddBookmark(string title,int outlineLevel,bool opened,string weblink);

Example

sp.Reset(590,835); // Paper size
sp.AddBookmark("January 2006",0,true);

Description

Multi-page collections of charts may be bookmarked with easily recognised names which can be organised into a tree structure to be shown by the Acrobat Reader as ‘Outlines’. It is also possible to create entries in the outline tree which jump to external resources, typically webpages or other PDFs.

The simple form of the command is ...

sp.AddBookmark("Sales analysis");

The bookmark will be placed on the next chart to be generated – you may call sp.AddBookmark several times in succession to create an outline structure if required.

Making an indented outline for Acrobat Reader

The outline information is included in the PDF file generated using sp.RenderPdf. It will often be helpful to indicate the outline level of the bookmark, with major sections at level-0 and subsidiary sections indented to form a contents tree.

sp.AddBookmark("'Sales analysis",0);
sp.AddBookmark("Europe",1);
sp.DrawBarChart(arr_europe);
sp.NewPage();
sp.AddBookmark("Asia",1)
sp.DrawBarChart(arr_asia);

... and so on. This structure will then appear in the Acrobat Viewer outline bar to the left of the document. By default, sections will be closed on opening the document – you can force the Acrobat Viewer to open a section automatically by appending true as the third parameter to the bookmark call:

sp.AddBookmark("Profit and Loss",0,true);
sp.AddBookmark("Income breakdown",1,true);
sp.AddBookmark("Consulting",2);

Linking to webpages or other PDFs

You can add a link to an external resource by including a 4th element in the call, for example:

sp.AddBookmark("Home page",0,true,"http://www.grapl.com");

This will allow the user to click on the outline entry and automatically open a web-browser at the page you give. To have Acrobat Reader load another PDF, just use a filename here in place of the url.

See also ...

RenderPdf Method


SharpPlot 2.51 User Manual: AddBookmark Method (String,Int32,Boolean,String)

SharpPlot.AddBookmark Method (String,Int32,Boolean,String)

Bookmark this page with name, level, openflag and weblink.

public void AddBookmark(
    string title,
    int outlineLevel,
    bool opened,
    string weblink
);

See also ...

SharpPlot Members | AddBookmark Method


SharpPlot 2.51 User Manual: AddBookmark Method (String)

SharpPlot.AddBookmark Method (String)

Add a simple Bookmark at outline level=0.

public void AddBookmark(
    string title
);

See also ...

SharpPlot Members | AddBookmark Method


SharpPlot 2.51 User Manual: AddBookmark Method (String,Int32)

SharpPlot.AddBookmark Method (String,Int32)

Add a Bookmark at a given outline level.

public void AddBookmark(
    string title,
    int outlineLevel
);

See also ...

SharpPlot Members | AddBookmark Method


SharpPlot 2.51 User Manual: AddBookmark Method (String,Int32,Boolean)

SharpPlot.AddBookmark Method (String,Int32,Boolean)

Add a text Bookmark at an opened outline level.

public void AddBookmark(
    string title,
    int outlineLevel,
    bool opened
);

See also ...

SharpPlot Members | AddBookmark Method


SharpPlot 2.51 User Manual: AddComment Method

SharpPlot.AddComment Method

Inserts a text annotation into any of the vector output formats, typically EPS.

Example

sp.AddComment("!!Company Logo here!!");

Overloads

  • public void AddComment(string text);
  • public void AddComment(string text,string key);
  • public void AddComment(string text,bool compress);
  • public void AddComment(string text,string key,bool compress);

This could be used as a marker for some post-processing job (e.g. to insert placeholders) or simply to aid debugging of a complex collection of charts. Note that plain text will appear in EPS output with ‘% ‘ on the front, unless the text begins with the ‘%’ character in which case it will be echoed exactly as it appears.

Comments can be marked with an id string and flagged for compression. In this case the text will appear as “yourid::” followed by ASCII85-encoded flate-compressed text. This may save space, but also prevent the comment from containing characters which could destroy XML or PostScript formats. Comments saved into XML-style output (typically SVG) have the disallowed characters ampersand-encoded after compression.

Comments saved with an id string may be retrieved from any textual format with ReadComment which reverses the encoding process if required. Note that comments are only saved in PDF output if you explicitly turn off compression of the PDF page content.

See also ...

ReadComment Method | SavePdf Method


SharpPlot 2.51 User Manual: AddComment Method (String,String,Boolean)

SharpPlot.AddComment Method (String,String,Boolean)

Insert a note into any vector output type such as EPS with key and optional compression.

public void AddComment(
    string text,
    string key,
    bool compress
);

See also ...

SharpPlot Members | AddComment Method


SharpPlot 2.51 User Manual: AddComment Method (String)

SharpPlot.AddComment Method (String)

Pass a simple uncompressed note.

public void AddComment(
    string text
);

See also ...

SharpPlot Members | AddComment Method


SharpPlot 2.51 User Manual: AddComment Method (String,String)

SharpPlot.AddComment Method (String,String)

Pass a keyed uncompressed note.

public void AddComment(
    string text,
    string key
);

See also ...

SharpPlot Members | AddComment Method


SharpPlot 2.51 User Manual: AddComment Method (String,Boolean)

SharpPlot.AddComment Method (String,Boolean)

Pass n unkeyed compressed note.

public void AddComment(
    string text,
    bool compress
);

See also ...

SharpPlot Members | AddComment Method


SharpPlot 2.51 User Manual: AddEffect Method

SharpPlot.AddEffect Method

Associates arbitrary SVG source with any standard text item.

public void AddEffect(
    ScriptTarget target,
    string effect
);

Description

This simply inserts arbitrary SVG code into the ‘group’ tag for the text item, so almost anything goes. It could be used to make a heading ‘shadowed’, or to add animations, for example to have text slide in from the side. Check the SVG documentation for details on the syntax required for filters and animations.

Example

sp.AddEffect(ScriptTarget.Heading,"#MyShadow");
sp.AddEffect(ScriptTarget.Heading,"letter-spacing:3");

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: AddHints Method

SharpPlot.AddHints Method

Set hints for one or more data points or a chart object.

Example

sp.AddHints(new string[] {"Jan","Feb","Mar"});
sp.AddHints(ScriptTarget.Footnote,"This is the footer.");

Overloads

  • public void AddHints(string hintText);
  • public void AddHints(string hintText,int itemNumber);
  • public void AddHints(string hintText,int itemNumber,string seriesName);
  • public void AddHints(string[] hintText);
  • public void AddHints(string[] hintText,string seriesName);
  • public void AddHints(string[][] hintText);
  • public void AddHints(ScriptTarget targetId,string hintText);
  • public void AddHints(ScriptTarget targetId,string[] hintText);

Description

This method adds hints to a given set of data points, so that as you move the mouse over the data in the viewer, the hint can be shown in the status bar at the bottom of the screen. Hints are supported by VML (directly) and by images if you create an associated imagemap. The SVG viewer does not currently show hints correctly.

To create hints for every datapoint in a series, pass an array of strings, matching the structure of your data.

sp.AddHints(Product_descriptions);

Here, a product description could be associated with each pie sector, bar segment or marker.

You may also target hints at specific data points, for example:

sp.AddHints("July figures were adjusted",7);

Which will add a hint to this specific data-item in the first (or only) series.

Adding hints to fixed items

Hints may also be used to add extra information to standard text items such as notes or headings.

ch.AddHints(ScriptTarget.Footnote,"This is the current budget");

You may give an array of hints for multiple items such as XZones or the legend text.

See also ...

SharpPlot Members | AddTips Method | ScriptTarget Enumeration


SharpPlot 2.51 User Manual: AddHints Method (String)

SharpPlot.AddHints Method (String)

Define a single hint for all X values in all series.

public void AddHints(
    string hintText
);

This would only be useful on a small multiple, where the hint applies to the entire series.

See also ...

SharpPlot Members | AddHints Method


SharpPlot 2.51 User Manual: AddHints Method (String,Int32)

SharpPlot.AddHints Method (String,Int32)

Set a single hint for a specific X value on the first series.

public void AddHints(
    string hintText,
    int itemNumber
);

This could be used to add extra information about a particular data point.

See also ...

SharpPlot Members | AddHints Method


SharpPlot 2.51 User Manual: AddHints Method (String,Int32,String)

SharpPlot.AddHints Method (String,Int32,String)

Set a single hint for a specific X value in this series.

public void AddHints(
    string hintText,
    int itemNumber,
    string seriesName
);

This may be used to target a specific point if there are multiple series. Normally you would also explicitly name the series here.

See also ...

SharpPlot Members | AddHints Method | SetSeriesNames Method


SharpPlot 2.51 User Manual: AddHints Method (String[])

SharpPlot.AddHints Method (String[])

Apply an array of hints to all the XValues in the first series.

public void AddHints(
    string[] hintText
);

This is the commonest use of this method. An array of descriptions may be read from a database, and used to add extra information to the plotted values.

An alternative use is to add data-value information to 3D charts such as the Cloud chart (3D-scatter). It can be hard to see the exact position of the points against the axes, so it may be useful to hint each data-point with a string showing its x,y,z value. The user can then read off exact values with the mouse.

See also ...

SharpPlot Members | AddHints Method


SharpPlot 2.51 User Manual: AddHints Method (String[],String)

SharpPlot.AddHints Method (String[],String)

Apply an array of hints that apply to all the XValues in a given series.

public void AddHints(
    string[] hintText,
    string seriesName
);

This would be used if an array of hints was to be applied to a specific data series. You would normally name the series explicitly here.

sp.AddHints(Product_descriptions,"SalesRevenue");

This will add hints to each marker or bar in the series named “SalesRevenue”.

See also ...

SharpPlot Members | AddHints Method | SetSeriesNames Method


SharpPlot 2.51 User Manual: AddHints Method (String[][])

SharpPlot.AddHints Method (String[][])

Apply hints to matching data items in all series.

public void AddHints(
    string[][] hintText
);

This would be used to place hints automatically on multiple series.

sp.AddHints(new string[][] {Market1,Market2});

The hints might give more details about the data collected for a particular market or product line.

See also ...

SharpPlot Members | AddHints Method


SharpPlot 2.51 User Manual: AddHints Method (ScriptTarget,String)

SharpPlot.AddHints Method (ScriptTarget,String)

Apply a hint to a known text item.

public void AddHints(
    ScriptTarget targetId,
    string hintText
);

This may be used to add extra information to fixed text, such as a heading.

See also ...

SharpPlot Members | AddHints Method


SharpPlot 2.51 User Manual: AddHints Method (ScriptTarget,String[])

SharpPlot.AddHints Method (ScriptTarget,String[])

Apply an array of hints to a set of text items.

public void AddHints(
    ScriptTarget targetId,
    string[] hintText
);

This call may be used to add an array of hints to a text item such as the chart key.

sp.AddHints(ScriptTarget.Key,Product_descriptions);

Here, the product codes could be used to make a short legend, with the full description available to the user as a status-line hint.

See also ...

SharpPlot Members | AddHints Method


SharpPlot 2.51 User Manual: AddHyperlinks Method

SharpPlot.AddHyperlinks Method

Set up hyperlinks for one or more data points or a chart object.

Example

sp.AddHyperlinks("http://www.grapl.com");
sp.AddHyperlinks(new string[] {"north.htm","south.htm"});

Overloads

  • public void AddHyperlinks(string links);
  • public void AddHyperlinks(string links,int itemNumber);
  • public void AddHyperlinks(string links,int itemNumber,string seriesName);
  • public void AddHyperlinks(string[] links);
  • public void AddHyperlinks(string[] links,string seriesName);
  • public void AddHyperlinks(string[][] links);
  • public void AddHyperlinks(ScriptTarget targetId,string links);
  • public void AddHyperlinks(ScriptTarget targetId,string[] links);

This method is used to make ‘active’ graphics work on your web site. It allows you to associate any URL (typically the address of another page on your site) with a data point on the chart. You may define the jump explicitly by data item, giving the index of the data point in the series, and the target URL. For example:

sp.AddHyperlinks("boring.htm",2);
sp.DrawPieChart(New int[] {3,2,1});

The second pie slice will show a ‘pointing hand’ in the web browser and when clicked it will route you to the page ‘boring.htm’. To jump to an anchor within the target page add ‘#anchor’ to the tag as usual. To route the jump to a specific frame, add the frame id to the URL, separated with a semi-colon:

sp.AddHyperlinks("detail.htm#July;footnote",7);

This would be a good way to allow the user to click on the datapoints of a timeseries and see a summary of the numeric information for that datapoint in a second frame below the chart.

Setting up multiple links

If you have a target page for every datapoint, you can omit the item information entirely and simply supply an array of strings, shaped to match your data exactly.

sp.AddHyperlinks(new string[] {"North.htm","South.htm"});

This is probably the commonest call to this method, as the array of target pages could be read from a database in the same query as you use to obtain the values.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: AddHyperlinks Method (String)

SharpPlot.AddHyperlinks Method (String)

Define a single hyperlink for all X values in all series.

public void AddHyperlinks(
    string links
);

This would only be useful for a ‘blanket’ call, such as a link back to a home page.

See also ...

SharpPlot Members | AddHyperlinks Method


SharpPlot 2.51 User Manual: AddHyperlinks Method (String,Int32)

SharpPlot.AddHyperlinks Method (String,Int32)

Set a single link for a specific X value.

public void AddHyperlinks(
    string link,
    int itemNumber
);

This allows you to target a particular data-point with an HTML jump. It may be called multiple times if required to target a selection of points.

See also ...

SharpPlot Members | AddHyperlinks Method


SharpPlot 2.51 User Manual: AddHyperlinks Method (String,Int32,String)

SharpPlot.AddHyperlinks Method (String,Int32,String)

Set a single link for a specific X value in this series.

public void AddHyperlinks(
    string links,
    int itemNumber,
    string seriesName
);

This will target a specific item in a named series with an HTML jump.

See also ...

SharpPlot Members | AddHyperlinks Method | SetSeriesNames Method


SharpPlot 2.51 User Manual: AddHyperlinks Method (String[])

SharpPlot.AddHyperlinks Method (String[])

Apply an array of links to all the data items in the first series.

public void AddHyperlinks(
    string[] links
);

This will apply a set of links to the corresponding data items.

You may use this call with an array of blank (at least one blank character is required per item) strings to get a ‘pointing hand’ cursor shown over each point. This may be useful if the points also have JavaScript actions and you want to indicate this to the user.

See also ...

SharpPlot Members | AddHyperlinks Method


SharpPlot 2.51 User Manual: AddHyperlinks Method (String[],String)

SharpPlot.AddHyperlinks Method (String[],String)

Apply an array of links that apply to all the data items in a given series.

public void AddHyperlinks(
    string[] links,
    string seriesName
);

Normally, you would also name the series here.

See also ...

SharpPlot Members | AddHyperlinks Method | SetSeriesNames Method


SharpPlot 2.51 User Manual: AddHyperlinks Method (String[][])

SharpPlot.AddHyperlinks Method (String[][])

Apply links to matching data items in all series.

public void AddHyperlinks(
    string[][] links
);

This may be used to apply links to a set of series drawn in one or more plotting calls.

See also ...

SharpPlot Members | AddHyperlinks Method


SharpPlot 2.51 User Manual: AddHyperlinks Method (ScriptTarget,String)

SharpPlot.AddHyperlinks Method (ScriptTarget,String)

Apply a link to a known text item.

public void AddHyperlinks(
    ScriptTarget targetId,
    string link
);

This call could be used to add a jump back to a home page from a chart heading or footnote.

See also ...

SharpPlot Members | AddHyperlinks Method | ScriptTarget Enumeration


SharpPlot 2.51 User Manual: AddHyperlinks Method (ScriptTarget,String[])

SharpPlot.AddHyperlinks Method (ScriptTarget,String[])

Apply an array of links to a set of text items.

public void AddHyperlinks(
    ScriptTarget targetId,
    string[] links
);

This call would typically be used to add ‘drilldown’ capability to the chart key, or to switch dimension using the PageLabels.

See also ...

SharpPlot Members | AddHyperlinks Method | ScriptTarget Enumeration


SharpPlot 2.51 User Manual: AddJavaPrologue Method

SharpPlot.AddJavaPrologue Method

Add a javascript prologue to chart rendered as SVG or VML.

Example

sp.AddJavaPrologue(jsbarscript);

Overloads

  • public void AddJavaPrologue(string script);
  • public void AddJavaPrologue(string[] script);

This may be called repeatedly to add several JavaScript methods into the chart output stream. It would normally be called with a simple (newline separated) string of source code.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: AddJavaPrologue Method (String[])

SharpPlot.AddJavaPrologue Method (String[])

Include the definition of a JavaScript function in the output chart.

public void AddJavaPrologue(
    string[] script
);

See also ...

SharpPlot Members | AddJavaPrologue Method


SharpPlot 2.51 User Manual: AddJavaPrologue Method (String)

SharpPlot.AddJavaPrologue Method (String)

Add a single line function or give a link to a script file.

public void AddJavaPrologue(
    string script
);

See also ...

SharpPlot Members | AddJavaPrologue Method


SharpPlot 2.51 User Manual: AddTableShading Method

SharpPlot.AddTableShading Method

Add background color and optional shading to a table cell.

Example

sp.AddTableShading(4,1,Color.Aqua);
sp.AddTableShading(5,1,Color.Aqua);
sp.AddTableShading(6,1,Color.Firebrick,FillStyle.Opacity30);
sp.AddTableShading(2,2,Color.Firebrick,FillStyle.GradientBottomLeft);

Overloads

  • public void AddTableShading(int row,int col,Color cellColor);
  • public void AddTableShading(int row,int col,Color cellColor,FillStyle cellFill);

Table cells may be individually shaded, possibly to flag exceptions, for example negative values. Some tables (such as sports results) are conventionally drawn with the diagonal shaded grey, as a team can never play a match against itself.

This method may be called as many times as required to apply solid color or a colour and selected fill pattern cell by cell.

See also ...

SharpPlot Members | DrawTable Method | FillStyle Struct


SharpPlot 2.51 User Manual: AddTableShading Method (Int32,Int32,Color,FillStyle)

SharpPlot.AddTableShading Method (Int32,Int32,Color,FillStyle)

Add a combination of Color and Fill to an individual table cell.

public void AddTableShading(
    int row,
    int col,
    Color cellColor,
    FillStyle cellFill
);

See also ...

SharpPlot Members | AddTableShading Method


SharpPlot 2.51 User Manual: AddTableShading Method (Int32,Int32,Color)

SharpPlot.AddTableShading Method (Int32,Int32,Color)

Shade a cell in solid color.

public void AddTableShading(
    int row,
    int col,
    Color cellColor
);

See also ...

SharpPlot Members | AddTableShading Method


SharpPlot 2.51 User Manual: AddTips Method

SharpPlot.AddTips Method

Set tips for one or more data points or a chart object.

Example

sp.AddTips(new string[] {"Home","Export"});
sp.AddTips("Hello, world",7,"LastSeries");
sp.AddTips(ScriptTarget.Heading,"This is my chart");

Overloads

  • public void AddTips(string tipText);
  • public void AddTips(string tipText,int itemNumber);
  • public void AddTips(string tipText,int itemNumber,string seriesName);
  • public void AddTips(string[] tipText);
  • public void AddTips(string[] tipText,string seriesName);
  • public void AddTips(string[][] tipText);
  • public void AddTips(ScriptTarget targetId,string tipText);
  • public void AddTips(ScriptTarget targetId,string[] tipText);

Description

This method adds pop-up hints to a given set of data points, so that as you move the mouse over the data in the viewer, the hint can be shown in the status bar at the bottom of the screen. Hints are supported by VML (directly) and by images if you create an associated imagemap. Title tags are added to the SVG output, and may be rendered as pop-ups using JavaScript.

To create tips for every datapoint in a series, pass an array of strings, matching the structure of your data.

sp.AddTips(Product_descriptions);

Here, a product description could be associated with each pie sector, bar segment or marker.

You may also target specific data points, for example:

sp.AddTips("End of year",3);

Which will add a tip to this specific data-item in the first (or only) series.

Adding tips to fixed items

Tips may also be used to add extra information to standard text items such as notes or headings. You may give an array of hints for multiple items such as XZones or the legend text.

ch.AddTips(ScriptTarget.XZones,new string[]{"Reagan","Carter","Clinton"});

This would typically be used to annotate a ‘backcloth’ of historical events behind a timeseries.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: AddTips Method (String)

SharpPlot.AddTips Method (String)

Define a single tip for all X values in all series.

public void AddTips(
    string tipText
);

Useful only for small multiples, where all datapoints could have the series name as the tip.

See also ...

SharpPlot Members | AddTips Method


SharpPlot 2.51 User Manual: AddTips Method (String,Int32)

SharpPlot.AddTips Method (String,Int32)

Set a single tip for a specific X value.

public void AddTips(
    string tipText,
    int itemNumber
);

Targets a tip at the given X-value in the first (or only) series.

See also ...

SharpPlot Members | AddTips Method


SharpPlot 2.51 User Manual: AddTips Method (String,Int32,String)

SharpPlot.AddTips Method (String,Int32,String)

Set a single tip for a specific X value in this series.

public void AddTips(
    string tipText,
    int itemNumber,
    string seriesName
);

Targets a specific data-item in the given series.

See also ...

SharpPlot Members | AddTips Method | SetSeriesNames Method


SharpPlot 2.51 User Manual: AddTips Method (String[])

SharpPlot.AddTips Method (String[])

Apply an array of tips to all the XValues in the only series.

public void AddTips(
    string[] tipText
);

This call would typically take descriptions from a database, and apply them to a matching set of values retrieved with the same call. It can be used to add an extra ‘dimension’ to data, for example in a Contour plot of pressure against temperature, you may set a yield as the z-value to have contours drawn, and set the z-values as tips for all the points.

See also ...

SharpPlot Members | AddTips Method


SharpPlot 2.51 User Manual: AddTips Method (String[],String)

SharpPlot.AddTips Method (String[],String)

Apply an array of tips that apply to all the XValues in a given series.

public void AddTips(
    string[] tipText,
    string seriesName
);

Normally you would also name the series here.

See also ...

SharpPlot Members | AddTips Method | SetSeriesNames Method


SharpPlot 2.51 User Manual: AddTips Method (String[][])

SharpPlot.AddTips Method (String[][])

Apply tips to matching data items in all series.

public void AddTips(
    string[][] tipText
);

Called when several series are plotted in the same call, and you have matching tips for all of them.

See also ...

SharpPlot Members | AddTips Method


SharpPlot 2.51 User Manual: AddTips Method (ScriptTarget,String)

SharpPlot.AddTips Method (ScriptTarget,String)

Apply a tip to a known text item.

public void AddTips(
    ScriptTarget targetId,
    string tipText
);

This could be used to add extra information to a chart heading or note.

See also ...

SharpPlot Members | AddTips Method


SharpPlot 2.51 User Manual: AddTips Method (ScriptTarget,String[])

SharpPlot.AddTips Method (ScriptTarget,String[])

Apply an array of tips to a set of text items.

public void AddTips(
    ScriptTarget targetId,
    string[] tipText
);

Typically this would be used with the chart Key or PageLabels to add more information about a drill-down link.

See also ...

SharpPlot Members | AddTips Method


SharpPlot 2.51 User Manual: DefineFont Method

SharpPlot.DefineFont Method

Add a short code for a complex font definition.

Example

sp.DefineFont("AS","Arial,sans","filter:url(#MyShadow);opacity:0.8");

Overloads

  • public void DefineFont(string fontCode,string fontName);
  • public void DefineFont(string fontCode,string fontName,string fontCss);
  • public void DefineFont(string fontCode,string fontName,string fontCss,string fontPS);

Creating a stylesheet

This method may be used simply to define a ‘house style’ of fonts to save possible errors in typing the full name, and to make future change much simpler. You may give each font face a two-letter code, for example:

sp.DefineFont("VN","Verdana,sans");

From now on, you can use any of the four short codes ‘VN’ ‘VNB’ ‘VNI’ or ‘VNBI’ to get the four variants of this basic font. To have your Captions in Verdana,Italic, (at default size) you simply use:

sp.SetCaptionFont("VNI",Color.Teal);

If you are giving a long string of alternative font names for use as browser fall-backs, this clearly saves a good deal of typing. Longer abbreviations (up to 4 characters) will be accepted but may not be suffixed to make the variants.

Adding extra CSS details

SharpPlot allows you to insert any extra CSS properties you want after the font name. These are passed on to charts rendered as SVG or VML, and may be used for various special effects. They are ignored in images and PDF rendering.

sp.DefineFont("VN","Verdana,sans","opacity:0.8");

You can set any standard font property here, for example letter-spacing to open out heading text slightly.

Setting up PostScript equivalents

If you are generating an EPS document, you may need to map your screen font to a PostScript font known on the printer.

sp.DefineFont("VN","Verdana,sans","","Univers");

Check with the repro house to be sure you get the names exactly correct here!

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: DefineFont Method (String,String,String,String)

SharpPlot.DefineFont Method (String,String,String,String)

Create a definition for a font, including CSS details and PostScript name.

public void DefineFont(
    string fontCode,
    string fontName,
    string fontCss,
    string fontPS
);

See also ...

SharpPlot Members | DefineFont Method


SharpPlot 2.51 User Manual: DefineFont Method (String,String)

SharpPlot.DefineFont Method (String,String)

Associate a short code with a full font name.

public void DefineFont(
    string fontCode,
    string fontName
);

See also ...

SharpPlot Members | DefineFont Method


SharpPlot 2.51 User Manual: DefineFont Method (String,String,String)

SharpPlot.DefineFont Method (String,String,String)

Associate a short code with a font name and extra CSS details.

public void DefineFont(
    string fontCode,
    string fontName,
    string fontCss
);

See also ...

SharpPlot Members | DefineFont Method


SharpPlot 2.51 User Manual: DrawBarChart Method

SharpPlot.DrawBarChart Method

Constructs a grouped or stacked barchart from given data values.

Example

sp.SetMargins(12,12,18,4);
data = new int[] {18,27,31,12,19,23};
sp.DrawBarChart(data);

Barcharts may be drawn vertically or horizontally – the short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawBarChart(int[] data);
  • public void DrawBarChart(double[] data);
  • public void DrawBarChart(int[][] data);
  • public void DrawBarChart(double[][] data);

Description

Bar charts are generally used to represent data which fall in clear groupings (such as regional totals) where the bars are equally spaced along an arbitrary X-axis. The bars are often labelled with the data value, or possibly with the name of the group as an alternative to specifying X-axis labels.

SharpPlot treats arrays of arrays of values as representing multiple data series, and creates one group of bars for each series, so two series (each with 12 items) would make 12 pairs of bars, probably labelled ‘Jan’ ...’Dec’. By default, the bars are drawn as groups (you may control the spacing with the Gap and GroupGap properties) but the bars may also be stacked to show a cumulative total. The Key would generally be used to identify the groups – if you have used GroupBy to create the groups from a single column of data, the key is preset for you to the group names.

Barcharts are normally drawn vertically, but may be switched to horizontal if required. This is often a better style of the bar labels may be quite long, as it is easy to make more space in the left margin.

See also ...

Bar Charts for small series | SharpPlot Members | BarChartStyle Property | DrawXBarChart Method


SharpPlot 2.51 User Manual: DrawBarChart Method (Double[][])

SharpPlot.DrawBarChart Method (Double[][])

Draws a grouped or stacked barchart from an array of arrays of values.

public void DrawBarChart(
    double[][] data
);

See also ...

SharpPlot Members | DrawBarChart Method


SharpPlot 2.51 User Manual: DrawBarChart Method (Double[])

SharpPlot.DrawBarChart Method (Double[])

Draws a simple barchart from an array of values.

public void DrawBarChart(
    double[] data
);

See also ...

SharpPlot Members | DrawBarChart Method


SharpPlot 2.51 User Manual: DrawBarChart Method (Int32[][])

SharpPlot.DrawBarChart Method (Int32[][])

Draws a grouped or stacked barchart from an integer array of arrays of values.

public void DrawBarChart(
    int[][] data
);

See also ...

SharpPlot Members | DrawBarChart Method


SharpPlot 2.51 User Manual: DrawBarChart Method (Int32[])

SharpPlot.DrawBarChart Method (Int32[])

Draws a simple barchart from an array of integer values.

public void DrawBarChart(
    int[] data
);

See also ...

SharpPlot Members | DrawBarChart Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method

SharpPlot.DrawBoxPlot Method

Construct box-whisker plot from data and zero, one or two optional categories. The categories may be integer or string arrays (in any combination) or they may both be boolean arrays. The data may be an integer or double array.

Boxplots may be drawn vertically (the default) or horizontally. The short tutorial shows a few of the possibilities with a classic dataset from the 1930s.

Example

sp.SetMargins(12,12,18,4);
years = new int[] {1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,
         1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1931,1932,1932,1932,1932,
         1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,1932,
         1932,1932,1932,1932,1932};
yield = new int[] {27,48,27,39,32,28,43,55,28,38,29,29,35,47,25,40,29,25,39,50,26,
         41,23,26,26,33,34,32,22,22,36,37,35,26,14,25,27,38,35,20,16,22,26,37,38,32,
         32,22};
sp.SetColors(Color.Orange);
sp.YAxisStyle = YAxisStyles.ForceZero;
sp.DrawBoxPlot(yield,years);

Overloads

  • public void DrawBoxPlot(int[] data);
  • public void DrawBoxPlot(double[] data);
  • public void DrawBoxPlot(int[][] data);
  • public void DrawBoxPlot(double[][] data);
  • public void DrawBoxPlot(int[] data,int[] cat1);
  • public void DrawBoxPlot(int[] data,bool[] cat1);
  • public void DrawBoxPlot(double[] data,int[] cat1);
  • public void DrawBoxPlot(int[] data,string[] cat1);
  • public void DrawBoxPlot(double[] data,bool[] cat1);
  • public void DrawBoxPlot(double[] data,string[] cat1);
  • public void DrawBoxPlot(int[] data,int[] cat1,int[] cat2);
  • public void DrawBoxPlot(int[] data,bool[] cat1,bool[] cat2);
  • public void DrawBoxPlot(double[] data,int[] cat1,int[] cat2);
  • public void DrawBoxPlot(int[] data,string[] cat1,int[] cat2);
  • public void DrawBoxPlot(int[] data,int[] cat1,string[] cat2);
  • public void DrawBoxPlot(double[] data,bool[] cat1,bool[] cat2);
  • public void DrawBoxPlot(double[] data,string[] cat1,int[] cat2);
  • public void DrawBoxPlot(double[] data,int[] cat1,string[] cat2);
  • public void DrawBoxPlot(int[] data,string[] cat1,string[] cat2);
  • public void DrawBoxPlot(double[] data,string[] cat1,string[] cat2);

Description

Tukey’s Box-and-Whisker design is often the best way to approach a large dataset when it is not clear what the significant relationships are. The ‘box’ shows the span of the data between the lower and upper quartiles, with a bar drawn at the median value. The ‘Whiskers’ show the total span of the data – you can use the ‘Deciles’ style to have a dotted line drawn from the 10% and 90% points out to the extremes to reduce the visual impact of outliers.

See also ...

Box-and-Whisker Plots for multivariate data | SharpPlot Members | BoxPlotStyle Property


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Double[],Int32[],Int32[])

SharpPlot.DrawBoxPlot Method (Double[],Int32[],Int32[])

Construct compound box-whisker plot from a data array and two integer category arrays.

public void DrawBoxPlot(
    double[] data,
    int[] cat1,
    int[] cat2
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Double[],String[],String[])

SharpPlot.DrawBoxPlot Method (Double[],String[],String[])

Construct box-whisker plot from data array and two string categories.

public void DrawBoxPlot(
    double[] data,
    string[] cat1,
    string[] cat2
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Int32[],String[])

SharpPlot.DrawBoxPlot Method (Int32[],String[])

Construct box-whisker plot from integer data array and one string category.

public void DrawBoxPlot(
    int[] data,
    string[] cat1
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Int32[],String[],Int32[])

SharpPlot.DrawBoxPlot Method (Int32[],String[],Int32[])

Construct box-whisker plot from integer data array, one string and one integer category.

public void DrawBoxPlot(
    int[] data,
    string[] cat1,
    int[] cat2
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Int32[],Int32[],String[])

SharpPlot.DrawBoxPlot Method (Int32[],Int32[],String[])

Construct box-whisker plot from integer data array, one integer and one string category.

public void DrawBoxPlot(
    int[] data,
    int[] cat1,
    string[] cat2
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Int32[],String[],String[])

SharpPlot.DrawBoxPlot Method (Int32[],String[],String[])

Construct box-whisker plot from integer data array and two string categories.

public void DrawBoxPlot(
    int[] data,
    string[] cat1,
    string[] cat2
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Double[],Boolean[])

SharpPlot.DrawBoxPlot Method (Double[],Boolean[])

Construct box-whisker plot from data array and one boolean category.

public void DrawBoxPlot(
    double[] data,
    bool[] cat1
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Double[],Boolean[],Boolean[])

SharpPlot.DrawBoxPlot Method (Double[],Boolean[],Boolean[])

Construct box-whisker plot from data array and two boolean categories.

public void DrawBoxPlot(
    double[] data,
    bool[] cat1,
    bool[] cat2
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Int32[],Boolean[])

SharpPlot.DrawBoxPlot Method (Int32[],Boolean[])

Construct box-whisker plot from integer data array and one boolean category.

public void DrawBoxPlot(
    int[] data,
    bool[] cat1
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Int32[],Boolean[],Boolean[])

SharpPlot.DrawBoxPlot Method (Int32[],Boolean[],Boolean[])

Construct box-whisker plot from integer data array and two boolean categories.

public void DrawBoxPlot(
    int[] data,
    bool[] cat1,
    bool[] cat2
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Double[][])

SharpPlot.DrawBoxPlot Method (Double[][])

Take numeric array elements as pre-categorised data for Boxplot.

public void DrawBoxPlot(
    double[][] data
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Double[])

SharpPlot.DrawBoxPlot Method (Double[])

Construct box-whisker plot from data array.

public void DrawBoxPlot(
    double[] data
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Int32[][])

SharpPlot.DrawBoxPlot Method (Int32[][])

Take integer array elements as pre-categorised data for Boxplot.

public void DrawBoxPlot(
    int[][] data
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Double[],Int32[])

SharpPlot.DrawBoxPlot Method (Double[],Int32[])

Construct box-whisker plot from data array and one integer category.

public void DrawBoxPlot(
    double[] data,
    int[] cat1
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Int32[])

SharpPlot.DrawBoxPlot Method (Int32[])

Construct box-whisker plot from integer data array.

public void DrawBoxPlot(
    int[] data
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Int32[],Int32[])

SharpPlot.DrawBoxPlot Method (Int32[],Int32[])

Construct box-whisker plot from integer data array and one integer category.

public void DrawBoxPlot(
    int[] data,
    int[] cat1
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Int32[],Int32[],Int32[])

SharpPlot.DrawBoxPlot Method (Int32[],Int32[],Int32[])

Construct box-whisker plot from integer data array and two integer categories.

public void DrawBoxPlot(
    int[] data,
    int[] cat1,
    int[] cat2
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Double[],String[])

SharpPlot.DrawBoxPlot Method (Double[],String[])

Construct box-whisker plot from data array and one string category.

public void DrawBoxPlot(
    double[] data,
    string[] cat1
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Double[],String[],Int32[])

SharpPlot.DrawBoxPlot Method (Double[],String[],Int32[])

Construct box-whisker plot from data array, one string and one integer category.

public void DrawBoxPlot(
    double[] data,
    string[] cat1,
    int[] cat2
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBoxPlot Method (Double[],Int32[],String[])

SharpPlot.DrawBoxPlot Method (Double[],Int32[],String[])

Construct box-whisker plot from data array, one integer and one string category.

public void DrawBoxPlot(
    double[] data,
    int[] cat1,
    string[] cat2
);

See also ...

SharpPlot Members | DrawBoxPlot Method


SharpPlot 2.51 User Manual: DrawBubbleChart Method

SharpPlot.DrawBubbleChart Method

Make an incidence plot from x and y data and marker scales.

Example

sp.SetMargins(6,18,24,4);
sp.SetMarkers(Marker.Bullet);
sp.SetMarkerScales(5);
ydata = new int[] {190,270,310,120,190,230};
xdata = new int[] {17,31,29,14,16,24};
count = new int[] {12,65,77,7,9,112};
sp.BubbleChartStyle = BubbleChartStyles.ExplodeAxes|BubbleChartStyles.GridLines;
sp.DrawBubbleChart(ydata,xdata,count);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawBubbleChart(int[] yValues,int[] xValues,int[] markerArea);
  • public void DrawBubbleChart(int[] yValues,int[] xValues,double[] markerArea);
  • public void DrawBubbleChart(double[] yValues,double[] xValues,int[] markerArea);
  • public void DrawBubbleChart(double[] yValues,double[] xValues,double[] markerArea);

Description

This chart is a variant of the standard ScatterPlot with the size of the markers used to show an extra dimension in the data. The third argument gives the required marker area (typically the number of incidents recorded at a certain location) and all the markers are automatically scaled to cover the range of areas given.

Any marker may be used here (including user-defined markers) but simple solid circles are probably best. See the tutorial for some more possibilities.

See also ...

Bubble Charts for discrete XYZ data | SharpPlot Members | ScatterPlotStyle Property


SharpPlot 2.51 User Manual: DrawBubbleChart Method (Double[],Double[],Double[])

SharpPlot.DrawBubbleChart Method (Double[],Double[],Double[])

Scatterplot from 2 arrays of data with markers scaled by 3rd array.

public void DrawBubbleChart(
    double[] yValues,
    double[] xValues,
    double[] markerArea
);

See also ...

SharpPlot Members | DrawBubbleChart Method


SharpPlot 2.51 User Manual: DrawBubbleChart Method (Double[],Double[],Int32[])

SharpPlot.DrawBubbleChart Method (Double[],Double[],Int32[])

Make an incidence plot from x and y data and integer marker scales.

public void DrawBubbleChart(
    double[] yValues,
    double[] xValues,
    int[] markerArea
);

See also ...

SharpPlot Members | DrawBubbleChart Method


SharpPlot 2.51 User Manual: DrawBubbleChart Method (Int32[],Int32[],Double[])

SharpPlot.DrawBubbleChart Method (Int32[],Int32[],Double[])

Make an incidence plot from integer x and y data and double marker scales.

public void DrawBubbleChart(
    int[] yValues,
    int[] xValues,
    double[] markerArea
);

See also ...

SharpPlot Members | DrawBubbleChart Method


SharpPlot 2.51 User Manual: DrawBubbleChart Method (Int32[],Int32[],Int32[])

SharpPlot.DrawBubbleChart Method (Int32[],Int32[],Int32[])

Make an incidence plot from integer x and y data and marker scales.

public void DrawBubbleChart(
    int[] yValues,
    int[] xValues,
    int[] markerArea
);

See also ...

SharpPlot Members | DrawBubbleChart Method


SharpPlot 2.51 User Manual: DrawCloudChart Method

SharpPlot.DrawCloudChart Method

Draw 3D grid and construct 3D Scatter from x,y and z values.

Example

sp.SetMargins(0,12,18,4);
sp.SetMarkers(Marker.Bullet);
ydata = new int[] {19,27,31,12,19,23};
xdata = new int[] {7,31,29,14,16,24};
zdata = new int[] {12,65,77,7,9,112};
sp.CloudChartStyle = CloudChartStyles.WallShading|CloudChartStyles.GridLines|
         CloudChartStyles.Risers;
sp.SetMarkers(Marker.Ball);
sp.Perspective = 6;
sp.SetAxisStyle(Color.Gray,LineStyle.Solid,0.5);
sp.DrawCloudChart(xdata,ydata,zdata);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawCloudChart(int[] xValues,int[] yValues,int[] zValues);
  • public void DrawCloudChart(string[] xCategories,int[] yValues,int[] zValues);
  • public void DrawCloudChart(int[] xValues,string[] yCategories,int[] zValues);
  • public void DrawCloudChart(double[] xValues,double[] yValues,double[] zValues);
  • public void DrawCloudChart(string[] xCategories,int[] yValues,double[] zValues);
  • public void DrawCloudChart(int[] xValues,string[] yCategories,double[] zValues);
  • public void DrawCloudChart(string[] xCategories,string[] yCategories,int[] zValues);
  • public void DrawCloudChart(string[] xCategories,string[] yCategories,double[] zValues);
  • public void DrawCloudChart(int[] xValues,int[] yValues,double[][] zValues);
  • public void DrawCloudChart(double[] xValues,double[] yValues,double[][] zValues);

Description

The Cloud chart is essentially a scatter-plot in 3 dimensions (maybe you are running an experiment in which you vary pressure and temperature, and are interested in the yield of the result). Rather than fitting a line to show the relationship between input and output, you fit a plane (if the data is linear in both x and y) or a curved surface. The markers are often located in XY-space by drawing risers from the ‘paper’ – this makes it much easier to visualise where they are positioned.

In fact, the Cloudchart is much more versatile than this, as it can also be drawn with lines connecting the points, or planes shaded down to the XY plane (the Z-value is always assumed to be drawn vertically). The Tutorial gives several more examples, and of course multiple charts may be combined using a common set of axes to make quite complex diagrams in 3 dimensions.

See also ...

Cloud Charts for discrete XYZ data with perspective | SharpPlot Members | CloudChartStyle Property


SharpPlot 2.51 User Manual: DrawCloudChart Method (Double[],Double[],Double[][])

SharpPlot.DrawCloudChart Method (Double[],Double[],Double[][])

3D Scatter from x,y and multiple z values.

public void DrawCloudChart(
    double[] xValues,
    double[] yValues,
    double[][] zValues
);

See also ...

SharpPlot Members | DrawCloudChart Method


SharpPlot 2.51 User Manual: DrawCloudChart Method (String[],String[],Int32[])

SharpPlot.DrawCloudChart Method (String[],String[],Int32[])

3D scatter from category X,Y, int Z values.

public void DrawCloudChart(
    string[] xCategories,
    string[] yCategories,
    int[] zValues
);

See also ...

SharpPlot Members | DrawCloudChart Method


SharpPlot 2.51 User Manual: DrawCloudChart Method (Double[],Double[],Double[])

SharpPlot.DrawCloudChart Method (Double[],Double[],Double[])

3D scatter from 3 double arrays giving X,Y,Z values.

public void DrawCloudChart(
    double[] xValues,
    double[] yValues,
    double[] zValues
);

See also ...

SharpPlot Members | DrawCloudChart Method


SharpPlot 2.51 User Manual: DrawCloudChart Method (Int32[],Int32[],Double[][])

SharpPlot.DrawCloudChart Method (Int32[],Int32[],Double[][])

3D scatter from integer X,Y and multiple Z values.

public void DrawCloudChart(
    int[] xValues,
    int[] yValues,
    double[][] zValues
);

See also ...

SharpPlot Members | DrawCloudChart Method


SharpPlot 2.51 User Manual: DrawCloudChart Method (Int32[],Int32[],Int32[])

SharpPlot.DrawCloudChart Method (Int32[],Int32[],Int32[])

3D scatter from 3 arrays of integer X,Y,Z values.

public void DrawCloudChart(
    int[] xValues,
    int[] yValues,
    int[] zValues
);

See also ...

SharpPlot Members | DrawCloudChart Method


SharpPlot 2.51 User Manual: DrawCloudChart Method (String[],Int32[],Double[])

SharpPlot.DrawCloudChart Method (String[],Int32[],Double[])

3D scatter from category X, int Y, double Z values.

public void DrawCloudChart(
    string[] xCategories,
    int[] yValues,
    double[] zValues
);

See also ...

SharpPlot Members | DrawCloudChart Method


SharpPlot 2.51 User Manual: DrawCloudChart Method (Int32[],String[],Double[])

SharpPlot.DrawCloudChart Method (Int32[],String[],Double[])

3D scatter from int X, category Y, double Z values.

public void DrawCloudChart(
    int[] xValues,
    string[] yCategories,
    double[] zValues
);

See also ...

SharpPlot Members | DrawCloudChart Method


SharpPlot 2.51 User Manual: DrawCloudChart Method (String[],String[],Double[])

SharpPlot.DrawCloudChart Method (String[],String[],Double[])

3D scatter from category X,Y, double Z values.

public void DrawCloudChart(
    string[] xCategories,
    string[] yCategories,
    double[] zValues
);

See also ...

SharpPlot Members | DrawCloudChart Method


SharpPlot 2.51 User Manual: DrawCloudChart Method (String[],Int32[],Int32[])

SharpPlot.DrawCloudChart Method (String[],Int32[],Int32[])

3D scatter from category X, int Y,Z values.

public void DrawCloudChart(
    string[] xCategories,
    int[] yValues,
    int[] zValues
);

See also ...

SharpPlot Members | DrawCloudChart Method


SharpPlot 2.51 User Manual: DrawCloudChart Method (Int32[],String[],Int32[])

SharpPlot.DrawCloudChart Method (Int32[],String[],Int32[])

3D scatter from int X, category Y, int Z values.

public void DrawCloudChart(
    int[] xValues,
    string[] yCategories,
    int[] zValues
);

See also ...

SharpPlot Members | DrawCloudChart Method


SharpPlot 2.51 User Manual: DrawContourPlot Method

SharpPlot.DrawContourPlot Method

Generate contour plot from xyz values passed as 3 arrays.

Example

sp.SetMargins(6,18,18,4);
sp.SetMarkers(Marker.Bullet);
sp.ContourPlotStyle = ContourPlotStyles.GridLines|ContourPlotStyles.Curves;
sp.SetXTickMarks(50);
sp.SetZTickMarks(50);
sp.MeshDensity = 5;
ydata = new int[] {190,270,310,120,190,230};
xdata = new int[] {17,31,29,14,16,24};
elevation = new int[] {12,65,77,7,9,112};
sp.DrawContourPlot(ydata,xdata,elevation);

The short tutorial develops several examples, showing various strategies for contour fitting.

Overloads

  • public void DrawContourPlot(int[] xValues,int[] yValues,int[] zValues);
  • public void DrawContourPlot(double[] xValues,double[] yValues,double[] zValues);

Description

Contour plots are often an excellent alternative to 3D presentations where the object is to model three-dimensional data. Obviously, they can be used ‘just like a map’ where you may have a set of spot-heights (z-values) at various locations on the xy-plane. In this case, there is no particular shape assumed for the landscape, and the contours would simply be drawn to give the best ‘smooth interpretation’ of the recorded heights.

Another good use of contour plots is to fit some kind of model to the results from any experiment where two factors are systematically altered, and a third one is measured. In this case, the contours represent the model (they will simply be angled lines if the model is linear in both x and y directions) and make it very easy to read off the predicted result for any combination of input variables.

Several examples of various types of fitted contours are given in the tutorial. You will almost certainly need to experiment with the Order of fit and Flexibility properties to get the best results for your particular data.

See also ...

Contour | SharpPlot | Flexibility | ScatterPlotStyle | SetOrderOfFit


SharpPlot 2.51 User Manual: DrawContourPlot Method (Double[],Double[],Double[])

SharpPlot.DrawContourPlot Method (Double[],Double[],Double[])

Contour plot from 3 arrays of double values.

public void DrawContourPlot(
    double[] xValues,
    double[] yValues,
    double[] zValues
);

See also ...

SharpPlot Members | DrawContourPlot Method


SharpPlot 2.51 User Manual: DrawContourPlot Method (Int32[],Int32[],Int32[])

SharpPlot.DrawContourPlot Method (Int32[],Int32[],Int32[])

Contour plot from arrays of integers.

public void DrawContourPlot(
    int[] xValues,
    int[] yValues,
    int[] zValues
);

See also ...

SharpPlot Members | DrawContourPlot Method


SharpPlot 2.51 User Manual: DrawDialChart Method

SharpPlot.DrawDialChart Method

Draw a dial or gauge from one or more data values, with optional warning zones.

Example

sp.SetMargins(0,0,0,0);
sp.DialChartStyle = DialChartStyles.ArrowLines;
sp.SetXRange(100);
sp.DrawDialChart(23);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawDialChart(double data);
  • public void DrawDialChart(int[] data);
  • public void DrawDialChart(double[] data);
  • public void DrawDialChart(int[] data,int[] radii);
  • public void DrawDialChart(double[] data,int[] radii);

Description

The Dial or Gauge chart is often used to present a single value (maybe a benchmark index of company performance) in the context of an expected or desired range. The value on its own may mean very little (maybe our production plant made 23% rejects last week) until it is set in the context of the expected range (say 20% – 30% is normal, 30-40% is unusually poor, and so on). The dial chart can be set up with a range to cover the likely values, and a series of colored ‘zones’ to indicate the actions appropriate to each value – typically OK, Warning, Critical.

Dials are often grouped in the likeness of a dashboard or aircraft cockpit to give the user a degree of familiarity with the experience of monitoring the various instruments found in a vehicle or aeroplane.

See also ...

Dials and Gauges for isolated numbers | SharpPlot Members | DialChartStyle Property


SharpPlot 2.51 User Manual: DrawDialChart Method (Double[],Int32[])

SharpPlot.DrawDialChart Method (Double[],Int32[])

Draw a dial or gauge from data and pointer radii.

public void DrawDialChart(
    double[] data,
    int[] radii
);

See also ...

SharpPlot Members | DrawDialChart Method


SharpPlot 2.51 User Manual: DrawDialChart Method (Double[])

SharpPlot.DrawDialChart Method (Double[])

Draw a dial from an array of data values.

public void DrawDialChart(
    double[] data
);

See also ...

SharpPlot Members | DrawDialChart Method


SharpPlot 2.51 User Manual: DrawDialChart Method (Double)

SharpPlot.DrawDialChart Method (Double)

Draw a dial from a single data value.

public void DrawDialChart(
    double data
);

See also ...

SharpPlot Members | DrawDialChart Method


SharpPlot 2.51 User Manual: DrawDialChart Method (Int32[],Int32[])

SharpPlot.DrawDialChart Method (Int32[],Int32[])

Draw a dial from integer data values and pointer radii.

public void DrawDialChart(
    int[] data,
    int[] radii
);

See also ...

SharpPlot Members | DrawDialChart Method


SharpPlot 2.51 User Manual: DrawDialChart Method (Int32[])

SharpPlot.DrawDialChart Method (Int32[])

Draw a dial from an integer array of data values.

public void DrawDialChart(
    int[] data
);

See also ...

SharpPlot Members | DrawDialChart Method


SharpPlot 2.51 User Manual: DrawFrame Method

SharpPlot.DrawFrame Method

Draw current frame, with any fixed text such as headings and footnotes.

public void DrawFrame();

Example

sp.SetFrameBackground(Color.Bisque,FillStyle.Solid,1);
sp.FrameStyle = FrameStyles.Boxed|FrameStyles.Shadowed|FrameStyles.Filled;
sp.Heading = "My Frame\nis Here";
sp.Footnote = "Here is a sample footer";
sp.DrawFrame();

Description

This method is a convenient way of forcing SharpPlot to draw any headings or footers without actually drawing any charts. It may be used when your design requires a common heading (and possibly footer) which spans several smaller charts. In this case you would set up the text, call DrawFrame to create the ‘paper’ and then go on to use NewFrame as many times as required to add more charts to the same overall design.

It might also be used simply to create a region on which to add some text (written with DrawNote), so creating a title page for a series of charts to be saved (for example) as a multi-page PDF document.

See also ...

SharpPlot Members | FrameStyle Property


SharpPlot 2.51 User Manual: DrawGanttChart Method

SharpPlot.DrawGanttChart Method

Construct a horizontal Gantt chart from schedule data (activities and times).

Example

sp.SetMargins(6,12,36,4);
sp.SetColors(new Color[]{Color.OrangeRed,Color.ForestGreen});
sp.SetYLabels(new string[]{"Cut","Polish","Pack"});
sp.SetXTickMarks(5);
sp.SetYTickMarks(new double[] {0.5,1.5,2.5,3.5});
process = new int[] {1,1,2,2,2,3,3};
start = new int[] {24,28,25,29,35,29,42};
end = new int[] {28,32,29,33,40,30,44};
done = new bool[]{true,false,true,false,false,true,false};
sp.YAxisStyle = YAxisStyles.MiddleLabels|YAxisStyles.GridLines;
sp.KeyStyle = KeyStyles.NoKey;
sp.SplitBy(done);
sp.DrawGanttChart(process,start,end);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawGanttChart(int[] yValues,int[] startValues,int[] endValues);
  • public void DrawGanttChart(int[] yValues,double[] startValues,double[] endValues);
  • public void DrawGanttChart(double[] yValues,double[] startValues,double[] endValues);

Description

Gantt charts were originally devised as a graphical way to show the relationship between activites in a project plan, and have been made very popular by tools such as MS Project. The chart shows time progressing from left to right, with each activity drawn as a colored bar, and generally labelled with its name. The Y-axis shows some higher-level grouping of related tasks.

This style of chart also works very well as a way to show a production schedule (machines are shown on the Y-axis) or to record the output from any kind of logging system.

See also ...

Gantt Charts for timewise bars | SharpPlot Members | GanttChartStyle Property


SharpPlot 2.51 User Manual: DrawGanttChart Method (Double[],Double[],Double[])

SharpPlot.DrawGanttChart Method (Double[],Double[],Double[])

Gantt chart from 3 double arrays of Y-values, X-start and X-end values.

public void DrawGanttChart(
    double[] yValues,
    double[] startValues,
    double[] endValues
);

See also ...

SharpPlot Members | DrawGanttChart Method


SharpPlot 2.51 User Manual: DrawGanttChart Method (Int32[],Int32[],Int32[])

SharpPlot.DrawGanttChart Method (Int32[],Int32[],Int32[])

Gantt chart from 3 integer arrays of Y-values, X-start,end values.

public void DrawGanttChart(
    int[] yValues,
    int[] startValues,
    int[] endValues
);

See also ...

SharpPlot Members | DrawGanttChart Method


SharpPlot 2.51 User Manual: DrawGanttChart Method (Int32[],Double[],Double[])

SharpPlot.DrawGanttChart Method (Int32[],Double[],Double[])

Gantt chart from int y-values, double X-start,end values.

public void DrawGanttChart(
    int[] yValues,
    double[] startValues,
    double[] endValues
);

See also ...

SharpPlot Members | DrawGanttChart Method


SharpPlot 2.51 User Manual: DrawHistogram Method

SharpPlot.DrawHistogram Method

Construct a histogram plot from data and class-interval property.

Example

sp.SetMargins(12,12,18,4);
threedice = new int[] {9,8,6,11,9,14,11,8,9,14,12,7,6,11,15,14,11,7,5,8,7,9,6,7,12,
         7,13,8,9,13,7,7,8,12,11,16,12,9,11,12,12,12,9,14,8,9,13,11,10,13,11,13,9,
         10,10,4,14,8,9,11,12,5,12,15};
sp.HistogramStyle = HistogramStyles.NormalCurve|HistogramStyles.SurfaceShading;
sp.SetXRange(0,18);
sp.ClassInterval = 2;
sp.SetPenWidths(new int[] {1,3});
sp.DrawHistogram(threedice);

The short tutorial illustrates several ways to display a typical frequency distribution.

Overloads

  • public void DrawHistogram(int[] data);
  • public void DrawHistogram(double[] data);

Description

The Histogram does one very simple job – it takes a large sample of values and shows how they are grouped. Many samples of data turn out to follow a bell-shaped curve called the Normal distribution (the test data used in the tutorial simply sums several throws of 3 dice which follows this shape very well), but often the shape of the plot gives some useful clues which can be hidden simply by looking at statistics such as the Mean or Range.

Histograms can be drawn with a fitted Normal curve, which is often a good way to check if the underlying data really does have the assumed distribution.

See also ...

Histograms for distributions | SharpPlot Members | HistogramStyle Property


SharpPlot 2.51 User Manual: DrawHistogram Method (Double[])

SharpPlot.DrawHistogram Method (Double[])

Construct a histogram from a floating-point vector.

public void DrawHistogram(
    double[] data
);

See also ...

SharpPlot Members | DrawHistogram Method


SharpPlot 2.51 User Manual: DrawHistogram Method (Int32[])

SharpPlot.DrawHistogram Method (Int32[])

Construct a histogram from an integer vector.

public void DrawHistogram(
    int[] data
);

See also ...

SharpPlot Members | DrawHistogram Method


SharpPlot 2.51 User Manual: DrawImage Method

SharpPlot.DrawImage Method

This will add a predrawn artwork (typically a bitmap or JPEG) to the current chart.

Example

 data = new int[] {18,27,31,12,19,23};
// Draw image on backcloth (top right)
 sp.DrawImage("ettons.png","",-6,6,40);
 sp.DrawLineGraph(data);
// Draw image using chart co-ordinates
 sp.DrawImage("ettons.png","",2,35,1);

The bitmap object/filename is used to get the data to include in embedded formats (required if the chart is saved to an image format, or to PDF), and the uri is used as the link target for web-based formats such as SVG or VML. If you only give the filename, the two are assumed to be the same.

Overloads

  • public void DrawImage(Bitmap bmp,double left,double top);
  • public void DrawImage(string filename,double left,double top);
  • public void DrawImage(Bitmap bmp,string uri,double left,double top);
  • public void DrawImage(string filename,string uri,double left,double top);
  • public void DrawImage(Bitmap bmp,string uri,double left,double top,double width);
  • public void DrawImage(string filename,string uri,double left,double top,double width);
  • public void DrawImage(Bitmap bmp,string uri,double left,double top,double width,double height);
  • public void DrawImage(string filename,string uri,double left,double top,double width,double height);

Description

If the image is added before any charts have been drawn, the co-ordinates used are points, measured from the top left corner of the paper. You may give negative values for either top or left, in which case the image is placed the corresponding distance from the opposite edge. This is a convenient way to place a company logo in any of the corners of the finished chart.

If the image is added after a chart has been drawn, the chart axes are used as the co-ordinate system for the placement of the top left corner of the image, and also to determine how large it is drawn.

In both cases, if you omit width and height the image is placed at actual size (one pixel = one point) and if you give a required width only, the height is scaled to preserve the correct aspect ratio.


SharpPlot 2.51 User Manual: DrawImage Method (Bitmap,String,Double,Double,Double,Double)

SharpPlot.DrawImage Method (Bitmap,String,Double,Double,Double,Double)

Add image at given width with alternative uri.

public void DrawImage(
    Bitmap bmp,
    string uri,
    double left,
    double top,
    double width,
    double height
);

See also ...

SharpPlot Members | DrawImage Method


SharpPlot 2.51 User Manual: DrawImage Method (Bitmap,String,Double,Double,Double)

SharpPlot.DrawImage Method (Bitmap,String,Double,Double,Double)

Add image at given width with alternative uri.

public void DrawImage(
    Bitmap bmp,
    string uri,
    double left,
    double top,
    double width
);

See also ...

SharpPlot Members | DrawImage Method


SharpPlot 2.51 User Manual: DrawImage Method (Bitmap,String,Double,Double)

SharpPlot.DrawImage Method (Bitmap,String,Double,Double)

Add image at actual size with alternative uri.

public void DrawImage(
    Bitmap bmp,
    string uri,
    double left,
    double top
);

See also ...

SharpPlot Members | DrawImage Method


SharpPlot 2.51 User Manual: DrawImage Method (Bitmap,Double,Double)

SharpPlot.DrawImage Method (Bitmap,Double,Double)

Add image at actual size at given location.

public void DrawImage(
    Bitmap bmp,
    double left,
    double top
);

See also ...

SharpPlot Members | DrawImage Method


SharpPlot 2.51 User Manual: DrawImage Method (String,String,Double,Double,Double,Double)

SharpPlot.DrawImage Method (String,String,Double,Double,Double,Double)

Add artwork at given width with alternative uri.

public void DrawImage(
    string filename,
    string uri,
    double left,
    double top,
    double width,
    double height
);

See also ...

SharpPlot Members | DrawImage Method


SharpPlot 2.51 User Manual: DrawImage Method (String,String,Double,Double,Double)

SharpPlot.DrawImage Method (String,String,Double,Double,Double)

Add artwork at given width with alternative uri.

public void DrawImage(
    string filename,
    string uri,
    double left,
    double top,
    double width
);

See also ...

SharpPlot Members | DrawImage Method


SharpPlot 2.51 User Manual: DrawImage Method (String,String,Double,Double)

SharpPlot.DrawImage Method (String,String,Double,Double)

Add artwork at actual size with alternative uri.

public void DrawImage(
    string filename,
    string uri,
    double left,
    double top
);

See also ...

SharpPlot Members | DrawImage Method


SharpPlot 2.51 User Manual: DrawImage Method (String,Double,Double)

SharpPlot.DrawImage Method (String,Double,Double)

Add artwork at actual size.

public void DrawImage(
    string filename,
    double left,
    double top
);

See also ...

SharpPlot Members | DrawImage Method


SharpPlot 2.51 User Manual: DrawKey Method

SharpPlot.DrawKey Method

This will draw and clear any pending keys, using the current setting of key text. It is called automatically on Rendering the completed chart, so is only required if you need an exact key location or a custom-designed key. Use the KeyLimit property to restrict the number of items used at each call.

Example

sp.KeyStyle = KeyStyles.Boxed|KeyStyles.Vertical|KeyStyles.Shadowed|KeyStyles.Rounded;
sp.SetKeyBackground(Color.SlateBlue,FillStyle.Solid);
sp.SetKeyFont("Arial,sans",12,FontStyle.Bold,Color.Orange);
sp.SetKeyText(new string[]{"First","Second"});
sp.DrawKey(2,260);

Overloads

  • public void DrawKey();
  • public void DrawKey(KeyDefinition keydef);
  • public void DrawKey(double keyPositionX,double keyPositionY);
  • public void DrawKey(double keyPositionX,double keyPositionY,KeyDefinition keydef);
  • public void DrawKey(double keyPositionX,double keyPositionY,KeyDefinition[] keyDefinition);

Description

The chart Key or Legend consists of small placeholders for each line or filled area (appropriately coloured and styled) with an item of descriptive text for each. When any of the Draw methods is called to create a chart (you may call these repeatedly with various series to reuse the same set of axes) a placeholder is stored away to represent all the series plotted on that call. When the chart is rendered, DrawKey is called automatically to check if any KeyText has been set for the various series. If so, a placeholder and associated text are drawn as specified in the KeyStyle setting.

This method may be used to position the key ‘by hand’ anywhere in the chart area instead of at one of the many default locations which may be given in the style. It should always be called after all the charts have been drawn, otherwise the key placeholders will not be available for all the data series.

It is possible to override the automatic key-generation process completely using the first of the 3 overloads shown, passing an array of key-definitions as the 3rd argument.

   sp.SetKeyText(new string[] {"Corals","Latiproductus"});
    sp.KeyStyle = KeyStyles.Vertical|KeyStyles.Boxed;
    sp.DrawKey(72,25,
        new KeyDefinition[] {
          new KeyDefinition(2,Color.Maroon),
          new KeyDefinition(2,Color.Green) } )

This example is from the ‘Wise Eel’s Bridge’ cellular plot in the sample set.

See also ...

SharpPlot Members | KeyLimit Property | KeyStyle Property | SetKeyIndices Method


SharpPlot 2.51 User Manual: DrawKey Method (Double,Double,KeyDefinition[])

SharpPlot.DrawKey Method (Double,Double,KeyDefinition[])

Force key to be drawn for this chart at requested location using specified key type.

public void DrawKey(
    double keyPositionX,
    double keyPositionY,
    KeyDefinition[] keyDefinition
);

See also ...

SharpPlot Members | DrawKey Method


SharpPlot 2.51 User Manual: DrawKey Method ()

SharpPlot.DrawKey Method ()

Flush out standard key at default position.

public void DrawKey();

See also ...

SharpPlot Members | DrawKey Method


SharpPlot 2.51 User Manual: DrawKey Method (KeyDefinition)

SharpPlot.DrawKey Method (KeyDefinition)

Flush out custom key at default position.

public void DrawKey(
    KeyDefinition keydef
);

See also ...

SharpPlot Members | DrawKey Method


SharpPlot 2.51 User Manual: DrawKey Method (Double,Double,KeyDefinition)

SharpPlot.DrawKey Method (Double,Double,KeyDefinition)

Place customised key at (x,y).

public void DrawKey(
    double keyPositionX,
    double keyPositionY,
    KeyDefinition keydef
);

See also ...

SharpPlot Members | DrawKey Method


SharpPlot 2.51 User Manual: DrawKey Method (Double,Double)

SharpPlot.DrawKey Method (Double,Double)

Place standard key at (x,y).

public void DrawKey(
    double keyPositionX,
    double keyPositionY
);

See also ...

SharpPlot Members | DrawKey Method


SharpPlot 2.51 User Manual: DrawLineGraph Method

SharpPlot.DrawLineGraph Method

Constructs a linegraph or surface plot from an array of data values. This chart is typically used to show timeseries data, but may also be used with an explicit set of X-values to draw any mathematical curve.

Example

sp.SetMargins(12,12,18,4);
sp.LineGraphStyle = LineGraphStyles.Risers;
data = new int[] {18,27,31,12,19,23};
sp.DrawLineGraph(data);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawLineGraph(int[] data);
  • public void DrawLineGraph(double[] data);
  • public void DrawLineGraph(int[][] data);
  • public void DrawLineGraph(double[][] data);
  • public void DrawLineGraph(int[] data,int[] xValues);
  • public void DrawLineGraph(double[] data,int[] xValues);
  • public void DrawLineGraph(int[] data,double[] xValues);
  • public void DrawLineGraph(double[] data,double[] xValues);
  • public void DrawLineGraph(int[][] data,int[] xValues);
  • public void DrawLineGraph(double[][] data,int[] xValues);
  • public void DrawLineGraph(int[][] data,double[] xValues);
  • public void DrawLineGraph(double[][] data,double[] xValues);

Description

Linegraphs are most commonly used to represent data which changes over time (stock prices or currency values are typical) but may be used wherever pairs of X and Y values are joined by lines. The default is to join the points with straight lines, but for some applications (for example illustrating a graph of Y-squared versus X) then it is better to use smooth curves.

This chart has a wide variety of styles, for example it can draw risers from the X-axis, fill the surface, add arrowheads to the end of each line, and so on. These styles can be combined as required by calling DrawLineGraph several times with different style settings to overlay multiple charts on the same set of axes.

See also ...

Line Graphs and Time Series | SharpPlot Members | LineGraphStyle Property


SharpPlot 2.51 User Manual: DrawLineGraph Method (Double[][],Double[])

SharpPlot.DrawLineGraph Method (Double[][],Double[])

Construct plot from array of arrays of y values and x-values.

public void DrawLineGraph(
    double[][] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawLineGraph Method (Int32[],Double[])

SharpPlot.DrawLineGraph Method (Int32[],Double[])

Construct plot from integer array of y-values and double array of x-values.

public void DrawLineGraph(
    int[] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawLineGraph Method (Int32[],Int32[])

SharpPlot.DrawLineGraph Method (Int32[],Int32[])

Construct plot from integer array of y-values and x-values.

public void DrawLineGraph(
    int[] data,
    int[] xValues
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawLineGraph Method (Int32[])

SharpPlot.DrawLineGraph Method (Int32[])

Construct plot from integer array of y-values and implied x-values.

public void DrawLineGraph(
    int[] data
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawLineGraph Method (Double[][],Int32[])

SharpPlot.DrawLineGraph Method (Double[][],Int32[])

Construct plot from array of arrays of y-values and integer x-values.

public void DrawLineGraph(
    double[][] data,
    int[] xValues
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawLineGraph Method (Double[][])

SharpPlot.DrawLineGraph Method (Double[][])

Construct plot from array of arrays of y-values and implied x-values.

public void DrawLineGraph(
    double[][] data
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawLineGraph Method (Double[],Double[])

SharpPlot.DrawLineGraph Method (Double[],Double[])

Construct plot from array of y-values and array of x-values.

public void DrawLineGraph(
    double[] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawLineGraph Method (Double[],Int32[])

SharpPlot.DrawLineGraph Method (Double[],Int32[])

Construct plot from array of y-values and integer array of x-values.

public void DrawLineGraph(
    double[] data,
    int[] xValues
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawLineGraph Method (Double[])

SharpPlot.DrawLineGraph Method (Double[])

Construct plot from array of y-values and implied x-values.

public void DrawLineGraph(
    double[] data
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawLineGraph Method (Int32[][],Double[])

SharpPlot.DrawLineGraph Method (Int32[][],Double[])

Construct plot from integer array of arrays of y-values and double x-values.

public void DrawLineGraph(
    int[][] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawLineGraph Method (Int32[][],Int32[])

SharpPlot.DrawLineGraph Method (Int32[][],Int32[])

Construct plot from integer array of arrays of y-values and x-values.

public void DrawLineGraph(
    int[][] data,
    int[] xValues
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawLineGraph Method (Int32[][])

SharpPlot.DrawLineGraph Method (Int32[][])

Construct plot from integer array of arrays of y-values and implied x-values.

public void DrawLineGraph(
    int[][] data
);

See also ...

SharpPlot Members | DrawLineGraph Method


SharpPlot 2.51 User Manual: DrawMinMaxChart Method

SharpPlot.DrawMinMaxChart Method

Construct hi-lo plot, joining maximum with minimum data values for each axis value.

Example

sp.SetMargins(12,12,18,4);
open = new int[] {190,150,310,240,140,170};
close = new int[] {150,310,240,140,170,240};
xdata = new int[] {17,18,19,22,23,24};
sp.SetMarkers(Marker.Bullet);
sp.MinMaxChartStyle = MinMaxChartStyles.ArrowLines|MinMaxChartStyles.DriftMarkers;
sp.DrawMinMaxChart(open,close,xdata);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawMinMaxChart(int[] maxValues);
  • public void DrawMinMaxChart(double[] maxValues);
  • public void DrawMinMaxChart(int[] maxValues,int[] minValues);
  • public void DrawMinMaxChart(double[] maxValues,double[] minValues);
  • public void DrawMinMaxChart(int[] maxValues,int[] minValues,int[] axisValues);
  • public void DrawMinMaxChart(double[] maxValues,double[] minValues,int[] axisValues);
  • public void DrawMinMaxChart(double[] maxValues,double[] minValues,double[] axisValues);

Description

Some data series are best represented by their range at each time-value. Temperature data is typical – here the most informative chart shows the maximum and minimum values by day, with the range drawn as a vertical line. This chart is also commonly used for stock-price data where the daily high and low may be combined with opening and closing values to produce a wide variety of typical ‘Wall Street Journal’ plots of the market data.

This chart is normally drawn vertically, but may be switched around using the ‘Horizontal’ style where it is more appropriate to show the range running across the page.

See also ...

Min-Max or Hi-Lo Charts | SharpPlot Members | MinMaxChartStyle Property


SharpPlot 2.51 User Manual: DrawMinMaxChart Method (Double[],Double[],Double[])

SharpPlot.DrawMinMaxChart Method (Double[],Double[],Double[])

Create hi-lo plot from arrays of max,min and optional axis values.

public void DrawMinMaxChart(
    double[] maxValues,
    double[] minValues,
    double[] axisValues
);

See also ...

SharpPlot Members | DrawMinMaxChart Method


SharpPlot 2.51 User Manual: DrawMinMaxChart Method (Double[],Double[],Int32[])

SharpPlot.DrawMinMaxChart Method (Double[],Double[],Int32[])

Double arays of Max and Min with integer Axis values.

public void DrawMinMaxChart(
    double[] maxValues,
    double[] minValues,
    int[] axisValues
);

See also ...

SharpPlot Members | DrawMinMaxChart Method


SharpPlot 2.51 User Manual: DrawMinMaxChart Method (Double[],Double[])

SharpPlot.DrawMinMaxChart Method (Double[],Double[])

Double arrays of Max and Min values.

public void DrawMinMaxChart(
    double[] maxValues,
    double[] minValues
);

See also ...

SharpPlot Members | DrawMinMaxChart Method


SharpPlot 2.51 User Manual: DrawMinMaxChart Method (Double[])

SharpPlot.DrawMinMaxChart Method (Double[])

Double arrays of Maximum values.

public void DrawMinMaxChart(
    double[] maxValues
);

See also ...

SharpPlot Members | DrawMinMaxChart Method


SharpPlot 2.51 User Manual: DrawMinMaxChart Method (Int32[],Int32[],Int32[])

SharpPlot.DrawMinMaxChart Method (Int32[],Int32[],Int32[])

Integer arrays of Max, Min, and Axis values.

public void DrawMinMaxChart(
    int[] maxValues,
    int[] minValues,
    int[] axisValues
);

See also ...

SharpPlot Members | DrawMinMaxChart Method


SharpPlot 2.51 User Manual: DrawMinMaxChart Method (Int32[],Int32[])

SharpPlot.DrawMinMaxChart Method (Int32[],Int32[])

Integer arrays of Max and Min values.

public void DrawMinMaxChart(
    int[] maxValues,
    int[] minValues
);

See also ...

SharpPlot Members | DrawMinMaxChart Method


SharpPlot 2.51 User Manual: DrawMinMaxChart Method (Int32[])

SharpPlot.DrawMinMaxChart Method (Int32[])

Integer array of Maximum values.

public void DrawMinMaxChart(
    int[] maxValues
);

See also ...

SharpPlot Members | DrawMinMaxChart Method


SharpPlot 2.51 User Manual: DrawMultiple Method

SharpPlot.DrawMultiple Method

Generate a trellis from nested y-values and iterate around it for each data vector.

Example

sp.SetPageLabels(new string[]{"North","South","East","West"});
sp.SetCaptionFont("TI",18,Color.Navy);
sp.TrellisStyle = TrellisStyles.SnakingCells;
series = new int[][]{new int[]{3,2,4},new int[]{5,4,3},new int[]{1,3,2},new int[]{3,2,4}};
sp.DrawMultiple(ChartType.BarChart,series);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawMultiple(ChartType chartType,int[] data);
  • public void DrawMultiple(ChartType chartType,double[] data);
  • public void DrawMultiple(ChartType chartType,int[][] data);
  • public void DrawMultiple(ChartType chartType,double[][] data);
  • public void DrawMultiple(ChartType chartType,int[][] data,int[] xValues);
  • public void DrawMultiple(ChartType chartType,int[][] data,double[] xValues);
  • public void DrawMultiple(ChartType chartType,double[][] data,double[] xValues);

Description

One of the best innovations in Tufte’s “The Visual Display of Quantitative Information” is the idea of using an array of miniature charts to display multi-dimensional data. Often a series of values are recorded at (say) several sites or on several days, then are superimposed on a single chart as a collection of dotted and dashed lines in various colors. This often makes it very hard to see the patterns and relationships in the data. The ‘Multiple’ plots each series on its own chart, and arranges them automatically in a trellis to allow easy comparison between them

Note that the Multiple chart has no style settings – it simply iterates around the chosen chart type, which applies the settings appropriate for that chart.

See also ...

Multiples for small thumbnails | SharpPlot Members


SharpPlot 2.51 User Manual: DrawMultiple Method (ChartType,Double[][],Double[])

SharpPlot.DrawMultiple Method (ChartType,Double[][],Double[])

Multiple plot from double array of arrays of y-values versus double x-values.

public void DrawMultiple(
    ChartType chartType,
    double[][] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawMultiple Method


SharpPlot 2.51 User Manual: DrawMultiple Method (ChartType,Double[][])

SharpPlot.DrawMultiple Method (ChartType,Double[][])

Multiple plot from array of double arrays.

public void DrawMultiple(
    ChartType chartType,
    double[][] data
);

See also ...

SharpPlot Members | DrawMultiple Method


SharpPlot 2.51 User Manual: DrawMultiple Method (ChartType,Int32[][],Int32[])

SharpPlot.DrawMultiple Method (ChartType,Int32[][],Int32[])

Multiple plot from integer array of arrays and integer xvalues.

public void DrawMultiple(
    ChartType chartType,
    int[][] data,
    int[] xValues
);

See also ...

SharpPlot Members | DrawMultiple Method


SharpPlot 2.51 User Manual: DrawMultiple Method (ChartType,Int32[][],Double[])

SharpPlot.DrawMultiple Method (ChartType,Int32[][],Double[])

Multiple plot from integer array of arrays of y-values and double xvalues.

public void DrawMultiple(
    ChartType chartType,
    int[][] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawMultiple Method


SharpPlot 2.51 User Manual: DrawMultiple Method (ChartType,Int32[][])

SharpPlot.DrawMultiple Method (ChartType,Int32[][])

Multiple plot from integer array of arrays.

public void DrawMultiple(
    ChartType chartType,
    int[][] data
);

See also ...

SharpPlot Members | DrawMultiple Method


SharpPlot 2.51 User Manual: DrawMultiple Method (ChartType,Double[])

SharpPlot.DrawMultiple Method (ChartType,Double[])

Multiple plot from double array and SplitBy setting.

public void DrawMultiple(
    ChartType chartType,
    double[] data
);

See also ...

SharpPlot Members | DrawMultiple Method


SharpPlot 2.51 User Manual: DrawMultiple Method (ChartType,Int32[])

SharpPlot.DrawMultiple Method (ChartType,Int32[])

Multiple plot from integer array and SplitBy setting.

public void DrawMultiple(
    ChartType chartType,
    int[] data
);

See also ...

SharpPlot Members | DrawMultiple Method


SharpPlot 2.51 User Manual: DrawNote Method

SharpPlot.DrawNote Method

Write text note at XY co-ordinate or absolute position with optional rotation and max width.

Example

sp.SetNoteFont("Arial",12);
sp.NoteStyle = NoteStyles.Boxed|NoteStyles.Shadowed;
sp.DrawNote("A simple wrapped note in a box",10,70,0,50);

Overloads

  • public void DrawNote(string content,double xPosition,double yPosition);
  • public void DrawNote(string content,double xPosition,double yPosition,double angleFromHorizontal);
  • public void DrawNote(string content,double xPosition,double yPosition,double angleFromHorizontal,double width);

Description

Notes are used to write arbitrary text fragments anywhere on the completed chart. Typically, notes are written using the co-ordinates of the chart axes to locate them on the chart (to annotate particular data-points) so DrawNote is generally called after the chart has been drawn, and the axes established.

The note text may be angled, and may be wrapped into a given width (again given in terms of the chart axes) which allows reasonably complex paragraphs of text to be added to the completed chart. Various effects such as boxing and shadowing are also available using the Note Styles.

Simple HTML tagging (for effects such as bold and italic text) may be used in the notes, and the wrapping will take care of the current SoftHyphen setting.

See also ...

SharpPlot Members | NoteStyle Property | NextNote Method (Double)


SharpPlot 2.51 User Manual: DrawNote Method (String,Double,Double,Double,Double)

SharpPlot.DrawNote Method (String,Double,Double,Double,Double)

Write text note given text, position, angle and maximum width.

public void DrawNote(
    string content,
    double xPosition,
    double yPosition,
    double angleFromHorizontal,
    double width
);

See also ...

SharpPlot Members | DrawNote Method


SharpPlot 2.51 User Manual: DrawNote Method (String,Double,Double,Double)

SharpPlot.DrawNote Method (String,Double,Double,Double)

Write text note given text, position and angle.

public void DrawNote(
    string content,
    double xPosition,
    double yPosition,
    double angleFromHorizontal
);

See also ...

SharpPlot Members | DrawNote Method


SharpPlot 2.51 User Manual: DrawNote Method (String,Double,Double)

SharpPlot.DrawNote Method (String,Double,Double)

Write text note given text and position.

public void DrawNote(
    string content,
    double xPosition,
    double yPosition
);

See also ...

SharpPlot Members | DrawNote Method


SharpPlot 2.51 User Manual: DrawPieChart Method

SharpPlot.DrawPieChart Method

Constructs a piechart from an array of data values and optional segment explosions.

Example

sp.SetMargins(0,0,0,0);
sp.PieChartStyle = PieChartStyles.ValueTags;
sp.ValueTagStyle = ValueTagStyles.Inside;
sp.SetValueFont("Arial",18,FontStyle.Bold,Color.White);
data = new int[] {31,23,16,8};
expl = new int[] {0,0,25,0};
sp.DrawPieChart(data,expl);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawPieChart(int[] data);
  • public void DrawPieChart(double[] data);
  • public void DrawPieChart(int[] data,int[] explode);
  • public void DrawPieChart(double[] data,int[] explode);

Description

The Piechart is typically used to show how some total value is divided up, for example sales in two or more regions. It works best when there are only a few values, and they should be ranked in numerical order to facilitate comparison of the sctor sizes. Pies are often labelled with the actual values in the sectors, and one or more sectors may be ‘exploded’ to emphasise certain values.

If there are more than 5 or 6 values, and it is important for the user to be able to compare values accurately, the simple Barchart is almost always a better format.

See also ...

Pie Charts and Rose Diagrams | SharpPlot Members | PieChartStyle Property


SharpPlot 2.51 User Manual: DrawPieChart Method (Double[],Int32[])

SharpPlot.DrawPieChart Method (Double[],Int32[])

Piechart from data and sector explosions as percentages.

public void DrawPieChart(
    double[] data,
    int[] explode
);

See also ...

SharpPlot Members | DrawPieChart Method


SharpPlot 2.51 User Manual: DrawPieChart Method (Double[])

SharpPlot.DrawPieChart Method (Double[])

Piechart from array of data.

public void DrawPieChart(
    double[] data
);

See also ...

SharpPlot Members | DrawPieChart Method


SharpPlot 2.51 User Manual: DrawPieChart Method (Int32[],Int32[])

SharpPlot.DrawPieChart Method (Int32[],Int32[])

Piechart from integer array of data and sector explosions.

public void DrawPieChart(
    int[] data,
    int[] explode
);

See also ...

SharpPlot Members | DrawPieChart Method


SharpPlot 2.51 User Manual: DrawPieChart Method (Int32[])

SharpPlot.DrawPieChart Method (Int32[])

Piechart from integer array of data.

public void DrawPieChart(
    int[] data
);

See also ...

SharpPlot Members | DrawPieChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method

SharpPlot.DrawPolarChart Method

Construct polar or radar chart from data (radial=Y, angular=X).

Example

sp.SetMargins(12,6,0,0);
sp.PolarChartStyle = PolarChartStyles.Markers|PolarChartStyles.SurfaceShading|
         PolarChartStyles.GridLines|PolarChartStyles.HollowCenter;
sp.SetYRange(0,100);
sp.SetFillStyles(FillStyle.Opacity30);
sp.SetMarkers(Marker.Lozenge);
sp.SetXLabels(new string[]{"Strong","Fast","Tough","Versatile","Cheap"});
sp.DrawPolarChart(new int[] {80,60,45,77,93});

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawPolarChart(int[] data);
  • public void DrawPolarChart(double[] data);
  • public void DrawPolarChart(int[][] data);
  • public void DrawPolarChart(double[][] data);
  • public void DrawPolarChart(int[] data,int[] xValues);
  • public void DrawPolarChart(double[] data,int[] xValues);
  • public void DrawPolarChart(int[] data,double[] xValues);
  • public void DrawPolarChart(double[] data,double[] xValues);
  • public void DrawPolarChart(int[][] data,int[] xValues);
  • public void DrawPolarChart(double[][] data,int[] xValues);
  • public void DrawPolarChart(int[][] data,double[] xValues);
  • public void DrawPolarChart(double[][] data,double[] xValues);

Description

The Polar chart (also known as the Radar chart) may be used in several ways to handle cyclic timeseries or comparisons on many dimensions. If it is called with a simple list of numbers, it treats each value as a logical axis and simply plots the values out as a star shape with as many points as there were values. This can be used very effectively to compare items on different criteria, for example several digital cameras might be compared on (price,zoom,resolution,color fidelity, memory size) each rated from 0 to 10 on an arbitrary scale.

Polar charts are also used as circular lineplots, typically for daily or annual timeseries where it makes sense to plot the values around a circle. They can also be used to represent genuinely directional data, such as a plot of wind-directions recorded over a month, or current flows at various locations on a map.

See also ...

Polar and Radar Charts | SharpPlot Members | PolarChartStyle Property


SharpPlot 2.51 User Manual: DrawPolarChart Method (Double[][],Double[])

SharpPlot.DrawPolarChart Method (Double[][],Double[])

Polar plot from multiple series and times or angles.

public void DrawPolarChart(
    double[][] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method (Int32[],Double[])

SharpPlot.DrawPolarChart Method (Int32[],Double[])

Polar plot from integer data and numeric angles.

public void DrawPolarChart(
    int[] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method (Int32[],Int32[])

SharpPlot.DrawPolarChart Method (Int32[],Int32[])

Polar plot from integer data and angles.

public void DrawPolarChart(
    int[] data,
    int[] xValues
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method (Int32[])

SharpPlot.DrawPolarChart Method (Int32[])

Polar plot from integer data with equal angles.

public void DrawPolarChart(
    int[] data
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method (Double[][],Int32[])

SharpPlot.DrawPolarChart Method (Double[][],Int32[])

Polar plot from multiple series and integer angles.

public void DrawPolarChart(
    double[][] data,
    int[] xValues
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method (Double[][])

SharpPlot.DrawPolarChart Method (Double[][])

Polar plot from multiple series with equal angles.

public void DrawPolarChart(
    double[][] data
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method (Double[],Double[])

SharpPlot.DrawPolarChart Method (Double[],Double[])

Polar plot from data and angles.

public void DrawPolarChart(
    double[] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method (Double[],Int32[])

SharpPlot.DrawPolarChart Method (Double[],Int32[])

Polar plot from data and integer angles.

public void DrawPolarChart(
    double[] data,
    int[] xValues
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method (Double[])

SharpPlot.DrawPolarChart Method (Double[])

Polar plot from data with equal angles.

public void DrawPolarChart(
    double[] data
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method (Int32[][],Double[])

SharpPlot.DrawPolarChart Method (Int32[][],Double[])

Polar plot from multiple integer data and numeric angles.

public void DrawPolarChart(
    int[][] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method (Int32[][],Int32[])

SharpPlot.DrawPolarChart Method (Int32[][],Int32[])

Polar plot from multiple integer series and angles.

public void DrawPolarChart(
    int[][] data,
    int[] xValues
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolarChart Method (Int32[][])

SharpPlot.DrawPolarChart Method (Int32[][])

Polar plot from multiple integer series with equal angles.

public void DrawPolarChart(
    int[][] data
);

See also ...

SharpPlot Members | DrawPolarChart Method


SharpPlot 2.51 User Manual: DrawPolygon Method

SharpPlot.DrawPolygon Method

Draw polygon from x and y coordinates, with optional Color, edge width, and FillStyle.

Example

sp.SetMargins(12,12,18,4);
sp.ScatterPlotStyle = (ScatterPlotStyles.GridLines|ScatterPlotStyles.ForceZero);
sp.SetColors(Color.Black);
sp.SetPenWidths(1);
sp.DrawScatterPlot(new double[]{1.2,5.3,2.9,7.4,1.3,4.3,6.4,7.7},new double[]{1.2,
         9.1,4.3,3.2,7.5,4.5,6.7,7.8});
sp.DrawPolygon(new double[] {4,8,8,4,4},new double[] {4,4,8,8,4},Color.Red,
         FillStyle.Opacity30,(double)1,LineStyle.Dash);
sp.DrawPolygon(new double[] {2,9,9,6,6,2,2},new double[] {1,1,3,3,5,5,1},Color.Blue,
         FillStyle.Opacity30,(double)0,LineStyle.Invisible);

Description

If the polygon is drawn before any chart, the co-ordinates used are points, measured from the top left corner of the paper.

If the polygon is drawn after a chart, the chart axes are used as the co-ordinate system for polygon points.

Overloads

  • public void DrawPolygon(double[] xValues,double[] yValues);
  • public void DrawPolygon(double[] xValues,double[] yValues,Color polyColor);
  • public void DrawPolygon(double[] xValues,double[] yValues,double edgeWidth);
  • public void DrawPolygon(double[] xValues,double[] yValues,FillStyle polyFill);
  • public void DrawPolygon(double[] xValues,double[] yValues,Color polyColor,double edgeWidth);
  • public void DrawPolygon(double[] xValues,double[] yValues,Color polyColor,FillStyle polyFill);
  • public void DrawPolygon(double[] xValues,double[] yValues,double edgeWidth,FillStyle polyFill);
  • public void DrawPolygon(double[] xValues,double[] yValues,double edgeWidth,LineStyle edgeStyle);
  • public void DrawPolygon(double[] xValues,double[] yValues,Color polyColor,double edgeWidth,FillStyle polyFill);
  • public void DrawPolygon(double[] xValues,double[] yValues,Color polyColor,double edgeWidth,LineStyle edgeStyle,FillStyle polyFill);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: DrawPolygon Method (Double[],Double[])

SharpPlot.DrawPolygon Method (Double[],Double[])

Draw polygon from x and y coordinates – default edge and no fill.

public void DrawPolygon(
    double[] xValues,
    double[] yValues
);

See also ...

SharpPlot Members | DrawPolygon Method


SharpPlot 2.51 User Manual: DrawPolygon Method (Double[],Double[],Color)

SharpPlot.DrawPolygon Method (Double[],Double[],Color)

Draw polygon from x and y coordinates, and Color – with default edge and no fill.

public void DrawPolygon(
    double[] xValues,
    double[] yValues,
    Color polyColor
);

See also ...

SharpPlot Members | DrawPolygon Method


SharpPlot 2.51 User Manual: DrawPolygon Method (Double[],Double[],Double)

SharpPlot.DrawPolygon Method (Double[],Double[],Double)

Draw polygon from x and y coordinates, and edge width – with no fill.

public void DrawPolygon(
    double[] xValues,
    double[] yValues,
    double edgeWidth
);

See also ...

SharpPlot Members | DrawPolygon Method


SharpPlot 2.51 User Manual: DrawPolygon Method (Double[],Double[],FillStyle)

SharpPlot.DrawPolygon Method (Double[],Double[],FillStyle)

Draw polygon from x and y coordinates, and FillStyle – with no edge.

public void DrawPolygon(
    double[] xValues,
    double[] yValues,
    FillStyle polyFill
);

See also ...

SharpPlot Members | DrawPolygon Method


SharpPlot 2.51 User Manual: DrawPolygon Method (Double[],Double[],Color,Double)

SharpPlot.DrawPolygon Method (Double[],Double[],Color,Double)

Draw polygon from x and y coordinates, Color, and edge width – with no fill.

public void DrawPolygon(
    double[] xValues,
    double[] yValues,
    Color polyColor,
    double edgeWidth
);

See also ...

SharpPlot Members | DrawPolygon Method


SharpPlot 2.51 User Manual: DrawPolygon Method (Double[],Double[],Color,FillStyle)

SharpPlot.DrawPolygon Method (Double[],Double[],Color,FillStyle)

Draw polygon from x and y coordinates, Color, and FillStyle – with no edge.

public void DrawPolygon(
    double[] xValues,
    double[] yValues,
    Color polyColor,
    FillStyle polyFill
);

See also ...

SharpPlot Members | DrawPolygon Method


SharpPlot 2.51 User Manual: DrawPolygon Method (Double[],Double[],Double,FillStyle)

SharpPlot.DrawPolygon Method (Double[],Double[],Double,FillStyle)

Draw polygon from x and y coordinates, edge width, and FillStyle.

public void DrawPolygon(
    double[] xValues,
    double[] yValues,
    double edgeWidth,
    FillStyle polyFill
);

See also ...

SharpPlot Members | DrawPolygon Method


SharpPlot 2.51 User Manual: DrawPolygon Method (Double[],Double[],Double,LineStyle)

SharpPlot.DrawPolygon Method (Double[],Double[],Double,LineStyle)

Draw polygon from x and y coordinates, edge width, and LineStyle – with no fill.

public void DrawPolygon(
    double[] xValues,
    double[] yValues,
    double edgeWidth,
    LineStyle edgeStyle
);

See also ...

SharpPlot Members | DrawPolygon Method


SharpPlot 2.51 User Manual: DrawPolygon Method (Double[],Double[],Color,Double,FillStyle)

SharpPlot.DrawPolygon Method (Double[],Double[],Color,Double,FillStyle)

Draw polygon from x and y coordinates, Color, edge width, and FillStyle.

public void DrawPolygon(
    double[] xValues,
    double[] yValues,
    Color polyColor,
    double edgeWidth,
    FillStyle polyFill
);

See also ...

SharpPlot Members | DrawPolygon Method


SharpPlot 2.51 User Manual: DrawPolygon Method (Double[],Double[],Color,Double,LineStyle,FillStyle)

SharpPlot.DrawPolygon Method (Double[],Double[],Color,Double,LineStyle,FillStyle)

Draw polygon from x and y coordinates, with optional Color, line width, LineStyle and FillStyle.

public void DrawPolygon(
    double[] xValues,
    double[] yValues,
    Color polyColor,
    double edgeWidth,
    LineStyle edgeStyle,
    FillStyle polyFill
);

See also ...

SharpPlot Members | DrawPolygon Method


SharpPlot 2.51 User Manual: DrawResponsePlot Method

SharpPlot.DrawResponsePlot Method

Draw 3D grid, and construct surface from multiple vectors of zValues giving rows and columns.

Example

sp.SetMargins(12,12,18,4);
respdata = new int[][]{new int[]{4,3,2},new int[]{7,6,5},new int[]{12,11,10},
         new int[]{19,18,17}};
sp.ResponsePlotStyle = ResponsePlotStyles.WallShading|ResponsePlotStyles.GridLines|
         ResponsePlotStyles.Markers|ResponsePlotStyles.TiledSurface;
sp.SetMarkers(Marker.Node);
sp.SetAxisStyle(Color.Gray,LineStyle.Solid,0.5);
sp.SetFillStyles(FillStyle.Opacity30);
sp.DrawResponsePlot(respdata);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawResponsePlot(int[][] zValues);
  • public void DrawResponsePlot(double[][] zValues);
  • public void DrawResponsePlot(double[][] zValues,double[] xValues);
  • public void DrawResponsePlot(int[][] zValues,int[] xValues,int[] yValues);
  • public void DrawResponsePlot(double[][] zValues,double[] xValues,double[] yValues);

Description

This chart is almost always used to illustrate a computed mathematical surface, and could often be combined with a Cloudchart to show a theoretical model overlayed with raw data values.

In the simplest case it takes a rectangular array of arrays of Z-values (effectively a matrix) and treats these as a uniform mesh to be plotted vertically with equally spaced x and y values. An option is to provide either or both of the x and y values as arrays of the correct length, to draw the mesh on a non-uniform scale.

By default the surface is drawn as a simple wireframe, but an option is to ‘tile’ the surface to give the illusion of a solid figure. This is often done with semi-transparent tiles so that surfaces with folds remain partially visible, whatever the viewpoint.

See also ...

Response Surfaces | SharpPlot Members | ResponsePlotStyle Property | SetViewpoint Method


SharpPlot 2.51 User Manual: DrawResponsePlot Method (Double[][],Double[],Double[])

SharpPlot.DrawResponsePlot Method (Double[][],Double[],Double[])

Create surface from multiple sets of z-values with matched x and y values.

public void DrawResponsePlot(
    double[][] zValues,
    double[] xValues,
    double[] yValues
);

See also ...

SharpPlot Members | DrawResponsePlot Method


SharpPlot 2.51 User Manual: DrawResponsePlot Method (Int32[][],Int32[],Int32[])

SharpPlot.DrawResponsePlot Method (Int32[][],Int32[],Int32[])

Create surface from multiple sets of integer z-values with matched x and y values.

public void DrawResponsePlot(
    int[][] zValues,
    int[] xValues,
    int[] yValues
);

See also ...

SharpPlot Members | DrawResponsePlot Method


SharpPlot 2.51 User Manual: DrawResponsePlot Method (Double[][],Double[])

SharpPlot.DrawResponsePlot Method (Double[][],Double[])

Create surface from multiple sets of z-values with matched x values and equally spaced y-values.

public void DrawResponsePlot(
    double[][] zValues,
    double[] xValues
);

See also ...

SharpPlot Members | DrawResponsePlot Method


SharpPlot 2.51 User Manual: DrawResponsePlot Method (Double[][])

SharpPlot.DrawResponsePlot Method (Double[][])

Create surface from multiple sets of z-values with equally spaced x and y values.

public void DrawResponsePlot(
    double[][] zValues
);

See also ...

SharpPlot Members | DrawResponsePlot Method


SharpPlot 2.51 User Manual: DrawResponsePlot Method (Int32[][])

SharpPlot.DrawResponsePlot Method (Int32[][])

Create surface from multiple sets of integer z-values with equally spaced x and y values.

public void DrawResponsePlot(
    int[][] zValues
);

See also ...

SharpPlot Members | DrawResponsePlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method

SharpPlot.DrawScatterPlot Method

Scatter plot from multiple y series and matching x values.

Example

sp.SetMargins(9,18,18,4);
sp.ScatterPlotStyle = ScatterPlotStyles.ModelFit|ScatterPlotStyles.Risers;
sp.SetMarkers(Marker.Lozenge);
sp.SetLineStyles(LineStyle.Dash);
ydata = new int[] {190,270,310,120,190,230};
xdata = new int[] {17,31,29,14,16,24};
sp.DrawScatterPlot(ydata,xdata);

The short tutorial shows a few of the possibilities and some sample code.

  • public void DrawScatterPlot(int[] yValues);
  • public void DrawScatterPlot(double[] yValues);
  • public void DrawScatterPlot(int[] yValues,int[] xValues);
  • public void DrawScatterPlot(double[] yValues,int[] xValues);
  • public void DrawScatterPlot(int[] yValues,double[] xValues);
  • public void DrawScatterPlot(double[] yValues,double[] xValues);
  • public void DrawScatterPlot(int[] yValues,string[] xCategories);
  • public void DrawScatterPlot(double[] yValues,string[] xCategories);
  • public void DrawScatterPlot(int[][] yValues,int[] xValues);
  • public void DrawScatterPlot(double[][] yValues,int[] xValues);
  • public void DrawScatterPlot(int[][] yValues,double[] xValues);
  • public void DrawScatterPlot(double[][] yValues,double[] xValues);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Double[][],Double[])

SharpPlot.DrawScatterPlot Method (Double[][],Double[])

Scatter plot from multiple y series and matching x values.

public void DrawScatterPlot(
    double[][] yValues,
    double[] xValues
);
yValues
Data series to be plotted against the X-values.
xValues
Numeric vector of X-values that is used for all the above Y-values.

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Int32[],Int32[])

SharpPlot.DrawScatterPlot Method (Int32[],Int32[])

Scatter plot from integer arrays of y and x values.

public void DrawScatterPlot(
    int[] yValues,
    int[] xValues
);
yValues
Data series to be plotted against the X-values.
xValues
Numeric vector of X-values that is used for all the above Y-values.

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Int32[],String[])

SharpPlot.DrawScatterPlot Method (Int32[],String[])

Scatter plot from arrays of integer y and category x values.

public void DrawScatterPlot(
    int[] yValues,
    string[] xCategories
);
yValues
Data series to be plotted against the X-values.
xCategories
[todo]

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Int32[])

SharpPlot.DrawScatterPlot Method (Int32[])

Scatter integer array of y-values against implied x-values.

public void DrawScatterPlot(
    int[] yValues
);
yValues
Data series to be plotted against the X-values.

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Double[][],Int32[])

SharpPlot.DrawScatterPlot Method (Double[][],Int32[])

Scatter plot from multiple y and integer x values.

public void DrawScatterPlot(
    double[][] yValues,
    int[] xValues
);
yValues
Data series to be plotted against the X-values.
xValues
Numeric vector of X-values that is used for all the above Y-values.

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Int32[][],Double[])

SharpPlot.DrawScatterPlot Method (Int32[][],Double[])

Scatter plot from multiple integer y and numeric x values.

public void DrawScatterPlot(
    int[][] yValues,
    double[] xValues
);
yValues
Data series to be plotted against the X-values.
xValues
Numeric vector of X-values that is used for all the above Y-values.

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Int32[][],Int32[])

SharpPlot.DrawScatterPlot Method (Int32[][],Int32[])

Scatter plot from multiple integer y and x values.

public void DrawScatterPlot(
    int[][] yValues,
    int[] xValues
);
yValues
Data series to be plotted against the X-values.
xValues
Numeric vector of X-values that is used for all the above Y-values.

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Double[],Double[])

SharpPlot.DrawScatterPlot Method (Double[],Double[])

Scatter plot from arrays of y and x values.

public void DrawScatterPlot(
    double[] yValues,
    double[] xValues
);
yValues
Data series to be plotted against the X-values.
xValues
Numeric vector of X-values that is used for all the above Y-values.

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Double[],Int32[])

SharpPlot.DrawScatterPlot Method (Double[],Int32[])

Scatter plot from arrays of y and integer x values.

public void DrawScatterPlot(
    double[] yValues,
    int[] xValues
);
yValues
Data series to be plotted against the X-values.
xValues
Numeric vector of X-values that is used for all the above Y-values.

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Double[],String[])

SharpPlot.DrawScatterPlot Method (Double[],String[])

Scatter plot from arrays of y and category x values.

public void DrawScatterPlot(
    double[] yValues,
    string[] xCategories
);
yValues
Data series to be plotted against the X-values.
xCategories
[todo]

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Double[])

SharpPlot.DrawScatterPlot Method (Double[])

Scatter array of y-values against implied x-values.

public void DrawScatterPlot(
    double[] yValues
);
yValues
Data series to be plotted against the X-values.

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawScatterPlot Method (Int32[],Double[])

SharpPlot.DrawScatterPlot Method (Int32[],Double[])

Scatter plot from arrays of integer y and numeric x values.

public void DrawScatterPlot(
    int[] yValues,
    double[] xValues
);
yValues
Data series to be plotted against the X-values.
xValues
Numeric vector of X-values that is used for all the above Y-values.

See also ...

SharpPlot Members | DrawScatterPlot Method


SharpPlot 2.51 User Manual: DrawStepChart Method

SharpPlot.DrawStepChart Method

Construct step chart from data and step start-points.

Example

sp.SetMargins(12,12,18,4);
sp.SetPenWidths(3);
sp.SetColors(Color.OrangeRed);
ydata = new int[] {190,270,310,120,190,230};
xdata = new int[] {17,31,49,54,66,84,100};
sp.DrawStepChart(ydata,xdata);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawStepChart(int[] data);
  • public void DrawStepChart(double[] data);
  • public void DrawStepChart(int[] data,int[] stepStartValues);
  • public void DrawStepChart(double[] data,int[] stepStartValues);
  • public void DrawStepChart(int[] data,double[] stepStartValues);
  • public void DrawStepChart(double[] data,double[] stepStartValues);

Description

Stepcharts are used for two main purposes – timeseries where the values change discontinuously (interest rates are typical) and summary data where the groups are of variable width (monthly totals). SharpPlot can draw the steps with risers from the X-axis (which has the effect of abutted bars) and with shading down to either the axis or a given reference line.

Note that you often give on more X-value that Y-value here as the X-values give the start-point for each step and there is usually an extra point at the right-hand end to determine how far to draw the final horizontal segment.

See also ...

Step Charts for discontinuous data | SharpPlot Members | StepChartStyle Property


SharpPlot 2.51 User Manual: DrawStepChart Method (Double[],Double[])

SharpPlot.DrawStepChart Method (Double[],Double[])

Stepped line from arrays of height data and step-start values.

public void DrawStepChart(
    double[] data,
    double[] stepStartValues
);

See also ...

SharpPlot Members | DrawStepChart Method


SharpPlot 2.51 User Manual: DrawStepChart Method (Double[],Int32[])

SharpPlot.DrawStepChart Method (Double[],Int32[])

Stepped line from array of height data and integer step-start values.

public void DrawStepChart(
    double[] data,
    int[] stepStartValues
);

See also ...

SharpPlot Members | DrawStepChart Method


SharpPlot 2.51 User Manual: DrawStepChart Method (Double[])

SharpPlot.DrawStepChart Method (Double[])

Stepped line from arrays of height data and implied step-start values.

public void DrawStepChart(
    double[] data
);

See also ...

SharpPlot Members | DrawStepChart Method


SharpPlot 2.51 User Manual: DrawStepChart Method (Int32[],Double[])

SharpPlot.DrawStepChart Method (Int32[],Double[])

Stepped line from integer array of height data and numeric step-start values.

public void DrawStepChart(
    int[] data,
    double[] stepStartValues
);

See also ...

SharpPlot Members | DrawStepChart Method


SharpPlot 2.51 User Manual: DrawStepChart Method (Int32[],Int32[])

SharpPlot.DrawStepChart Method (Int32[],Int32[])

Stepped line from integer array of height data and step-start values.

public void DrawStepChart(
    int[] data,
    int[] stepStartValues
);

See also ...

SharpPlot Members | DrawStepChart Method


SharpPlot 2.51 User Manual: DrawStepChart Method (Int32[])

SharpPlot.DrawStepChart Method (Int32[])

Stepped line from integer array of height data and implied step-start values.

public void DrawStepChart(
    int[] data
);

See also ...

SharpPlot Members | DrawStepChart Method


SharpPlot 2.51 User Manual: DrawTable Method

SharpPlot.DrawTable Method

Construct table from a set of columns (or rows) of data.

Example

sp.SetMargins(0,0,0,0);
sp.DrawFrame();
tabledata = new int[][]{new int[]{18,27,31,1},new int[]{12,9,7,3}};  // Two Columns
sp.SetYLabels(new string[]{"North","South","East","West"});
sp.SetXLabels(new string[]{"Pots","Pans"});
sp.YCaption = "Summary";
sp.TableStyle = TableStyles.Boxed|TableStyles.GridLines|TableStyles.FitWidth;
sp.SetValueFont("ARB",10);
sp.SetLabelFont("ARB",11);
sp.SetCaptionFont("ARB",11);
sp.DrawTable(tabledata);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawTable(int[] data);
  • public void DrawTable(string[] data);
  • public void DrawTable(double[] data);
  • public void DrawTable(int[][] data);
  • public void DrawTable(double[][] data);
  • public void DrawTable(string[][] tabledata);

Description

Tables are often used very effectively in combination with other charts to add summarized information. For example a plot of a stock price might include a small table of the low and high values for the past year, and maybe a comparison with the industry sector.

Tables in SharpPlot are often used in conjunction with Grouping and Splitting to create hierarchical summaries from raw database information. Spanned row-headers are often used to make the effect of the categorisation clear to the reader.

By default, arrays of arrays are taken as columns of items, but if it is more convenient this can be changed around by setting the DataStyle to Rows. If the data is already summarised and formatted, you can pass arrays of strings rather than numeric values here.

Stand-alone Tables

If you call sp.DrawTable directly in a new frame (or a new cell in a trellis) it checks for any of the heading, subhead and footnote and decorates the table appropriately. If you add a table to an existing chart (effectively using it as a structured note) these settings are ignored by default. You can have them picked up by setting the UseHeaders style.

See also ...

Tabulating data | SharpPlot Members | DataStyle Property | TableStyle Property


SharpPlot 2.51 User Manual: DrawTable Method (String[][])

SharpPlot.DrawTable Method (String[][])

Build a table from an array of arrays of strings, giving cells in columns.

public void DrawTable(
    string[][] tabledata
);

See also ...

SharpPlot Members | DrawTable Method


SharpPlot 2.51 User Manual: DrawTable Method (String[])

SharpPlot.DrawTable Method (String[])

One-column table from a string array.

public void DrawTable(
    string[] data
);

See also ...

SharpPlot Members | DrawTable Method


SharpPlot 2.51 User Manual: DrawTable Method (Double[][])

SharpPlot.DrawTable Method (Double[][])

Table from an array of double arrays.

public void DrawTable(
    double[][] data
);

See also ...

SharpPlot Members | DrawTable Method


SharpPlot 2.51 User Manual: DrawTable Method (Double[])

SharpPlot.DrawTable Method (Double[])

One-column table from a double array.

public void DrawTable(
    double[] data
);

See also ...

SharpPlot Members | DrawTable Method


SharpPlot 2.51 User Manual: DrawTable Method (Int32[][])

SharpPlot.DrawTable Method (Int32[][])

Table from an array of integer arrays.

public void DrawTable(
    int[][] data
);

See also ...

SharpPlot Members | DrawTable Method


SharpPlot 2.51 User Manual: DrawTable Method (Int32[])

SharpPlot.DrawTable Method (Int32[])

One-column table from an integer array.

public void DrawTable(
    int[] data
);

See also ...

SharpPlot Members | DrawTable Method


SharpPlot 2.51 User Manual: DrawTowerChart Method

SharpPlot.DrawTowerChart Method

Do 3D grid, and construct towerchart from simple rectangular set of heights.

Example

sp.SetMargins(0,12,18,4);
towers = new int[][]{new int[]{77,65,12},new int[]{34,29,11}};
sp.TowerChartStyle = TowerChartStyles.WallShading|TowerChartStyles.GridLines;
sp.ZAxisStyle = ZAxisStyles.ForceZero;
sp.SetZTickMarks(20);
sp.Perspective = 6;
sp.SetAxisStyle(Color.Gray,LineStyle.Solid,0.5);
sp.DrawTowerChart(towers);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawTowerChart(int[] zData);
  • public void DrawTowerChart(double[] zData);
  • public void DrawTowerChart(int[][] zData);
  • public void DrawTowerChart(double[][] zData);

Description

Towercharts are simply grouped barcharts with the bars drawn ‘behind’ each other rather than in groups along the X-axis. They are best used where the visual effect is more important than the readability of the data values, as it is almost impossible to read the ‘height’ values reliably, and it is very likely that in a crowded chart some towers will be completely obscured.

It may be necessary to allow the user to adjust the tower-spacing and viewpoint to get a clear picture of the relative heights of the towers, and it is generally best to sort the data so that the taller towers are further away from the viewpoint.

See also ...

Tower Charts for 3D bars | SharpPlot Members | TowerChartStyle Property | SetViewpoint Method


SharpPlot 2.51 User Manual: DrawTowerChart Method (Double[][])

SharpPlot.DrawTowerChart Method (Double[][])

Tower chart from an array of arrays of height values.

public void DrawTowerChart(
    double[][] zData
);

See also ...

SharpPlot Members | DrawTowerChart Method


SharpPlot 2.51 User Manual: DrawTowerChart Method (Int32[][])

SharpPlot.DrawTowerChart Method (Int32[][])

Tower chart from an array of integer arrays of height values.

public void DrawTowerChart(
    int[][] zData
);

See also ...

SharpPlot Members | DrawTowerChart Method


SharpPlot 2.51 User Manual: DrawTowerChart Method (Double[])

SharpPlot.DrawTowerChart Method (Double[])

Column chart from an array of height values.

public void DrawTowerChart(
    double[] zData
);

See also ...

SharpPlot Members | DrawTowerChart Method


SharpPlot 2.51 User Manual: DrawTowerChart Method (Int32[])

SharpPlot.DrawTowerChart Method (Int32[])

Column chart from an integer array of height values.

public void DrawTowerChart(
    int[] zData
);

See also ...

SharpPlot Members | DrawTowerChart Method


SharpPlot 2.51 User Manual: DrawTraceChart Method

SharpPlot.DrawTraceChart Method

Seismometer-style chart with multiple parallel traces.

Example

sp.SetMargins(12,12,18,4);
tracedata = new int[][]{new int[]{0,4,9,12,5,5,10,2},new int[]{0,5,7,8,3,2,9,1},
         new int[]{0,3,3,4,0,1,4,1}};
sp.YAxisStyle = YAxisStyles.GridLines|YAxisStyles.ArrowedAxis;
sp.IAxisStyle = IAxisStyles.PlainAxis;
sp.DrawTraceChart(tracedata);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawTraceChart(int[][] data);
  • public void DrawTraceChart(double[][] data);
  • public void DrawTraceChart(int[][] data,int[] xValues);
  • public void DrawTraceChart(double[][] data,int[] xValues);
  • public void DrawTraceChart(int[][] data,double[] xValues);
  • public void DrawTraceChart(double[][] data,double[] xValues);

Description

Trace charts are a slightly specialist style of plot, originally designed for data from devices like seismographs and EEGs where multiple pens trace out (almost) parallel lines. Each pen is allocated a tickmark on the Y-axis and then an ‘inner axis’ is created for it (naturally these inner axes are all scaled identically). The trace may be filled (a style of chart often used to show inventories in a tank-farm at an oil refinery) or it may be drawn symmetrically to create a style called a ‘Kite diagram’ which often appears in botanical studies of vegetation coverage.

See also ...

Trace Charts for multiple series | SharpPlot Members | TraceChartStyle Property


SharpPlot 2.51 User Manual: DrawTraceChart Method (Double[][],Double[])

SharpPlot.DrawTraceChart Method (Double[][],Double[])

Draw a set of parallel traces from an array of arrays of Y-values and an array of X-values.

public void DrawTraceChart(
    double[][] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawTraceChart Method


SharpPlot 2.51 User Manual: DrawTraceChart Method (Double[][],Int32[])

SharpPlot.DrawTraceChart Method (Double[][],Int32[])

Draw a set of traces from an array of arrays of Y-values and an integer array of X-values.

public void DrawTraceChart(
    double[][] data,
    int[] xValues
);

See also ...

SharpPlot Members | DrawTraceChart Method


SharpPlot 2.51 User Manual: DrawTraceChart Method (Double[][])

SharpPlot.DrawTraceChart Method (Double[][])

Draw a set of traces from an array of arrays of Y-values against a nominal or bundled X-axis.

public void DrawTraceChart(
    double[][] data
);

See also ...

SharpPlot Members | DrawTraceChart Method


SharpPlot 2.51 User Manual: DrawTraceChart Method (Int32[][],Double[])

SharpPlot.DrawTraceChart Method (Int32[][],Double[])

Draw a set of traces from an integer array of arrays of Y-values and an array of X-values.

public void DrawTraceChart(
    int[][] data,
    double[] xValues
);

See also ...

SharpPlot Members | DrawTraceChart Method


SharpPlot 2.51 User Manual: DrawTraceChart Method (Int32[][],Int32[])

SharpPlot.DrawTraceChart Method (Int32[][],Int32[])

Draw a set of traces from an integer array of arrays of Y-values and an integer array of X-values.

public void DrawTraceChart(
    int[][] data,
    int[] xValues
);

See also ...

SharpPlot Members | DrawTraceChart Method


SharpPlot 2.51 User Manual: DrawTraceChart Method (Int32[][])

SharpPlot.DrawTraceChart Method (Int32[][])

Draw a set of traces from an integer array of arrays of Y-values against a nominal X-axis.

public void DrawTraceChart(
    int[][] data
);

See also ...

SharpPlot Members | DrawTraceChart Method


SharpPlot 2.51 User Manual: DrawTreeMap Method

SharpPlot.DrawTreeMap Method

Construct map from integer values, level vector, and altitude.

Example

sp.Reset(width,height);
sp.SetMargins(6,6,6,6);

sp.BarEdgeNib = 0;

sp.SetAltitudeColors(new Color[]{Color.Maroon,Color.Gray,Color.Lime});
sp.SetFillStyles(FillStyle.GradientTop);
sp.TreeMapStyle = (TreeMapStyles.ValueTags|TreeMapStyles.AltitudeShading);
sp.ValueTagFormat = "£####M";
sp.SetZRange(0,5);
sp.ZCaption = "Daily difference";

sp.SetXLabelFont("ARB",6,ColorTranslator.FromHtml("#FFD491"));  // Orange

sp.SetXLabels(new string[]{"Main block","Parent block","Child1","Child2"});

area = new int[] {123,56,23,33};
level = new int[] {0,0,1,1};
alt = new int[] {5,3,0,1};

sp.DrawTreeMap(area,level,alt);

Overloads

  • public void DrawTreeMap(int[] data);
  • public void DrawTreeMap(double[] data);
  • public void DrawTreeMap(int[] data,int[] level);
  • public void DrawTreeMap(double[] data,int[] level);
  • public void DrawTreeMap(double[] data,int level,double[] alt);
  • public void DrawTreeMap(int[] data,int[] level,int[] alt);
  • public void DrawTreeMap(int[] data,int[] level,double[] alt);
  • public void DrawTreeMap(double[] data,int[] level,int[] alt);
  • public void DrawTreeMap(double[] data,int[] level,double[] alt);

Description

Draws a standard Heatmap from a tree of area values.

data
Area of each rectangle.
level
Depth in tree structure (level-0 are roots).
alt
Extra dimension for altitude coloring.

See also ...

SharpPlot Members | TreeMapStyle Property


SharpPlot 2.51 User Manual: DrawTreeMap Method (Int32[],Int32[],Double[])

SharpPlot.DrawTreeMap Method (Int32[],Int32[],Double[])

Construct map from integer values, level vector, and altitude.

public void DrawTreeMap(
    int[] data,
    int[] level,
    double[] alt
);
data
Area of each rectangle.
level
Depth in tree structure (level-0 are roots).
alt
Extra dimension for altitude coloring.

See also ...

SharpPlot Members | DrawTreeMap Method


SharpPlot 2.51 User Manual: DrawTreeMap Method (Int32[],Int32[],Int32[])

SharpPlot.DrawTreeMap Method (Int32[],Int32[],Int32[])

Construct map from values, level vector, and integer altitude.

public void DrawTreeMap(
    int[] data,
    int[] level,
    int[] alt
);
data
Area of each rectangle.
level
Depth in tree structure (level-0 are roots).
alt
Extra dimension for altitude coloring.

See also ...

SharpPlot Members | DrawTreeMap Method


SharpPlot 2.51 User Manual: DrawTreeMap Method (Double[],Int32[],Int32[])

SharpPlot.DrawTreeMap Method (Double[],Int32[],Int32[])

Construct map from values, level vector, and integer altitude.

public void DrawTreeMap(
    double[] data,
    int[] level,
    int[] alt
);
data
Area of each rectangle.
level
Depth in tree structure (level-0 are roots).
alt
Extra dimension for altitude coloring.

See also ...

SharpPlot Members | DrawTreeMap Method


SharpPlot 2.51 User Manual: DrawTreeMap Method (Double[],Int32,Double[])

SharpPlot.DrawTreeMap Method (Double[],Int32,Double[])

Construct map from values, single level and altitude vectors.

public void DrawTreeMap(
    double[] data,
    int level,
    double[] alt
);
data
Area of each rectangle.
level
Depth in tree structure (level-0 are roots).
alt
Extra dimension for altitude coloring.

See also ...

SharpPlot Members | DrawTreeMap Method


SharpPlot 2.51 User Manual: DrawTreeMap Method (Double[],Int32[])

SharpPlot.DrawTreeMap Method (Double[],Int32[])

Construct map from values and level vectors.

public void DrawTreeMap(
    double[] data,
    int[] level
);
data
Area of each rectangle.
level
Depth in tree structure (level-0 are roots).

See also ...

SharpPlot Members | DrawTreeMap Method


SharpPlot 2.51 User Manual: DrawTreeMap Method (Int32[],Int32[])

SharpPlot.DrawTreeMap Method (Int32[],Int32[])

Construct map from integer values and level vectors.

public void DrawTreeMap(
    int[] data,
    int[] level
);
data
Area of each rectangle.
level
Depth in tree structure (level-0 are roots).

See also ...

SharpPlot Members | DrawTreeMap Method


SharpPlot 2.51 User Manual: DrawTreeMap Method (Double[])

SharpPlot.DrawTreeMap Method (Double[])

Construct map from values only.

public void DrawTreeMap(
    double[] data
);
data
Area of each rectangle.

See also ...

SharpPlot Members | DrawTreeMap Method


SharpPlot 2.51 User Manual: DrawTreeMap Method (Int32[])

SharpPlot.DrawTreeMap Method (Int32[])

Construct map from integer values only.

public void DrawTreeMap(
    int[] data
);
data
Area of each rectangle.

See also ...

SharpPlot Members | DrawTreeMap Method


SharpPlot 2.51 User Manual: DrawTreeMap Method (Double[],Int32[],Double[])

SharpPlot.DrawTreeMap Method (Double[],Int32[],Double[])

Construct map from values, level vector, and integer altitude.

public void DrawTreeMap(
    double[] data,
    int[] level,
    int[] alt
);
data
Area of each rectangle.
level
Depth in tree structure (level-0 are roots).
alt
Extra dimension for altitude coloring.


SharpPlot 2.51 User Manual: DrawTriangle Method

SharpPlot.DrawTriangle Method

Create a triangle chart (relative proportions of exactly 3 series):

Example

samples = new int[,] {{3,4,4},{4,2,2},{3,4,2},{4,3,1}};

sp.SetMargins(12,6,0,0);
sp.TriangleStyle = TriangleStyles.GridLines|TriangleStyles.Markers;
sp.SetMarkers(Marker.Bullet);

sp.XCaption = "Na";
sp.YCaption = "K";
sp.ZCaption = "Ca";

sp.DrawTriangle(samples);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawTriangle(int[][] data);
  • public void DrawTriangle(double[][] data);
  • public void DrawTriangle(int[,] data);
  • public void DrawTriangle(double[,] data);
  • public void DrawTriangle(int[] s1,int[] s2,int[] s3);
  • public void DrawTriangle(double[] s1,double[] s2,double[] s3);

Description

This chart is typically used to profile a series of samples of the 3 key constituents of some raw material or industrial process. The data may be shown as proportions or percentages, but it will always be normalised into the range 0-1. If only 2 sets of samples are given, the third set is deduced by subtraction from 1 or 100 as appropriate.

Various styles can be used to vary the appearance of the chart, but the axis range and tick spacing are pre-determined here.

See also ...

SharpPlot Members | TriangleStyle Property


SharpPlot 2.51 User Manual: DrawTriangle Method (Int32[][])

SharpPlot.DrawTriangle Method (Int32[][])

Triangle plot from 3 matching series of counts.

public void DrawTriangle(
    int[][] data
);
data
Exactly 3 matching series of counts or proportions.

See also ...

SharpPlot Members | DrawTriangle Method


SharpPlot 2.51 User Manual: DrawTriangle Method (Double[0:,0:])

SharpPlot.DrawTriangle Method (Double[0:,0:])

Triangle plot from a 3-col matrix of proportions.

public void DrawTriangle(
    double[,] data
);
data
Exactly 3 matching series of counts or proportions.

See also ...

SharpPlot Members | DrawTriangle Method


SharpPlot 2.51 User Manual: DrawTriangle Method (Int32[0:,0:])

SharpPlot.DrawTriangle Method (Int32[0:,0:])

Triangle plot from a 3-col matrix of counts.

public void DrawTriangle(
    int[,] data
);
data
Exactly 3 matching series of counts or proportions.

See also ...

SharpPlot Members | DrawTriangle Method


SharpPlot 2.51 User Manual: DrawTriangle Method (Double[],Double[],Double[])

SharpPlot.DrawTriangle Method (Double[],Double[],Double[])

Triangle plot of 3 arrays of proportions.

public void DrawTriangle(
    double[] s1,
    double[] s2,
    double[] s3
);
s1
First set of counts.
s2
Second set of counts.
s3
Third set of counts.

See also ...

SharpPlot Members | DrawTriangle Method


SharpPlot 2.51 User Manual: DrawTriangle Method (Int32[],Int32[],Int32[])

SharpPlot.DrawTriangle Method (Int32[],Int32[],Int32[])

Triangle plot of 3 arrays of counts.

public void DrawTriangle(
    int[] s1,
    int[] s2,
    int[] s3
);
s1
First set of counts.
s2
Second set of counts.
s3
Third set of counts.

See also ...

SharpPlot Members | DrawTriangle Method


SharpPlot 2.51 User Manual: DrawTriangle Method (Double[][])

SharpPlot.DrawTriangle Method (Double[][])

Triangle plot from 3 matching series of counts.

public void DrawTriangle(
    int[][] data
);
data
Exactly 3 matching series of counts or proportions.

See also ...

SharpPlot Members | DrawTriangle Method


SharpPlot 2.51 User Manual: DrawVectors Method

SharpPlot.DrawVectors Method

Create a vector diagram (showing a directed graph, or current flows):

Example

x1 = new int[] {77,25,43,42,93,32,81,14,64,4,71,98};
y1 = new int[] {17,48,55,24,52,74,31,98,70,63,63,43};
x2 = new int[] {93,31,51,50,114,40,99,19,78,7,86,121};
y2 = new int[] {24,57,65,31,63,85,41,110,83,75,75,53};

sp.SetMargins(12,12,18,4);
sp.VectorStyle = VectorStyles.ArrowLines;
sp.DrawVectors(new int[][]{x1,y1,x2,y2});

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawVectors(int[][] data);
  • public void DrawVectors(double[][] data);
  • public void DrawVectors(int[,] data);
  • public void DrawVectors(double[,] data);
  • public void DrawVectors(int[] x1,int[] y1,int[] x2,int[] y2);
  • public void DrawVectors(double[] x1,double[] y1,double[] x2,double[] y2);

Description

This method takes a matrix (or regular array) of xyxy pairs and draws a set of lines connecting each pair of points. The lines can be marked on the ‘target’ end with arrows, or marked at the root/target ends with the current marker.

Two good uses of this chart type are for drawing any style of directed graph (typically a PERT chart or assembly diagram), or representing a vector field, such as current flows or wind speeds on a map. Value Tags are written along the lines, and are always centered. They may contain multiple lines of text.

See also ...

SharpPlot Members | DataStyle Property | VectorStyle Property


SharpPlot 2.51 User Manual: DrawVectors Method (Double[,])

SharpPlot.DrawVectors Method (Double[,])

Vector plot from a matrix of xyxy pairs.

public void DrawVectors(
    double[,] data
);

See also ...

SharpPlot Members | DrawVectors Method


SharpPlot 2.51 User Manual: DrawVectors Method (Int32[,])

SharpPlot.DrawVectors Method (Int32[,])

Vector plot from an integer matrix of xyxy pairs.

public void DrawVectors(
    int[,] data
);

See also ...

SharpPlot Members | DrawVectors Method


SharpPlot 2.51 User Manual: DrawVectors Method (Double[],Double[],Double[],Double[])

SharpPlot.DrawVectors Method (Double[],Double[],Double[],Double[])

Vector plot from 4 arrays giving x1 y1 x2 y2 for each node.

public void DrawVectors(
    double[] x1,
    double[] y1,
    double[] x2,
    double[] y2
);

See also ...

SharpPlot Members | DrawVectors Method


SharpPlot 2.51 User Manual: DrawVectors Method (Int32[],Int32[],Int32[],Int32[])

SharpPlot.DrawVectors Method (Int32[],Int32[],Int32[],Int32[])

Vector plot from 4 integer arrays of nodes.

public void DrawVectors(
    int[] x1,
    int[] y1,
    int[] x2,
    int[] y2
);

See also ...

SharpPlot Members | DrawVectors Method


SharpPlot 2.51 User Manual: DrawVectors Method (Double[][])

SharpPlot.DrawVectors Method (Double[][])

Vector plot from a list of xyxy pairs.

public void DrawVectors(
    double[][] data
);

See also ...

SharpPlot Members | DrawVectors Method


SharpPlot 2.51 User Manual: DrawVectors Method (Int32[][])

SharpPlot.DrawVectors Method (Int32[][])

Vector plot from a list of integer xyxy pairs.

public void DrawVectors(
    int[][] data
);

See also ...

SharpPlot Members | DrawVectors Method


SharpPlot 2.51 User Manual: DrawVennDiagram Method

SharpPlot.DrawVennDiagram Method

Draw a Venn diagram using supplied membership data.

public void DrawVennDiagram(
    int[] regionValues
);

Example

sp.SetMargins(12,12,4,4);
sp.VennDiagramStyle = VennDiagramStyles.Filled;
sp.DrawVennDiagram(new int[] {27,19,8});

The short tutorial has several more variations on the basic design.

Description

The Venn diagram shows a diagrammatic view of Set membership data, using the correct proportions for the simply case with 2 populations (and 1 overlap) and a simple diagram with intersecting circles for the 3-area case.

Only simple proportional (2-area) and diagrammatic (3-area) diagrams are supported.

See also ...

Venn Diagrams | SharpPlot Members | VennDiagramStyle Property


SharpPlot 2.51 User Manual: DrawXBarChart Method

SharpPlot.DrawXBarChart Method

Create Barchart (vertical only) with given rather than logical X-axis.

Example

sp.SetMargins(12,12,18,4);
sp.XAxisStyle = XAxisStyles.ForceZero;
data = new int[] {18,27,31,12,19,23};
xdata = new int[] {4,7,8,13,14,17};
sp.DrawXBarChart(data,xdata);

The short tutorial shows a few of the possibilities and some sample code.

Overloads

  • public void DrawXBarChart(int[] yValues,int[] xValues);
  • public void DrawXBarChart(double[] yValues,int[] xValues);
  • public void DrawXBarChart(int[] yValues,double[] xValues);
  • public void DrawXBarChart(double[] yValues,double[] xValues);
  • public void DrawXBarChart(int[][] yValues,int[] xValues);
  • public void DrawXBarChart(double[][] yValues,int[] xValues);
  • public void DrawXBarChart(int[][] yValues,double[] xValues);
  • public void DrawXBarChart(double[][] yValues,double[] xValues);

Description

Conventional barcharts have a purely notional X-axis – the bars are equally spaced and the bar widths are calculated from the required inter-bar spacing. In the XBar chart, you have full control over the placement of the bars and the widths – this chart would typically be used to show time on the X-axis and occasional major events (say hurricanes or earthquakes) using the bars to indicat the severity.

The widths of the bars may also be individually controlled, so it is possible to indicate more than one feature of the event using both the height and width of the bar.

See also ...

X Bar Charts for positioned bars | SharpPlot Members | XBarChartStyle Property | SetBarWidths Method


SharpPlot 2.51 User Manual: DrawXBarChart Method (Double[][],Double[])

SharpPlot.DrawXBarChart Method (Double[][],Double[])

XBarchart from multiple data series and x-values.

public void DrawXBarChart(
    double[][] yValues,
    double[] xValues
);

See also ...

SharpPlot Members | DrawXBarChart Method


SharpPlot 2.51 User Manual: DrawXBarChart Method (Double[][],Int32[])

SharpPlot.DrawXBarChart Method (Double[][],Int32[])

XBarchart from multiple data series and integer x-values.

public void DrawXBarChart(
    double[][] yValues,
    int[] xValues
);

See also ...

SharpPlot Members | DrawXBarChart Method


SharpPlot 2.51 User Manual: DrawXBarChart Method (Int32[][],Double[])

SharpPlot.DrawXBarChart Method (Int32[][],Double[])

XBarchart from multiple integer data series and numeric x-values.

public void DrawXBarChart(
    int[][] yValues,
    double[] xValues
);

See also ...

SharpPlot Members | DrawXBarChart Method


SharpPlot 2.51 User Manual: DrawXBarChart Method (Int32[][],Int32[])

SharpPlot.DrawXBarChart Method (Int32[][],Int32[])

XBarchart from multiple integer data series and x-values.

public void DrawXBarChart(
    int[][] yValues,
    int[] xValues
);

See also ...

SharpPlot Members | DrawXBarChart Method


SharpPlot 2.51 User Manual: DrawXBarChart Method (Double[],Double[])

SharpPlot.DrawXBarChart Method (Double[],Double[])

XBarchart from a single data series and x-values.

public void DrawXBarChart(
    double[] yValues,
    double[] xValues
);

See also ...

SharpPlot Members | DrawXBarChart Method


SharpPlot 2.51 User Manual: DrawXBarChart Method (Double[],Int32[])

SharpPlot.DrawXBarChart Method (Double[],Int32[])

XBarchart from a single data series and integer x-values.

public void DrawXBarChart(
    double[] yValues,
    int[] xValues
);

See also ...

SharpPlot Members | DrawXBarChart Method


SharpPlot 2.51 User Manual: DrawXBarChart Method (Int32[],Double[])

SharpPlot.DrawXBarChart Method (Int32[],Double[])

XBarchart from a single integer data series and numeric x-values.

public void DrawXBarChart(
    int[] yValues,
    double[] xValues
);

See also ...

SharpPlot Members | DrawXBarChart Method


SharpPlot 2.51 User Manual: DrawXBarChart Method (Int32[],Int32[])

SharpPlot.DrawXBarChart Method (Int32[],Int32[])

XBarchart from a single integer data series and integer x-values.

public void DrawXBarChart(
    int[] yValues,
    int[] xValues
);

See also ...

SharpPlot Members | DrawXBarChart Method


SharpPlot 2.51 User Manual: FindExtremes Method

SharpPlot.FindExtremes Method

Find extreme values from array of arrays of y values and x-values. This returns the lower left and upper right corners of the rectangle bounding your data, allowing for the Curves style if this has been set. You may want to use the numbers it returns to ensure your axis ranges are set to include the curved lines connecting the points as well as the points themselves.

public double[] FindExtremes(
    double[][] data,
    int[] xValues
);
data
Array (of arrays) of y values.
xValues
Array of x values.
return value
Bounding box co-ordinates.
  • public double[] FindExtremes(int[] data);
  • public double[] FindExtremes(double[] data);
  • public double[] FindExtremes(int[][] data);
  • public double[] FindExtremes(double[][] data);
  • public double[] FindExtremes(int[] data,int[] xValues);
  • public double[] FindExtremes(double[] data,int[] xValues);
  • public double[] FindExtremes(int[] data,double[] xValues);
  • public double[] FindExtremes(double[] data,double[] xValues);
  • public double[] FindExtremes(int[][] data,int[] xValues);
  • public double[] FindExtremes(double[][] data,int[] xValues);
  • public double[] FindExtremes(int[][] data,double[] xValues);
  • public double[] FindExtremes(double[][] data,double[] xValues);

Note that the Curves option will compute the Bezier control points which always encompass the generated curve completely. This may slightly over-estimate the required range if the flexibility parameter is set very high.

See also ...

SharpPlot | Flexibility | SetXDataRange | SetYDataRange | Curves


SharpPlot 2.51 User Manual: FindExtremes Method (Double[][],Double[])

SharpPlot.FindExtremes Method (Double[][],Double[])

Find extreme values from array of arrays of y values and x-values.

public double[] FindExtremes(
    double[][] data,
    double[] xValues
);
data
Array (of arrays) of y values.
xValues
Array of x values.
return value
Bounding box co-ordinates.

Usage

Required for any app which uses ‘Curves’ and needs to set the axis ranges. Will slightly over-estimate as it gets the Bezier control points which are always outside the envelope of the cubic curve.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: FindExtremes Method (Int32[],Double[])

SharpPlot.FindExtremes Method (Int32[],Double[])

Find extreme values from integer array of y-values and double array of x-values.

public double[] FindExtremes(
    int[] data,
    double[] xValues
);
data
Array (of arrays) of y values.
xValues
Array of x values.
return value
Bounding box co-ordinates.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: FindExtremes Method (Int32[],Int32[])

SharpPlot.FindExtremes Method (Int32[],Int32[])

Find extreme values from integer array of y-values and x-values.

public double[] FindExtremes(
    int[] data,
    int[] xValues
);
data
Array (of arrays) of y values.
xValues
Array of x values.
return value
Bounding box co-ordinates.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: FindExtremes Method (Int32[])

SharpPlot.FindExtremes Method (Int32[])

Find extreme values from integer array of y-values and implied x-values.

public double[] FindExtremes(
    int[] data
);
data
Array (of arrays) of y values.
return value
Bounding box co-ordinates.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: FindExtremes Method (Double[][],Int32[])

SharpPlot.FindExtremes Method (Double[][],Int32[])

Find extreme values from array of arrays of y-values and integer x-values.

public double[] FindExtremes(
    double[][] data,
    int[] xValues
);
data
Array (of arrays) of y values.
xValues
Array of x values.
return value
Bounding box co-ordinates.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: FindExtremes Method (Double[][])

SharpPlot.FindExtremes Method (Double[][])

Find extreme values from array of arrays of y-values and implied x-values.

public double[] FindExtremes(
    double[][] data
);
data
Array (of arrays) of y values.
return value
Bounding box co-ordinates.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: FindExtremes Method (Double[],Double[])

SharpPlot.FindExtremes Method (Double[],Double[])

Find extreme values from array of y-values and array of x-values.

public double[] FindExtremes(
    double[] data,
    double[] xValues
);
data
Array (of arrays) of y values.
xValues
Array of x values.
return value
Bounding box co-ordinates.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: FindExtremes Method (Double[],Int32[])

SharpPlot.FindExtremes Method (Double[],Int32[])

Find extreme values from array of y-values and integer array of x-values.

public double[] FindExtremes(
    double[] data,
    int[] xValues
);
data
Array (of arrays) of y values.
xValues
Array of x values.
return value
Bounding box co-ordinates.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: FindExtremes Method (Double[])

SharpPlot.FindExtremes Method (Double[])

Find extreme values from array of y-values and implied x-values.

public double[] FindExtremes(
    double[] data
);
data
Array (of arrays) of y values.
return value
Bounding box co-ordinates.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: FindExtremes Method (Int32[][],Double[])

SharpPlot.FindExtremes Method (Int32[][],Double[])

Find extreme values from integer array of arrays of y-values and double x-values.

public double[] FindExtremes(
    int[][] data,
    double[] xValues
);
data
Array (of arrays) of y values.
xValues
Array of x values.
return value
Bounding box co-ordinates.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: FindExtremes Method (Int32[][],Int32[])

SharpPlot.FindExtremes Method (Int32[][],Int32[])

Find extreme values from integer array of arrays of y-values and x-values.

public double[] FindExtremes(
    int[][] data,
    int[] xValues
);
data
Array (of arrays) of y values.
xValues
Array of x values.
return value
Bounding box co-ordinates.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: FindExtremes Method (Int32[][])

SharpPlot.FindExtremes Method (Int32[][])

Find extreme values from integer array of arrays of y-values and implied x-values.

public double[] FindExtremes(
    int[][] data
);
data
Array (of arrays) of y values.
return value
Bounding box co-ordinates.

See also ...

SharpPlot Members | FindExtremes Method


SharpPlot 2.51 User Manual: GetCoefficients Method

SharpPlot.GetCoefficients Method

Coefficients from regression model.

public double[] GetCoefficients();

Example

double[] coeff = sp.GetCoefficients();
double intercept = coeff[0];
double slope = coeff[1];

These are returned in order of increasing power, so for a linear model the returned array will have 2 elements giving intercept and slope. They could be used to compute Y-values for a specific set of ‘benchmark’ X-values and draw some guidelines on the chart or just to add a note describing the model.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: GetFittedValues Method

SharpPlot.GetFittedValues Method

Fitted values from regression model.

public double[] GetFittedValues();

This returns the item-by-item values as computed from the regression equation.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: GetITickPositions Method

SharpPlot.GetITickPositions Method

I ticks (calc) READONLY.

public double[] GetITickPositions();

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: GetNextNote Method

SharpPlot.GetNextNote Method

This call returns the vertical position (baseline) for the following note after a note which has been wrapped.

public double GetNextNote(double vspace);

Returns the correct position for the next note text in points (absolute style) or chart co-ords (relative style). You can use this to position a set of notes (for example a subheading followed by one or more wrapped paragraphs) correctly on the chart.

vpos = sp.NextNote(6);  // add 6pt headspace
sp.DrawNote("Hi",50,vpos);  // follow on

This spaces vertically down by <vspace> (in points always) from the calculated baseline for the next text output. Call this with no argument to have the text flow naturally, or 12 to add a line of space between paragraphs. The resulting <vpos> is returned in chart co-ordinates if you positioned your note this way, or in absolute (points) co-ordinates relative to the lower left corner of the current frame if you placed your note with style ‘absolute’.


SharpPlot 2.51 User Manual: GetResiduals Method

SharpPlot.GetResiduals Method

Residuals – point-by-point differences between the datapoints and the computed model.

public double[] GetResiduals();

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: GetXTickPositions Method

SharpPlot.GetXTickPositions Method

Find the computed values of the X-tickmarks.

public double[] GetXTickPositions();

This may be useful in positioning chart notes, for example to place a note at the last X-tickmark and the topmost Y-tickmark when both X and Y axes have been ranged from the data.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: GetYTickPositions Method

SharpPlot.GetYTickPositions Method

Find the computed values of the Y-tickmarks.

public double[] GetYTickPositions();

This may be useful in positioning chart notes, for example to place a note at the first X-tickmark and the topmost Y-tickmark.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: GroupBy Method

SharpPlot.GroupBy Method

Prepare key-based grouping criterion prior to plotting data. This is typically used to summarize data which results from a database query. It may be called more than once to set up a hierarchy of summaries, typically used with the table chart.

Example

sp.GroupBy(barleyvariety);
sp.GroupBy(barleyfarm,GroupByFunction.Average);

See the tutorial on grouping and splitting data for more examples.

Overloads

  • public void GroupBy(string[] values,string[] categories,GroupByFunction groupingFunction);
  • public void GroupBy(string[] values,string[] categories);
  • public void GroupBy(string[] values,GroupByFunction groupingFunction);
  • public void GroupBy(string[] values);
  • public void GroupBy(int[] values,int[] categories,GroupByFunction groupingFunction);
  • public void GroupBy(int[] values,int[] categories);
  • public void GroupBy(int[] values,GroupByFunction groupingFunction);
  • public void GroupBy(int[] values);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: GroupBy Method (String[],String[],GroupByFunction)

SharpPlot.GroupBy Method (String[],String[],GroupByFunction)

Group data into preset categories, specifying the grouping function to use (such as Count or Average).

public void GroupBy(
    string[] values,
    string[] categories,
    GroupByFunction groupingFunction
);

See also ...

SharpPlot Members | GroupBy Method


SharpPlot 2.51 User Manual: GroupBy Method (Int32[])

SharpPlot.GroupBy Method (Int32[])

Group integer data into default categories using summation.

public void GroupBy(
    int[] values
);

The ‘bins’ will simply be the distinct values in the data, taken in order of first appearance.

See also ...

SharpPlot Members | GroupBy Method


SharpPlot 2.51 User Manual: GroupBy Method (String[],String[])

SharpPlot.GroupBy Method (String[],String[])

Group data into preset categories, using summation.

public void GroupBy(
    string[] values,
    string[] categories
);

See also ...

SharpPlot Members | GroupBy Method


SharpPlot 2.51 User Manual: GroupBy Method (String[],GroupByFunction)

SharpPlot.GroupBy Method (String[],GroupByFunction)

Group data into default categories, specifying the grouping function to use (such as Count or Average).

public void GroupBy(
    string[] values,
    GroupByFunction groupingFunction
);

The ‘bins’ will simply be the distinct values in the data, taken in order of first appearance.

See also ...

SharpPlot Members | GroupBy Method


SharpPlot 2.51 User Manual: GroupBy Method (String[])

SharpPlot.GroupBy Method (String[])

Group data into default categories, using summation.

public void GroupBy(
    string[] values
);

The ‘bins’ will simply be the distinct values in the data, taken in order of first appearance.

See also ...

SharpPlot Members | GroupBy Method


SharpPlot 2.51 User Manual: GroupBy Method (Int32[],Int32[],GroupByFunction)

SharpPlot.GroupBy Method (Int32[],Int32[],GroupByFunction)

Group integer data into preset categories, specifying the grouping function to use (such as Count or Average).

public void GroupBy(
    int[] values,
    int[] categories,
    GroupByFunction groupingFunction
);

See also ...

SharpPlot Members | GroupBy Method


SharpPlot 2.51 User Manual: GroupBy Method (Int32[],Int32[])

SharpPlot.GroupBy Method (Int32[],Int32[])

Group integer data into preset categories, using simple summation.

public void GroupBy(
    int[] values,
    int[] categories
);

See also ...

SharpPlot Members | GroupBy Method


SharpPlot 2.51 User Manual: GroupBy Method (Int32[],GroupByFunction)

SharpPlot.GroupBy Method (Int32[],GroupByFunction)

Group integer data into default categories, specifying the grouping function to use (such as Count or Average).

public void GroupBy(
    int[] values,
    GroupByFunction groupingFunction
);

The ‘bins’ will simply be the distinct values in the data, taken in order of first appearance.

See also ...

SharpPlot Members | GroupBy Method


SharpPlot 2.51 User Manual: IncludeSource Method

SharpPlot.IncludeSource Method

Add arbitrary (SVG/EPS) content to beginning or end of output stream.

Example

sp.IncludeSource(svgfilters);

Overloads

  • public void IncludeSource(string textItems);
  • public void IncludeSource(string[] textItems);
  • public void IncludeSource(string arbitraryText,bool atend);

This would typically be used to add pre-written SVG filters to the final output. It can also add arbitrary content to the end of the generated output, by setting the atend value to true.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: IncludeSource Method (String,Boolean)

SharpPlot.IncludeSource Method (String,Boolean)

Add arbitrary content passed as a simple string to either end of output.

public void IncludeSource(
    string arbitraryText,
    bool atend
);

See also ...

SharpPlot Members | IncludeSource Method


SharpPlot 2.51 User Manual: IncludeSource Method (String)

SharpPlot.IncludeSource Method (String)

Add SVG filter to front of output stream.

public void IncludeSource(
    string textItems
);

See also ...

SharpPlot Members | IncludeSource Method


SharpPlot 2.51 User Manual: IncludeSource Method (String[])

SharpPlot.IncludeSource Method (String[])

Add SVG filter or EPS header passed as array of strings.

public void IncludeSource(
    string[] textItems
);

See also ...

SharpPlot Members | IncludeSource Method


SharpPlot 2.51 User Manual: MapCoords - Convert chart co-ordinates to points

SharpPlot.MapCoords – Convert chart co-ordinates to points

Maps values from chart axes to points, relative to current origin. Returns two matching arrays of x and y values. This is useful for positioning text output and drawing arbitrary text, for example to annotate data points.

Example

yvec = sp.GetYTickPositions();

sp.NoteStyle = NoteStyles.Absolute;
nyv = sp.MapCoords(0,yvec)[1];

foreach (double ny in nyv)
  sp.DrawNote("Hello",0,ny);

Overloads

  • public double[][] MapCoords(double xval,double yval);
  • public double[][] MapCoords(double xval,double[] yv);
  • public double[][] MapCoords(double[] xv,double yval);
  • public double[][] MapCoords(double[] xv,double[] yv);

Description

When positioning text, it may be useful to convert from the co-ordinate system of the chart (defined by the (x,y) axes) to points. This allows you to use Absolute Positioning of Notes or Keys which is much more useful when making simple typographic adjustments, such as centre-lining text on the x-height of the font.

This simple utility takes note of the current state of the chart, and converts matching arrays of x and y values to an array of arrays of points, with appropriate origin for use with the AbsolutePosition style.

See also ...

SharpPlot Members | GetXTickPositions Method | GetYTickPositions Method


SharpPlot 2.51 User Manual: MapCoords Method (Double[],Double[])

SharpPlot.MapCoords Method (Double[],Double[])

Maps a matched pair of (x,y) co-ordinate arrays to points.

public double[][] MapCoords(
    double[] xv,
    double[] yv
);

See also ...

SharpPlot Members | MapCoords – Convert chart co-ordinates to points


SharpPlot 2.51 User Manual: MapCoords Method (Double,Double[])

SharpPlot.MapCoords Method (Double,Double[])

Convert array of y-values.

public double[][] MapCoords(
    double xval,
    double[] yv
);

See also ...

SharpPlot Members | MapCoords – Convert chart co-ordinates to points


SharpPlot 2.51 User Manual: MapCoords Method (Double[],Double)

SharpPlot.MapCoords Method (Double[],Double)

Convert array of x-values.

public double[][] MapCoords(
    double[] xv,
    double yval
);

See also ...

SharpPlot Members | MapCoords – Convert chart co-ordinates to points


SharpPlot 2.51 User Manual: MapCoords Method (Double,Double)

SharpPlot.MapCoords Method (Double,Double)

Convert singleton (x,y) pair.

public double[][] MapCoords(
    double xval,
    double yval
);

See also ...

SharpPlot Members | MapCoords – Convert chart co-ordinates to points


SharpPlot 2.51 User Manual: NewCell Method

SharpPlot.NewCell Method

Move to the next cell in the current trellis.

This will reset cycles unless ResetOption is set to ResetOptions.CyclesPersist.

public void NewCell();

Example

sp.NewCell();

See also ...

SharpPlot Members | ResetOption Property | TrellisStyle Property


SharpPlot 2.51 User Manual: NewFrame Method

SharpPlot.NewFrame Method

Clear the area for a new chart with an optional new frame size and position. Properties are reset according to the current ResetOption.

Example

sp.NewFrame(4,220,280,210);

Overloads

  • public void NewFrame();
  • public void NewFrame(double width,double height);
  • public void NewFrame(double left,double top,double width,double height);

The default is to use the entire page for the chart, overlaying any previous chart. Otherwise it would be normal to set both position and size, to add a second chart anywhere in a defined region. This call can be used repeatedly to create an arbitrarily complex page with multiple graphics. For a simple tiled layout, it may be easier to have the trellis computed for you, and for an iteration through the same chart settings with repeated data, DrawMultiple will also handle the calculation of position and size for a set of similar frames.

See also ...

SharpPlot Members | ResetOption Property


SharpPlot 2.51 User Manual: NewFrame Method (Double,Double,Double,Double)

SharpPlot.NewFrame Method (Double,Double,Double,Double)

Clear the area for a new chart with new frame size and position.

public void NewFrame(
    double left,
    double top,
    double width,
    double height
);

See also ...

SharpPlot Members | NewFrame Method


SharpPlot 2.51 User Manual: NewFrame Method (Double,Double)

SharpPlot.NewFrame Method (Double,Double)

Base the frame in the top corner.

public void NewFrame(
    double width,
    double height
);

See also ...

SharpPlot Members | NewFrame Method


SharpPlot 2.51 User Manual: NewFrame Method ()

SharpPlot.NewFrame Method ()

Use all the available paper for the chart.

public void NewFrame();

See also ...

SharpPlot Members | NewFrame Method


SharpPlot 2.51 User Manual: NewPage Method

SharpPlot.NewPage Method

Page throw (useful for PDF only at present). By default this resets all properties back to their initial values according to the current ResetOption, but you can pass false here in which case options are not reset .

public void NewPage(bool);

Overloads

  • public void NewPage();

Example

sp.NewPage();

By setting suitable bookmarks, you can easily create an indexed chart portfolio as a PDF with an indented outline tree. This can be a good way to distribute a large number of related charts in a single document.

See also ...

SharpPlot Members | ResetOption Property | AddBookmark Method


SharpPlot 2.51 User Manual: NewPage Method ()

SharpPlot.NewPage Method ()

Start a new page, resetting all properties

public void NewPage();


SharpPlot 2.51 User Manual: NewYAxis Method

SharpPlot.NewYAxis Method

Partial reset to allow independent secondary Y-axis.

public void NewYAxis();

This call resets all the properties associated with the Y-axis, allowing any number of independently ranged vertical axes. The default alignment is ‘right’ but you may change the axis style, or use the XIntercept property, to place the new axis anywhere you like. This allows you to have as many Y-axes as you like, but more than 2 is unlikely to work well in practice.

Example

sp.NewYAxis();

This method is typically used for charts which compare two series with very different ranges, for example currencies such as the Dollar and the Yen.

See also ...

SharpPlot Members | XIntercept Property


SharpPlot 2.51 User Manual: NextNote Method (Double)

SharpPlot.NextNote Method (Double)

Find the correct baseline for a follow-on note when the previous note may have been wrapped. The result is suitable for passing to DrawNote as the second argument (the y-position).

public double NextNote(
    double headspace
);

Example

  sp.DrawNote("Hello from a wrapped note to check vertical spacing",2,20,0,1);
  next = sp.NextNote(12);  // 12pt headspace
  sp.DrawNote("Hello from another note",2,next);

The argument may be zero (to have the normal line-spacing applied) or may give additional inter-paragraph space in points. The return value will be in chart co-ordinates unless the note style has been set to ‘Absolute’ in which case it will be in points.

See also ...

DrawNote Method


SharpPlot 2.51 User Manual: ReadComment Method

SharpPlot.ReadComment Method

Recover a text comment, saved in any of the textual output formats. Only comments with associated keys can be recovered using this utility. This method may be called with a filename or the string result from any of the RenderXxx methods.

Example

sp.AddComment("This is some text with a key","NOTE1");
sp.AddComment("Now is the time for ALL good men to come to the aid of the party!","NOTE2",true);

// Recover both notes from EPS file
string note1 = SharpPlot.ReadComment("sample.eps","NOTE1");
string note2 = SharpPlot.ReadComment("sample.eps","NOTE2",true);

Overloads

  • public static string ReadComment(string filename,string key);
  • public static string ReadComment(string filename,string key,bool decode);

If the text was compressed when added to the chart with AddComment, you must pass the decode flag here to reverse the compression. Comments are protected against ‘bad’ XML characters in SVG and VML output whether or not they are compressed and this is reversed here before extraction.

See also ...

AddComment Method


SharpPlot 2.51 User Manual: ReadComment Method (String,String,Boolean)

SharpPlot.ReadComment Method (String,String,Boolean)

Recover comment given filename (or content as string), key and compression flag.

public static string ReadComment(
    string filename,
    string key,
    bool decode
);
filename
Name of file or string containing rendered content.
key
Short text used to identify original comment.
decode
Flag to deflate comment text.

See also ...

SharpPlot Members | ReadComment Method


SharpPlot 2.51 User Manual: ReadComment Method (String,String)

SharpPlot.ReadComment Method (String,String)

Read uncompressed note by key.

public static string ReadComment(
    string filename,
    string key
);
filename
Name of file or string containing rendered content.
key
Short text used to identify original comment.

See also ...

SharpPlot Members | ReadComment Method


SharpPlot 2.51 User Manual: ReadPdfStream Method

SharpPlot.ReadPdfStream Method

Recover a page of content from a compressed PDF. This is intended for debugging use, where there may have been a problem with Acrobat Reader failing to interpret the document. It is designed to read documents created by SharpPlot and is unlikely to work on other PDFs.

Example

// Recover a compressed page from a PDF for inspection
 string page = SharpPlot.ReadPdfStream(@"c:\temp\xx.pdf",1,true);

Overloads

  • public static string ReadPdfStream(string filename,int pageno);
  • public static string ReadPdfStream(string filename,int pageno,bool decode);

If the PDF was compressed you must pass the decode flag here to reverse the compression.


SharpPlot 2.51 User Manual: ReadPdfStream Method (String,Int32,Boolean)

SharpPlot.ReadPdfStream Method (String,Int32,Boolean)

Recover page given filename, page-number and compression flag.

public static string ReadPdfStream(
    string filename,
    int pageno,
    bool decode
);

See also ...

SharpPlot Members | ReadPdfStream Method


SharpPlot 2.51 User Manual: ReadPdfStream Method (String,Int32)

SharpPlot.ReadPdfStream Method (String,Int32)

Read uncompressed page.

public static string ReadPdfStream(
    string filename,
    int pageno
);

See also ...

SharpPlot Members | ReadPdfStream Method


SharpPlot 2.51 User Manual: RedrawAxes Method

SharpPlot.RedrawAxes Method

Overdraws the existing axes where data has obscured them. If this is called before any cjharts have been drawn, it flushes out all the fixed elements, such as headings, axes and gridlines.

public void RedrawAxes();

Example

sp.RedrawAxes();
  • public void RedrawAxes();
  • public void RedrawAxes(bool isFramed);

Where the chart axes have been draw with the ‘Framed’ style you should pass true here to have the complete frame redrawn. The default is just to over-draw the axes as specified in X and Y Axis styles. Similarly for exploded axes.

  • public void RedrawAxes();
  • public void RedrawAxes(bool isFramed);
  • public void RedrawAxes(bool isFramed,bool isExploded);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: RedrawAxes Method (Boolean,Boolean)

SharpPlot.RedrawAxes Method (Boolean,Boolean)

Overdraws the existing axes where data has obscured them, framing/exploding the chart if required.

public void RedrawAxes(
    bool isFramed,
    bool isExploded
);
isFramed
[todo]
isExploded
[todo]

Description

Used very rarely to tidy up axes which have been partially obscured by data May be called before any chart to have the axes and headings flushed out.

See also ...

SharpPlot Members | RedrawAxes Method


SharpPlot 2.51 User Manual: RedrawAxes Method (Boolean)

SharpPlot.RedrawAxes Method (Boolean)

Redraw with framed and unexploded axes.

public void RedrawAxes(
    bool isFramed
);
isFramed
[todo]

See also ...

SharpPlot Members | RedrawAxes Method


SharpPlot 2.51 User Manual: RedrawAxes Method

SharpPlot.RedrawAxes Method

Redraw unframed and unexploded axes.

public void RedrawAxes();

See also ...

SharpPlot Members | RedrawAxes Method


SharpPlot 2.51 User Manual: RenderBitmap Method

SharpPlot.RenderBitmap Method

Return completed chart rendered through raster engine.

Example

bitmap cht = sp.RenderBitmap(72);
cht.Save("cht.png",System.Drawing.Imaging.ImageFormat.Png);

Return Value

The result of this call is a Bitmap object, rendered by default at 96dpi. Ths is may then be saved to disk in any of the common image formats, typically PNG or JPEG to benefit from image compression. GIF is not recommended for images with gradient fills as it is limited to 256 colours and is likely to show some banding.

The text will be anti-aliased by default, but you may over-ride the text-rendering algorithm by passing in the standard .Net rendering hint as a final option.

If your chart has made use of hyperlinks or JavaScript calls, you will need to create an accompanying imagemap, and include it in the completed webpage.

Overloads

  • public Bitmap RenderBitmap();
  • public Bitmap RenderBitmap(int dpi);
  • public Bitmap RenderBitmap(int dpi,TextRenderingHint textmode);

Example

This script creates a simple chart and renders it for display in a web page:

<%@ page language="VB" AutoEventWireup="True"%>
<%@ Import Namespace = "System.Drawing" %>
<%@ Import Namespace = "System.Drawing.Imaging" %>
<%@ Import Namespace = "Causeway" %>

<Script Runat="Server">
  Sub Page_Load(sender as Object, e as EventArgs)
    Dim sp As Causeway.SharpPlot =  New Causeway.SharpPlot()
    sp.DrawPieChart(New Integer(){34,23})

    Dim bitmap As Bitmap
    bitmap = sp.RenderBitmap()
    Dim stream As System.IO.MemoryStream
    stream = New System.IO.MemoryStream()
    bitmap.Save(stream, ImageFormat.Png)

    Response.Clear()
    Response.ClearHeaders()
    Response.ContentType = "image/png"
    Response.BinaryWrite(stream.ToArray())
    Response.End()

  End Sub
</Script>

Note the lines:

    Response.ContentType = "image/png"
    Response.BinaryWrite(stream.ToArray())

which set the correct type for the returned image and then return the rendered chart as a binary stream. To write the completed image to file, you could use:

   // Create a bitmap and save as PNG ...
    Bitmap chart = sp.RenderBitmap(72);
    chart.Save("Simple.png",System.Drawing.Imaging.ImageFormat.Png);
    Console.WriteLine("Image written to Simple.png at 72dpi");

For images to be used in printed material, you probably should use at least 300dpi to get acceptable quality.

See also ...

SharpPlot Members | RenderImageMap Method | SaveImage Method


SharpPlot 2.51 User Manual: RenderBitmap Method (Int32,TextRenderingHint)

SharpPlot.RenderBitmap Method (Int32,TextRenderingHint)

Return Bitmap rendered at given dpi and chosen antialiased text.

public Bitmap RenderBitmap(
    int dpi,
    TextRenderingHint textmode
);

See also ...

SharpPlot Members | RenderBitmap Method


SharpPlot 2.51 User Manual: RenderBitmap Method (Int32)

SharpPlot.RenderBitmap Method (Int32)

Return Bitmap at default resolution.

public Bitmap RenderBitmap(
    int dpi
);

See also ...

SharpPlot Members | RenderBitmap Method


SharpPlot 2.51 User Manual: RenderBitmap Method ()

SharpPlot.RenderBitmap Method ()

Return Bitmap at default resolution.

public Bitmap RenderBitmap();

See also ...

SharpPlot Members | RenderBitmap Method


SharpPlot 2.51 User Manual: RenderChartLog Method

SharpPlot.RenderChartLog Method

Return completed chart as a readable log with optional prescan.

public string RenderChartLog(
    bool prescan
);
prescan
Flag to allow the prescan code to run on the intermediate page format.
return value
Readable version of internal chart macros.

The prescan flag will parse any HTML tagged text into simple settings of font and associated text fragments. It will also ensure 7-bit ASCII output by HTML-encoding any hi-bit or Unicode characters.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: RenderEps Method

SharpPlot.RenderEps Method

Return completed chart rendered through EPS engine.

Example

string eps = sp.RenderEps();
string mono = sp.RenderEps(true);

Return Value

The result of this call is a string representation of an Encapsulated PostScript document. This may be written to file as text for inclusion in a compound document which is to be printed on any PostScript device. If the final output is to be monochrome, it is better to have SharpPlot render the chart in black and white at this point, rather than rely on the printer to greyscale it.

Note that this does not save any preview information in the file, so if it is printed on a non-PostScript printer all the images will show only as placeholders, with the chart title and date of creation as notes.

Overloads

  • public string RenderEps();
  • public string RenderEps(bool forceMonochrome);
  • public string RenderEps(bool forceMonochrome,string prefix);

If you require any ‘special’ PostScript to be run on the front of the file, you may include it as the third parameter.

See also ...

SharpPlot Members | TitleBar Property | SaveEps Method


SharpPlot 2.51 User Manual: RenderEps Method (Boolean,String)

SharpPlot.RenderEps Method (Boolean,String)

Return completed chart as EPS with monochrome switch and prefix information.

public string RenderEps(
    bool forceMonochrome,
    string prefix
);

See also ...

SharpPlot Members | RenderEps Method


SharpPlot 2.51 User Manual: RenderEps Method ()

SharpPlot.RenderEps Method ()

Return completed chart as full-color EPS.

public string RenderEps();

See also ...

SharpPlot Members | RenderEps Method


SharpPlot 2.51 User Manual: RenderEps Method (Boolean)

SharpPlot.RenderEps Method (Boolean)

Return completed chart as EPS with monochrome switch.

public string RenderEps(
    bool forceMonochrome
);

See also ...

SharpPlot Members | RenderEps Method


SharpPlot 2.51 User Manual: RenderImageMap Method

SharpPlot.RenderImageMap Method

Return tags to make an HTML imagemap for completed chart.

Example

string map = sp.RenderImageMap(72);

Return Value

The result of this call is a string containing an HTML client-side imagemap. This is designed to accompany a Bitmap, and is scaled by default to match a 96dpi rendering. This may be written to a webpage to allow hyperlinks and simple JavaScript calls to work with images as well as VML or SVG pages.

Note that the Chart Name is used as the reference for the image, so it would be helpful for readability to use a non-default name here. Note also that the order of the area tags is intentionally reversed, so that the items drawn last get precedence in the map.

Overloads

  • public string RenderImageMap();
  • public string RenderImageMap(int dpi);

Example

A typical imagemap for a 3-sector piechart would look like:

<map id=tutor2b>
 <area shape="poly" coords="216,174, ... ,71" href="http://www.causeway.co.uk" />
 <area shape="poly" coords="216,174, ... ,259" href="http://www.grapl.net" />
 <area shape="poly" coords="216,174, ... ,93" href="http://www.sharpplot.com" />
</map>

Here, polygons are used to approximate the outline of each pie sector. For a scatterplot, circles would be drawn around each point (4 pixel radius) and for barcharts rectangles are used to match the outline of each bar.

See also ...

SharpPlot Members | RenderBitmap Method | SetChartName Method


SharpPlot 2.51 User Manual: RenderImageMap Method (Int32)

SharpPlot.RenderImageMap Method (Int32)

Return tags to make an HTML imagemap for chart at given dpi.

public string RenderImageMap(
    int dpi
);

See also ...

SharpPlot Members | RenderImageMap Method


SharpPlot 2.51 User Manual: RenderImageMap Method ()

SharpPlot.RenderImageMap Method ()

Return tags to make an HTML imagemap for chart at 72dpi.

public string RenderImageMap();

See also ...

SharpPlot Members | RenderImageMap Method


SharpPlot 2.51 User Manual: RenderJsonChartMap

SharpPlot.RenderJsonChartMap

Return a JSON-formatted array to facilitate active graphics applications.

public string RenderJsonChartMap();

Example

string map = sp.RenderJsonChartMap();

Description

All data items processed by the chart construction create hotspots which may react to mouse events. There are 3 types of hotspot recorded, depending on the chart type:

  1. Rectangles – used by barcharts and also any text regions such as headings and axis labels
  2. Circles – used by ScatterPlots to create a fixed-radius area around all markers
  3. Polygons – used by Piecharts to outline each wedge (in 20deg segments)

If AddAttibutes has been used to put handlers on text items, hotspots will be created for these. Otherwise there will be on hotspot for each data item, keyed by chart name and series name. A typical array would contain several of these, for example a barchart with 2 data series (each with 3 bars) would generate a section of the array like this:

["Apparel","Hats","rect",[84,249,123,362],[["title","Hat 3"]],
["Apparel","Hats","rect",[249,174,288,362],[["title","Hat 5"]],
["Apparel","Hats","rect",[413,99,452,362],[["title","Hat 7"]],
["Apparel","Coats","rect",[147,61,186,362],[["title","Coat 8"]],
["Apparel","Coats","rect",[311,174,350,362],[["title","Coat 5"]],
["Apparel","Coats","rect",[476,212,515,362],[["title","Coat 4"]],

Here we have named both the chart “Apparel”” and each series to make the example clearer. By default, SharpPlot will generate names “chart1” and ‘Series1,Series2” for you.

The format of each hotspot is standard, and consists of:

  1. The chart name as a string
  2. The series name as a string
  3. The hotspot type as a string (“rect”,”circ”, or “poly” as used in ImageMaps)
  4. The hotspot location as an array. Rectangles are x,y,x,y, circles are x,y,r, polys are x,y, ... x,y pairs.
  5. Additional attributes as an array of Property,Value pairs of strings.

If we add some attributes to the chart legend, the map will contain lines like this:

["Guesses","Key","rect",[59,392,157,407],[["KeyFactor","100"],["KeyStyle","Low"]],
["Guesses","Key","rect",[161,392,261,407],[["KeyFactor","200"],["KeyStyle","Medium"]],
["Guesses","Key","rect",[266,392,374,407],[["KeyFactor","300"],["KeyStyle","High"]],

Here the second element is the value from the HotspotType enumeration, rather than a series identifier.

The entire array will be enclosed with an opening ‘[’ and a closing ‘];’ to allow the programmer to recover the content with a simple eval statement and then to add appropriate behaviours when the mouse is within any of the defined regions.

See also ...

SharpPlot Members | HotspotType Enumeration | PageMap Class – Introduction


SharpPlot 2.51 User Manual: RenderMetafile Method

SharpPlot.RenderMetafile Method

Return completed chart rendered as a Metafile object.

Example

metafile cht = sp.RenderMetaFile();
  • public Metafile RenderMetafile();
  • public Metafile RenderMetafile(System.Drawing.Imaging.EmfType emftype);
  • public Metafile RenderMetafile(Stream stream);
  • public void RenderMetafile(Stream stream,System.Drawing.Imaging.EmfType emftype);

Return Value

The result of this call is a Metafile object which may be used as required to save the chart to file, or display it on an application control such as a PictureBox. There is no result if the user passes a Stream – the EMF content is simply appended to the stream.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: RenderMetafile Method (EmfType)

SharpPlot.RenderMetafile Method (EmfType)

Return completed chart as Metafile with PlusDual format.

public Metafile RenderMetafile(
    System.Drawing.Imaging.EmfType emftype
);
emftype
Specifies the nature of the records that are placed in an EMF.

See also ...

SharpPlot Members | RenderMetafile Method


SharpPlot 2.51 User Manual: RenderMetafile Method

SharpPlot.RenderMetafile Method

All EMF+ records in the metafile are associated with an alternate EMF record.

public Metafile RenderMetafile();

See also ...

SharpPlot Members | RenderMetafile Method


SharpPlot 2.51 User Manual: RenderMetafile Method (Stream,EmfType)

SharpPlot.RenderMetafile Method (Stream,EmfType)

Write typed Metafile to given Stream.

public void RenderMetafile(
    Stream stream,
    System.Drawing.Imaging.EmfType emftype
);
stream
Any generic Stream
emftype
Specifies the nature of the records that are placed in an EMF.

See also ...

SharpPlot Members | RenderMetafile Method


SharpPlot 2.51 User Manual: RenderMetafile Method (Stream)

SharpPlot.RenderMetafile Method (Stream)

Write Metafile to given Stream.

public void RenderMetafile(
    Stream stream,
);
stream
Any generic Stream

See also ...

SharpPlot Members | RenderMetafile Method


SharpPlot 2.51 User Manual: RenderPageMap Method

SharpPlot.RenderPageMap Method

Return an instance of the PageMap class to allow active graphics applications.

public PageMap RenderPageMap();

Example

PageMap map = sp.RenderPageMap();

Description

The PageMap class has a number of methods to allow a graphical application to track the cursor, report hints or tips, and allow the user to drag-select data-points.

See also ...

SharpPlot Members | HotspotInfo Struct | PageMap Class – Introduction


SharpPlot 2.51 User Manual: RenderPdf Method

SharpPlot.RenderPdf Method

Return completed chart rendered through through PDF engine.

Example

string mypdf = sp.RenderPdf();

Return Value

The result of this call is a string representation of an Adobe PDF. This may be written to file as text or returned via HTTP as type “application/pdf” to have it displayed by a web-browser.

   // Create a PDF and write the chart to it ...
    StreamWriter sw = new StreamWriter("Chart1.pdf",false,System.Text.Encoding.ASCII);
    string chart = sp.RenderPdf(PdfMode.ShowOutlines);
    sw.Write(chart);
    sw.Close();

Overloads

  • public string RenderPdf();
  • public string RenderPdf(PdfMode mode);
  • public string RenderPdf(bool deflate);
  • public string RenderPdf(PdfMode mode,string noembed,bool deflate);

Embedding the PDF into a webpage

If you want to write the PDF content directly into a webpage, you should give it the correct content type “application/pdf”, and link to it with an appropriate <embed> tag such as:

<embed src="makepdf.aspx" height=300 width=640 type="application/pdf" >

The ‘PageMode’ parameter of RenderPDF should be set to FullScreen here, which causes the Acrobat Reader to occupy the entire frame set up by the <embed> tag with no toolbars or scrollbars. If you render a multipage PDF here, set the flag to ShowOutlines and allow enough extra space for the outline pane and Acrobat Reader toolbars. You will probably need to experiment to get the height and width to look correct.

See also ...

SharpPlot Members | SavePdf Method | PdfMode Enumeration


SharpPlot 2.51 User Manual: RenderPdf Method (PdfMode,String,Boolean)

SharpPlot.RenderPdf Method (PdfMode,String,Boolean)

Return chart as a string to be viewed in a specified open mode with selected embedded fonts and optional compression.

public string RenderPdf(
    PdfMode mode,
    string noembed,
    bool deflate
);
mode
Controls how the PDF is shown on opening.
noembed
Selected fonts to be omitted (comma-sep list of names).
deflate
Switch controls default file compression to enable saved comments in output.
return value
Text representation of PDF instructions.

See also ...

SharpPlot Members | RenderPdf Method


SharpPlot 2.51 User Manual: RenderPdf Method

SharpPlot.RenderPdf Method

Returned PDF will be opened in user’s default view.

public string RenderPdf();

Result

Text representation of PDF instructions.

See also ...

SharpPlot Members | RenderPdf Method


SharpPlot 2.51 User Manual: RenderPdf Method (PdfMode)

SharpPlot.RenderPdf Method (PdfMode)

PDF will have all non-native fonts embedded and is compressed.

public string RenderPdf(
    PdfMode mode
);
mode
Controls how the PDF is shown on opening.
return value
Text representation of PDF instructions.

See also ...

SharpPlot Members | RenderPdf Method


SharpPlot 2.51 User Manual: RenderPdf Method (Boolean)

SharpPlot.RenderPdf Method (Boolean)

PDF optionally compressed, opens in default mode and has fonts embedded.

public string RenderPdf(
    bool deflate
);
deflate
Switch controls default file compression to enable saved comments in output.
return value
Text representation of PDF instructions.

See also ...

SharpPlot Members | RenderPdf Method


SharpPlot 2.51 User Manual: RenderPS Method

SharpPlot.RenderPS Method

Return chart rendered as raw PostScript.

Example

sp.RenderPS(false,true); // for Distiller

Return Value

The result of this call is a string representation of a PostScript document. This may be written to file as text or directly to any PostScript device. If the final output is to be monochrome, it is better to have SharpPlot render the chart in black and white at this point, rather than rely on the printer to greyscale it.

If you want to use Acrobat Distiller to create a PDF from the chart, be sure to include the media information which will set the papersize to the same size as the chart.

Overloads

  • public string RenderPS();
  • public string RenderPS(bool forceMonochrome);
  • public string RenderPS(bool forceMonochrome,bool mediaBox);
  • public string RenderPS(bool forceMonochrome,bool mediaBox,string prologue);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: RenderPS Method (Boolean,Boolean,String)

SharpPlot.RenderPS Method (Boolean,Boolean,String)

Return completed chart to file as raw PostScript with monochrome and mediabox flags and extra PS prologue.

public string RenderPS(
    bool forceMonochrome,
    bool mediaBox,
    string prologue
);

See also ...

SharpPlot Members | RenderPS Method


SharpPlot 2.51 User Manual: RenderPS Method ()

SharpPlot.RenderPS Method ()

Return completed chart as raw PostScript in full color with no mediabox information.

public string RenderPS();

See also ...

SharpPlot Members | RenderPS Method


SharpPlot 2.51 User Manual: RenderPS Method (Boolean)

SharpPlot.RenderPS Method (Boolean)

Return completed chart as raw PostScript with monochrome flag.

public string RenderPS(
    bool forceMonochrome
);

See also ...

SharpPlot Members | RenderPS Method


SharpPlot 2.51 User Manual: RenderPS Method (Boolean,Boolean)

SharpPlot.RenderPS Method (Boolean,Boolean)

Return completed chart as raw PostScript with monochrome and mediabox flags.

public string RenderPS(
    bool forceMonochrome,
    bool mediaBox
);

See also ...

SharpPlot Members | RenderPS Method


SharpPlot 2.51 User Manual: RenderSvg Method

SharpPlot.RenderSvg Method

Return completed chart rendered through SVG engine.

Example

string mysvg = sp.RenderSvg(SvgMode.FixedAspect);

Return Value

The result of this call is a string representation of an SVG document. This may be written to file as text for inclusion in a webpage, or returned via HTTP with content type “image/svg+xml”.

Overloads

  • public string RenderSvg();
  • public string RenderSvg(SvgMode mode);
  • public string RenderSvg(SvgMode mode,string headerText);

Working with SVG

Most modern browsers (including Microsoft Internet Explorer 9 – 2011) natively support SVG. So not only they will display SVG files save with SaveSvg, but you can also inline the string returned by RenderSvg directly into you HTML body.

For compatibility with older browsers, you can embed the SVG using the <embed> tag :

<embed src="mychart.svg" height=300 width=640 type="image/svg+xml">

See also ...

SharpPlot Members | SaveSvg Method


SharpPlot 2.51 User Manual: RenderSvg Method (SvgMode,String)

SharpPlot.RenderSvg Method (SvgMode,String)

Return chart as an SVG file with aspect ratio setting and extra header text.

public string RenderSvg(
    SvgMode mode,
    string headerText
);

See also ...

SharpPlot Members | RenderSvg Method


SharpPlot 2.51 User Manual: RenderSvg Method ()

SharpPlot.RenderSvg Method ()

Return chart as fixed size SVG.

public string RenderSvg();

See also ...

SharpPlot Members | RenderSvg Method


SharpPlot 2.51 User Manual: RenderSvg Method (SvgMode)

SharpPlot.RenderSvg Method (SvgMode)

Return chart as SVG with given aspect ratio setting.

public string RenderSvg(
    SvgMode mode
);

See also ...

SharpPlot Members | RenderSvg Method


SharpPlot 2.51 User Manual: RenderVml Method

SharpPlot.RenderVml Method

Return completed chart rendered as Vector Markup (VML).

VML is not supported by Microsoft and should not be used, unless for backwards compatibility reasons.

public string RenderVml();

Return Value

The result of this call is a string representation of a partial HTML document. This may be written to file as text, or returned via HTTP as a section in a normal webpage. You may have several VML sections in a single page. They are automatically named with the current chart name if this is set to a non-default value.

If your page has any VML content, it must begin with the standard VML header to define the behavior of the <v:xxx> tags to the browser.

Example

string myvml = sp.RenderVml();

Overloads

  • public string RenderVml();
  • public string RenderVml(bool showpaper);
  • public string RenderVml(bool showPaper,double dpi);

Sizing the rendered graphic

The default is to express all text sizes and positions in pts (72 pts = 1 inch) and to use pts to give the size of the entire block of VML. If you prefer to use pixels, you can pass the required dpi conversion (passing 96 here will have no visible effect on most video adaptors at default resolution). This allows you to fix the size of the graphic more reliably on websites which use pixels for design reasons. It also allows you to make thumbnails of the charts with no extra processing.

Working with VML

Please note that VML is a Microsoft-specific format and is only supported in Internet Explorer 5.5 and above. However it runs ‘native’ in the browser and can be used to put an entire page inline, rather than required callbacks to the server to obtain charts as SVG or raster images.

To make IE understand the VML tags, you MUST include the appropriate behavior tag in the header, so the sample code shown below is typical of what you need to create a functional webpage:

   // Render to HTML file as VML
    StreamWriter sw = new StreamWriter("Simple.htm",false,System.Text.Encoding.ASCII);
    string chart = sp.RenderVml(false);
    sw.Write("<html>");
    sw.Write("<head>");
    sw.Write(sp.VmlHeader);  // Add the header detail
    sw.Write("<title>SharpPlot - Simple chart</title>");
    sw.Write("</head>");
    sw.Write("<body>");
    sw.Write(chart);
    sw.Write("</body>");
    sw.Write("</html>");
    sw.Close();

This will create a complete page with your chart shown correctly within it.

Rendering the finished chart as VML

This is the simplest option for internet use, as the chart can be included directly into the html page under construction:

string mychart = sp.RenderVml()

The call to RenderVml completes the current chart and returns the entire chart definition as a simple XML string bounded by <div> .... </div> tags. For this to be shown by the browser, you must ensure that your page has the correct VML header section to declare the XML namespace:

<xml:namespace prefix="v"/>
<style>
 v\:* {behavior=url(#default#VML)}
</style>

You can include these yourself, or have SharpPlot define them for you:

string vmlHeader = sp.VmlHeader

This must go right at the top of the page, before even the <head> section. You can then construct the remainder of the page as normal, including as many VML sections as you need, as part of the HTML output stream.

See also ...

SharpPlot Members | VmlHeader Property | SaveVml Method | SetChartName Method


SharpPlot 2.51 User Manual: RenderVml Method (Boolean,Double)

SharpPlot.RenderVml Method (Boolean,Double)

Return chart rendered as VML with optional paper outline and conversion to pixels.

public string RenderVml(
    bool showPaper,
    double dpi
);
showPaper
[todo]
dpi
[todo]

See also ...

SharpPlot Members | RenderVml Method


SharpPlot 2.51 User Manual: RenderVml Method

SharpPlot.RenderVml Method

Return chart as a string of VML code with pts units.

public string RenderVml();

See also ...

SharpPlot Members | RenderVml Method


SharpPlot 2.51 User Manual: RenderVml Method (Boolean)

SharpPlot.RenderVml Method (Boolean)

Return chart as a string of VML with optional paper and pts units.

public string RenderVml(
    bool showpaper
);
showpaper
[todo]

See also ...

SharpPlot Members | RenderVml Method


SharpPlot 2.51 User Manual: RenderXaml Method

SharpPlot.RenderXaml Method

This method returns the chart expressed as a XAML Canvas, with optional scaling. The default scale converts points to pixels at 96/72 and will produce the same size image as the chart rendered to SVG. The chart can be viewed on the web in most common browsers with the SilverLight plugin.

Example

string xaml = sp.RenderXaml(1.5);    // Save as bare Canvas slightly scaled up

Overloads

  • public string RenderXaml();
  • public string RenderXaml(double scale);
  • public string RenderXaml(double scale,string headerText);

Description

To make use of this format on the internet, you will need the SilverLight plugin from Microsoft, and an appropriate ‘wrapper’ HTML page to load the plugin and render the XAML content.

Your page should reference the silverlight.js file supplied with the plugin, and also the silverplot.js file supplied with SharpPlot which adds support for hints, tips and hyperlinks to your charts.

See also ...

SharpPlot Members | SaveXaml Method


SharpPlot 2.51 User Manual: RenderXaml Method (Double,String)

SharpPlot.RenderXaml Method (Double,String)

Return chart as a XAML Canvas at given scale with additional header content.

public string RenderXaml(
    double scale,
    string headerText
);

Parameters and Result

scale
Scaling to pixels (default 1.33).
headerText
Extra attributes to populate Canvas tag.
return value
Completed XAML Canvas containing entire chart.

See also ...

SharpPlot Members | RenderXaml Method


SharpPlot 2.51 User Manual: RenderXaml Method ()

SharpPlot.RenderXaml Method ()

Returned XAML will be scaled to match points to pixels.

public string RenderXaml();

Result

Completed XAML Canvas containing entire chart.

See also ...

SharpPlot Members | RenderXaml Method


SharpPlot 2.51 User Manual: RenderXaml Method (Double)

SharpPlot.RenderXaml Method (Double)

Returned XAML will be scaled with no added header text.

public string RenderXaml(
    double scale
);

Parameters and Result

scale
Scaling to pixels (default 1.33).
return value
Completed XAML Canvas containing entire chart.

See also ...

SharpPlot Members | RenderXaml Method


SharpPlot 2.51 User Manual: Reset Method

SharpPlot.Reset Method

Clear SharpPlot taking optional paper size (width,height in pts) which determines the SVG viewbox, the size of an image rendered at default dpi, and so on.

Example

sp.Reset(newWidth,newHeight);

Overloads

  • public void Reset();
  • public void Reset(int width,int height);

If no argument is given, this clear the current instance of SharpPlot with default paper size (432 pts wide by 324 points high):

See also ...

SharpPlot Members | ResetProperties Method


SharpPlot 2.51 User Manual: ResetKey Method

SharpPlot.ResetKey Method

Removes any accumulated legend placeholders.

public void ResetKey();

Example

sp.ResetKey();

This may be useful if any graphing methods (such as DrawLineGraph) have been used to place arbitrary guidelines or other artwork before the actual data is drawn. The key placeholders which will be accumulated by the prior drawing commands should be cleared to prevent them appearing in the legend.


SharpPlot 2.51 User Manual: ResetProperties Method

SharpPlot.ResetProperties Method

All properties except trellis definitions are returned to default values.

Some settings can be preserved with ResetOption.

public void ResetProperties();

Example

sp.ResetProperties();

This may be required if you have a trellis of several charts, and want properties to persist across some, but not all of them.

To reset any individual property to its default value, you can generally call its Set method with no arguments, for example:

sp.SetYRange(1000); // Maximum
sp.SetYRange(-20,20); // Span
sp.SetYRange(); // Return to unset state

For a simple scalar property which takes a double, use double.Nan to return it to default.

See also ...

SharpPlot Members | ResetOption Property | TrellisStyle Property


SharpPlot 2.51 User Manual: Reset Method (Int32,Int32)

SharpPlot.Reset Method (Int32,Int32)

Clear SharpPlot to new paper size.

public void Reset(
    int width,
    int height
);

See also ...

SharpPlot Members | Reset Method


SharpPlot 2.51 User Manual: Reset Method ()

SharpPlot.Reset Method ()

Retains existing page size.

public void Reset();

See also ...

SharpPlot Members | Reset Method


SharpPlot 2.51 User Manual: SaveChartLog Method

SharpPlot.SaveChartLog Method

Saves a debug log to a text file. This may be useful in helping to identify errors when the chart is rendered.

Example

sp.SaveChartLog("debug.log");

Overloads

  • public void SaveChartLog(string filename);
  • public void SaveChartLog(string filename,bool prescan,bool detail);

The optional prescan flag will parse any HTML tagged text into simple settings of font and associated text fragments. It will also ensure 7-bit ASCII output by HTML-encoding any hi-bit or Unicode characters.

The standard log only records drawing instructions – this makes it ideal for text comparison tools to check for changes to graphics output. You can also add logging of internal settings (used for animations and JavaScript handlers) if you need to debug these.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SaveChartLog Method (String,Boolean,Boolean)

SharpPlot.SaveChartLog Method (String,Boolean,Boolean)

Summary todo!

public void SaveChartLog(
    string filename,
    bool prescan,
    bool detail
);
filename
Name of output text file.
prescan
Flag to allow the prescan code to run on the intermediate page format.
detail
Flag to allow chart ids and other detail to be shown in addition to basic logging.

See also ...

SharpPlot Members | SaveChartLog Method


SharpPlot 2.51 User Manual: SaveChartLog Method (String)

SharpPlot.SaveChartLog Method (String)

Save debug log before prescan with no extra detail.

public void SaveChartLog(
    string filename
);
filename
Name of output text file.

See also ...

SharpPlot Members | SaveChartLog Method


SharpPlot 2.51 User Manual: SaveEps Method

SharpPlot.SaveEps Method

Saves the current chart to a text file in Encapsulated PostScript format.

Example

sp.SaveEps("chart.eps",false);

Overloads

  • public void SaveEps(string filename);
  • public void SaveEps(string filename,bool forceMonochrome);
  • public void SaveEps(string filename,bool forceMonochrome,string prefix);

Description

See RenderEps for more details on this format.

See also ...

SharpPlot Members | RenderEps Method


SharpPlot 2.51 User Manual: SaveEps Method (String,Boolean,String)

SharpPlot.SaveEps Method (String,Boolean,String)

Save completed chart as EPS with monochrome switch and prefix information.

public void SaveEps(
    string filename,
    bool forceMonochrome,
    string prefix
);

See also ...

SharpPlot Members | SaveEps Method


SharpPlot 2.51 User Manual: SaveEps Method (String)

SharpPlot.SaveEps Method (String)

Save completed chart as EPS.

public void SaveEps(
    string filename
);

See also ...

SharpPlot Members | SaveEps Method


SharpPlot 2.51 User Manual: SaveEps Method (String,Boolean)

SharpPlot.SaveEps Method (String,Boolean)

Save completed chart as EPS with monochrome switch.

public void SaveEps(
    string filename,
    bool forceMonochrome
);

See also ...

SharpPlot Members | SaveEps Method


SharpPlot 2.51 User Manual: SaveImage Method

SharpPlot.SaveImage Method

The chart is written to file in the required image format (bitmap if not supplied).

Example

sp.SaveImage("chart.png",System.Drawing.Imaging.ImageFormat.Png,144);
sp.SaveImage("chart.emf",System.Drawing.Imaging.ImageFormat.Emf);

Overloads

  • public void SaveImage(string filename);
  • public void SaveImage(string filename,ImageFormat format);
  • public void SaveImage(string filename,ImageFormat format,int dpi);
  • public void SaveImage(string filename,ImageFormat format,EmfType emftype);
  • public void SaveImage(string filename,ImageFormat format,TextRenderingHint textmode);
  • public void SaveImage(string filename,ImageFormat format,int dpi,TextRenderingHint textmode);
  • public void SaveImage(string filename,ImageFormat format,EmfType emftype,TextRenderingHint textmode);

Description

To prepare an image for publication, you may need a DPI setting of 300-1200 depending on the demands of the repro house. For a chart to be shown on the web, a resolution of 96dpi is generally adequate. The text will be anti-aliased by default, but you may over-ride the text-rendering algorithm by passing in the standard .Net rendering hint as a final option.

For charts saved as Metafiles you may need to experiment with the optimum EmfType parameter. Modern software should read the new GDI+ metafile tags correctly, but older applications may require the old tags as a fallback. The default is to use both forms, but this may make the file larger than you need.

See also ...

SharpPlot Members | RenderBitmap Method | RenderMetafile Method


SharpPlot 2.51 User Manual: SaveImage Method (String,ImageFormat,Int32,TextRenderingHint)

SharpPlot.SaveImage Method (String,ImageFormat,Int32,TextRenderingHint)

Save specified image to file with given resolution and rendering hint.

public void SaveImage(
    string filename,
    ImageFormat format,
    int dpi,
    TextRenderingHint textmode
);

See also ...

SharpPlot Members | SaveImage Method


SharpPlot 2.51 User Manual: SaveImage Method (String,ImageFormat,EmfType,TextRenderingHint)

SharpPlot.SaveImage Method (String,ImageFormat,EmfType,TextRenderingHint)

Save specified image to file with given metafile type and rendering hint.

public void SaveImage(
    string filename,
    ImageFormat format,
    EmfType emftype,
    TextRenderingHint textmode
);

See also ...

SharpPlot Members | SaveImage Method


SharpPlot 2.51 User Manual: SaveImage Method (String,ImageFormat,TextRenderingHint)

SharpPlot.SaveImage Method (String,ImageFormat,TextRenderingHint)

Save specified image to file with given anti-alias at 96dpi.

public void SaveImage(
    string filename,
    ImageFormat format,
    TextRenderingHint textmode
);

See also ...

SharpPlot Members | SaveImage Method


SharpPlot 2.51 User Manual: SaveImage Method (String,ImageFormat,Int32)

SharpPlot.SaveImage Method (String,ImageFormat,Int32)

Save specified image to file with given resolution.

public void SaveImage(
    string filename,
    ImageFormat format,
    int dpi
);

See also ...

SharpPlot Members | SaveImage Method


SharpPlot 2.51 User Manual: SaveImage Method (String,ImageFormat,EmfType)

SharpPlot.SaveImage Method (String,ImageFormat,EmfType)

Save specified image to file with given metafile type.

public void SaveImage(
    string filename,
    ImageFormat format,
    EmfType emftype
);

See also ...

SharpPlot Members | SaveImage Method


SharpPlot 2.51 User Manual: SaveImage Method (String,ImageFormat)

SharpPlot.SaveImage Method (String,ImageFormat)

Save specified image to file with default resolution or metafile type.

public void SaveImage(
    string filename,
    ImageFormat format
);

See also ...

SharpPlot Members | SaveImage Method


SharpPlot 2.51 User Manual: SaveImage Method (String)

SharpPlot.SaveImage Method (String)

Save image to file as Bitmap at default resolution.

public void SaveImage(
    string filename
);

See also ...

SharpPlot Members | SaveImage Method


SharpPlot 2.51 User Manual: SavePdf Method

SharpPlot.SavePdf Method

This saves your chart in Portable Document Format for distribution to anyone who has the Adobe Acrobat Reader 4.0 or higher.

Example

sp.SavePdf("chart.pdf",PdfMode.FullScreen);

Overloads

  • public void SavePdf(string filename);
  • public void SavePdf(string filename,PdfMode mode);
  • public void SavePdf(string filename,bool deflate);
  • public void SavePdf(string filename,PdfMode mode,bool deflate);
  • public void SavePdf(string filename,PdfMode mode,string noembed,bool deflate);

The default is to have the document open in the user’s default mode, to embed all non-standard TrueType fonts and to compress the PDF content. You can set the Open Mode to open the outlines window, or to start with the document in full-screen view (useful for presentations).

By default, all fonts except the ‘base-14’ set will be embedded in the document automatically. If you are sure that all your potential viewers will have the fonts you have used, then set the noembed list to the names of the safe fonts, for example “Verdana,Perpetua” would be typical. This will make the document very much smaller, and the Acrobat Reader will usually be quite successful in substituting missing fonts if you are unlucky.

Compression is standard in PDF production (as well as reducing the document size it makes the material much harder to tamper with) but you may turn it off, either to assist in debugging a rendering problem or to preserve comments added with AddComment . Typically this would be to have a post-processing job catalogue the documents using tags saved in the comments.

See also ...

SharpPlot Members | RenderPdf Method


SharpPlot 2.51 User Manual: SavePdf Method (String,PdfMode,String,Boolean)

SharpPlot.SavePdf Method (String,PdfMode,String,Boolean)

Save report as a PDF to be rendered in a specified open mode with selected embedded fonts and optional compression.

public void SavePdf(
    string filename,
    PdfMode mode,
    string noembed,
    bool deflate
);

See also ...

SharpPlot Members | SavePdf Method


SharpPlot 2.51 User Manual: SavePdf Method (String,PdfMode)

SharpPlot.SavePdf Method (String,PdfMode)

PDF will have all non-native fonts embedded and is compressed.

public void SavePdf(
    string filename,
    PdfMode mode
);

See also ...

SharpPlot Members | SavePdf Method


SharpPlot 2.51 User Manual: SavePdf Method (String)

SharpPlot.SavePdf Method (String)

PDF will be opened in user’s default view with all fonts embedded and will be compressed.

public void SavePdf(
    string filename
);

See also ...

SharpPlot Members | SavePdf Method


SharpPlot 2.51 User Manual: SavePdf Method (String,Boolean)

SharpPlot.SavePdf Method (String,Boolean)

PDF optionally compressed, opens in default mode and has fonts embedded.

public void SavePdf(
    string filename,
    bool deflate
);

See also ...

SharpPlot Members | SavePdf Method


SharpPlot 2.51 User Manual: SavePdf Method (String,PdfMode,Boolean)

SharpPlot.SavePdf Method (String,PdfMode,Boolean)

PDF optionally compressed and will open in chosen mode with all fonts embedded.

public void SavePdf(
    string filename,
    PdfMode mode,
    bool deflate
);

See also ...

SharpPlot Members | SavePdf Method


SharpPlot 2.51 User Manual: SavePS Method

SharpPlot.SavePS Method

The chart is saved to a text file in raw PostScript format. This can be directed to a PostScript printer or to Acrobat Distiller as required. You should set the MediaBox flag if you intend to use Distiller, as this tells SharpPlot to include the paper-size information in the PostScript file.

Example

sp.SavePS("chart.ps",false,true);

Overloads

  • public void SavePS(string filename);
  • public void SavePS(string filename,bool forceMonochrome);
  • public void SavePS(string filename,bool forceMonochrome,bool mediaBox);
  • public void SavePS(string filename,bool forceMonochrome,bool mediaBox,string prologue);

See also ...

SharpPlot Members | RenderPS Method


SharpPlot 2.51 User Manual: SavePS Method (String,Boolean,Boolean,String)

SharpPlot.SavePS Method (String,Boolean,Boolean,String)

Save completed chart to file as raw PostScript with monochrome and mediabox flags and extra PS prologue.

public void SavePS(
    string filename,
    bool forceMonochrome,
    bool mediaBox,
    string prologue
);

See also ...

SharpPlot Members | SavePS Method


SharpPlot 2.51 User Manual: SavePS Method (String)

SharpPlot.SavePS Method (String)

Save completed chart as raw PostScript.

public void SavePS(
    string filename
);

See also ...

SharpPlot Members | SavePS Method


SharpPlot 2.51 User Manual: SavePS Method (String,Boolean)

SharpPlot.SavePS Method (String,Boolean)

Save completed chart as raw PostScript with monochrome flag.

public void SavePS(
    string filename,
    bool forceMonochrome
);

See also ...

SharpPlot Members | SavePS Method


SharpPlot 2.51 User Manual: SavePS Method (String,Boolean,Boolean)

SharpPlot.SavePS Method (String,Boolean,Boolean)

Save completed chart as raw PostScript with monochrome and mediabox flags.

public void SavePS(
    string filename,
    bool forceMonochrome,
    bool mediaBox
);

See also ...

SharpPlot Members | SavePS Method


SharpPlot 2.51 User Manual: SaveSvg Method

SharpPlot.SaveSvg Method

This saves your chart as a Scalable Vector Graphic. The mode option allows some control over the way the chart is scaled by the Adobe SVG viewer when it is embedded in a webpage. The header text may be used to add extra attributes into the svg tag which starts the XML document.

Example

sp.SaveSvg("chart.svg",SvgMode.FixedAspect);

Overloads

  • public void SaveSvg(string filename);
  • public void SaveSvg(string filename,SvgMode mode);
  • public void SaveSvg(string filename,SvgMode mode,string headerText);

See RenderSvg for more information on the support for this format in various browsers.

See also ...

SharpPlot Members | RenderSvg Method


SharpPlot 2.51 User Manual: SaveSvg Method (String,SvgMode,String)

SharpPlot.SaveSvg Method (String,SvgMode,String)

Save chart as an SVG file with aspect ratio setting and extra header text.

public void SaveSvg(
    string filename,
    SvgMode mode,
    string headerText
);

See also ...

SharpPlot Members | SaveSvg Method


SharpPlot 2.51 User Manual: SaveSvg Method (String)

SharpPlot.SaveSvg Method (String)

Save chart as SVG with fixed size.

public void SaveSvg(
    string filename
);

See also ...

SharpPlot Members | SaveSvg Method


SharpPlot 2.51 User Manual: SaveSvg Method (String,SvgMode)

SharpPlot.SaveSvg Method (String,SvgMode)

Save chart as SVG with given aspect ratio setting.

public void SaveSvg(
    string filename,
    SvgMode mode
);

See also ...

SharpPlot Members | SaveSvg Method


SharpPlot 2.51 User Manual: SaveVml Method

SharpPlot.SaveVml Method

This saves a complete webpage in HTML format, including your chart rendered as VML.

VML is not supported by Microsoft and should not be used, unless for backwards compatibility reasons.

Example

sp.SaveVml("webpage.htm",false);

Overloads

  • public void SaveVml(string filename);
  • public void SaveVml(string filename,bool showpaper);
  • public void SaveVml(string filename,bool showPaper,double dpi);

See RenderVml for more information on the suitability of this format.

See also ...

SharpPlot Members | RenderVml Method


SharpPlot 2.51 User Manual: SaveVml Method (String,Boolean,Double)

SharpPlot.SaveVml Method (String,Boolean,Double)

Save completed chart to webpage, rendered as VML with optional paper outline and pixel conversion.

public void SaveVml(
    string filename,
    bool showPaper,
    double dpi
);
filename
[todo]
showPaper
[todo]
dpi
[todo]

See also ...

SharpPlot Members | SaveVml Method


SharpPlot 2.51 User Manual: SaveVml Method (String)

SharpPlot.SaveVml Method (String)

Save chart as a string of HTML code without drawing paper as pts.

public void SaveVml(
    string filename
);
filename
[todo]

See also ...

SharpPlot Members | SaveVml Method


SharpPlot 2.51 User Manual: SaveVml Method (String,Boolean)

SharpPlot.SaveVml Method (String,Boolean)

Save chart as a string of HTML code with optional paper and pts.

public void SaveVml(
    string filename,
    bool showpaper
);
filename
[todo]
showpaper
[todo]

See also ...

SharpPlot Members | SaveVml Method


SharpPlot 2.51 User Manual: SaveXaml Method

SharpPlot.SaveXaml Method

This method saves the chart expressed as a XAML Canvas, with optional scaling. The default scale converts points to pixels at 96/72 and will produce the same size image as the chart rendered to SVG. The chart can be viewed on the web in most common browsers with the SilverLight plugin.

If the extension is ‘.xaml’ the canvas is saved exactly as rendered. If it is ‘.htm’ or ‘.html’ the xaml block is wrapped in script tags and included in a stand-alone webpage which will load directly into the browser. This is very convenient for initial testing, but you will probably want to make your own wrapper page for production use.

Example

sp.SaveXaml(path + "foo.html",2);  // Save as script with htm wrapper
sp.SaveXaml(path + "foo.xaml");    // Save as bare Canvas for inclusion

Overloads

  • public void SaveXaml(string filename);
  • public void SaveXaml(string filename,double scale);
  • public void SaveXaml(string filename,double scale,string headerText);

Description

To make use of this format on the internet, you will need the SilverLight plugin from Microsoft, and an appropriate ‘wrapper’ HTML page to load the plugin and render the XAML content.

Your page should reference the silverlight.js file supplied with the plugin, and also the silverplot.js file supplied with SharpPlot which adds support for hints, tips and hyperlinks to your charts. Use the wrapper page as a guide for the correct formatting.

See also ...

SharpPlot Members | RenderXaml Method


SharpPlot 2.51 User Manual: SaveXaml Method (String,Double,String)

SharpPlot.SaveXaml Method (String,Double,String)

Save chart as a XAML/HTML file with scaling and extra header text.

public void SaveXaml(
    string filename,
    double scale,
    string headerText
);

Parameters

filename
Target file (extension may be .xaml or .html).
scale
Scaling to pixels (default 1.33).
headerText
Extra attributes to populate Canvas tag.

See also ...

SharpPlot Members | SaveXaml Method


SharpPlot 2.51 User Manual: SaveXaml Method (String)

SharpPlot.SaveXaml Method (String)

Save chart as XAML with default scale.

public void SaveXaml(
    string filename
);

Parameters

filename
Target file (extension may be .xaml or .html).

See also ...

SharpPlot Members | SaveXaml Method


SharpPlot 2.51 User Manual: SaveXaml Method (String,Double)

SharpPlot.SaveXaml Method (String,Double)

Save chart as XAML with given scaling.

public void SaveXaml(
    string filename,
    double scale
);

Parameters

filename
Target file (extension may be .xaml or .html).
scale
Scaling to pixels (default 1.33).

See also ...

SharpPlot Members | SaveXaml Method


SharpPlot 2.51 User Manual: SetAltitudeColors Method

SharpPlot.SetAltitudeColors Method

Set an array of colors for use by altitude-shaded plots. If a single color is used, it will be smoothly graded to white. An array of colors will be used as step values, and an equal number of interpolated colors created between each pair.

Example

sp.SetAltitudeColors(Color.DarkKhaki); // Good for a landscape map
sp.SetAltitudeColors(new Color[]{Color.Navy,Color.Green,Color.Red,Color.Yellow}); // Typical false-color set

Overloads

  • public void SetAltitudeColors(Color value);
  • public void SetAltitudeColors(string value);
  • public void SetAltitudeColors(Color[] colors);

Altitude shading is supported by the contour plot, and the cloud chart with a fitted response surface. You can also have altitude-shaded markers as a BubbleChart style.


SharpPlot 2.51 User Manual: SetAltitudeColors Method (Color[])

SharpPlot.SetAltitudeColors Method (Color[])

Set an array of colors to be used in Altitude Colors.

public void SetAltitudeColors(
    Color[] colors
);

See also ...

SharpPlot Members | SetAltitudeColors Method


SharpPlot 2.51 User Manual: SetAltitudeColors Method (Color)

SharpPlot.SetAltitudeColors Method (Color)

Single altitude color grades to white.

public void SetAltitudeColors(
    Color value
);

See also ...

SharpPlot Members | SetAltitudeColors Method


SharpPlot 2.51 User Manual: SetAltitudeColors Method (String)

SharpPlot.SetAltitudeColors Method (String)

Interpret a list of color names as a color array.

public void SetAltitudeColors(
    string value
);

See also ...

SharpPlot Members | SetAltitudeColors Method


SharpPlot 2.51 User Manual: SetArrowStyle Method

SharpPlot.SetArrowStyle Method

Set Arrow format given any of (Arrow size, sweep angle, fill pattern).

Example

sp.SetArrowStyle(12,30); // Size,angle
sp.SetArrowStyle(6,120); // Inward arrow
sp.SetArrowStyle(12,30,FillStyle.Unfilled); // Size,angle,hollow

Overloads

  • public void SetArrowStyle(double arrowSize);
  • public void SetArrowStyle(double arrowSize,double arrowAngle);
  • public void SetArrowStyle(double arrowSize,double arrowAngle,FillStyle fillStyle);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetArrowStyle Method (Double,Double,FillStyle)

SharpPlot.SetArrowStyle Method (Double,Double,FillStyle)

Set Arrow format (Arrow size, sweep angle, fill pattern).

public void SetArrowStyle(
    double arrowSize,
    double arrowAngle,
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetArrowStyle Method


SharpPlot 2.51 User Manual: SetArrowStyle Method (Double,Double)

SharpPlot.SetArrowStyle Method (Double,Double)

Arrow size and sweep angle.

public void SetArrowStyle(
    double arrowSize,
    double arrowAngle
);

See also ...

SharpPlot Members | SetArrowStyle Method


SharpPlot 2.51 User Manual: SetArrowStyle Method (Double)

SharpPlot.SetArrowStyle Method (Double)

Arrowhead length in pts (default = 10pt).

public void SetArrowStyle(
    double arrowSize
);

See also ...

SharpPlot Members | SetArrowStyle Method


SharpPlot 2.51 User Manual: SetAxisStyle Method

SharpPlot.SetAxisStyle Method

Set Axis format given any of color, lineStyle and lineweight (pts).

Example

sp.SetAxisStyle(Color.White,LineStyle.Solid,1.2);
sp.SetAxisStyle(Color.Navy);
sp.SetAxisStyle(4); // Heavy lines

Overloads

  • public void SetAxisStyle(Color lineColor);
  • public void SetAxisStyle(double lineWidth);
  • public void SetAxisStyle(LineStyle lineStyle);
  • public void SetAxisStyle(Color lineColor,LineStyle lineStyle);
  • public void SetAxisStyle(Color lineColor,LineStyle lineStyle,double lineWidth);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetAxisStyle Method (Color,LineStyle,Double)

SharpPlot.SetAxisStyle Method (Color,LineStyle,Double)

Set Axis format given color, lineStyle and lineweight.

public void SetAxisStyle(
    Color lineColor,
    LineStyle lineStyle,
    double lineWidth
);

See also ...

SharpPlot Members | SetAxisStyle Method


SharpPlot 2.51 User Manual: SetAxisStyle Method (Color,LineStyle)

SharpPlot.SetAxisStyle Method (Color,LineStyle)

Set Axis format color and lineStyle.

public void SetAxisStyle(
    Color lineColor,
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetAxisStyle Method


SharpPlot 2.51 User Manual: SetAxisStyle Method (Color)

SharpPlot.SetAxisStyle Method (Color)

Set Axis format color only.

public void SetAxisStyle(
    Color lineColor
);

See also ...

SharpPlot Members | SetAxisStyle Method


SharpPlot 2.51 User Manual: SetAxisStyle Method (LineStyle)

SharpPlot.SetAxisStyle Method (LineStyle)

Set Axis format line-style only.

public void SetAxisStyle(
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetAxisStyle Method


SharpPlot 2.51 User Manual: SetAxisStyle Method (Double)

SharpPlot.SetAxisStyle Method (Double)

Set Axis format line-weight (pts) only.

public void SetAxisStyle(
    double lineWidth
);

See also ...

SharpPlot Members | SetAxisStyle Method


SharpPlot 2.51 User Manual: SetBackground Method

SharpPlot.SetBackground Method

Set Paper color and shading style from any of fill-color, fill-style, edge-width (pts).

Example

sp.SetBackground(Color.Bisque,FillStyle.GradientBottomRight);

Overloads

  • public void SetBackground(Color fillColor);
  • public void SetBackground(double edgeWidth);
  • public void SetBackground(FillStyle fillStyle);
  • public void SetBackground(Color fillColor,FillStyle fillStyle);
  • public void SetBackground(Color fillColor,FillStyle fillStyle,double edgeWidth);

See also ...

SharpPlot Members | FillStyle Struct


SharpPlot 2.51 User Manual: SetBackground Method (Color,FillStyle,Double)

SharpPlot.SetBackground Method (Color,FillStyle,Double)

Set Paper shading (fill-color, fill-style, edge-width).

public void SetBackground(
    Color fillColor,
    FillStyle fillStyle,
    double edgeWidth
);

See also ...

SharpPlot Members | SetBackground Method


SharpPlot 2.51 User Manual: SetBackground Method (Color,FillStyle)

SharpPlot.SetBackground Method (Color,FillStyle)

Set Paper fill-color and shading.

public void SetBackground(
    Color fillColor,
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetBackground Method


SharpPlot 2.51 User Manual: SetBackground Method (Color)

SharpPlot.SetBackground Method (Color)

Set Paper fill-color only.

public void SetBackground(
    Color fillColor
);

See also ...

SharpPlot Members | SetBackground Method


SharpPlot 2.51 User Manual: SetBackground Method (FillStyle)

SharpPlot.SetBackground Method (FillStyle)

Set Paper shading only.

public void SetBackground(
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetBackground Method


SharpPlot 2.51 User Manual: SetBackground Method (Double)

SharpPlot.SetBackground Method (Double)

Set Paper edge-width (pts) only.

public void SetBackground(
    double edgeWidth
);

See also ...

SharpPlot Members | SetBackground Method


SharpPlot 2.51 User Manual: SetBarWidths Method

SharpPlot.SetBarWidths Method

Set Bar widths for XBarchart and Gantt chart.

Example

sp.SetBarWidths(new int[] {7,7,4,5});

Overloads

  • public void SetBarWidths(double value);
  • public void SetBarWidths(int[] value);
  • public void SetBarWidths(double[] value);

The widths are given in axis units.

See also ...

SharpPlot Members | DrawXBarChart Method


SharpPlot 2.51 User Manual: SetBarWidths Method (Double[])

SharpPlot.SetBarWidths Method (Double[])

Set Bar widths given a double vector.

public void SetBarWidths(
    double[] value
);

See also ...

SharpPlot Members | SetBarWidths Method


SharpPlot 2.51 User Manual: SetBarWidths Method (Double)

SharpPlot.SetBarWidths Method (Double)

Set Bar widths to a single value.

public void SetBarWidths(
    double value
);

See also ...

SharpPlot Members | SetBarWidths Method


SharpPlot 2.51 User Manual: SetBarWidths Method (Int32[])

SharpPlot.SetBarWidths Method (Int32[])

Set Bar widths to a integer array.

public void SetBarWidths(
    int[] value
);

See also ...

SharpPlot Members | SetBarWidths Method


SharpPlot 2.51 User Manual: SetBaselineStyle Method

SharpPlot.SetBaselineStyle Method

Set Baseline format given any of color, lineStyle and lineweight (pts). this has the same default appearance as the chart axes, but any element of the style may be reset.

Example

sp.SetBaselineStyle(Color.Navy,LineStyle.Solid,1.2);
sp.SetBaselineStyle(LineStyle.Invisible);

Overloads

  • public void SetBaselineStyle(Color lineColor);
  • public void SetBaselineStyle(double lineWidth);
  • public void SetBaselineStyle(LineStyle lineStyle);
  • public void SetBaselineStyle(Color lineColor,LineStyle lineStyle);
  • public void SetBaselineStyle(Color lineColor,LineStyle lineStyle,double lineWidth);

A common use of this function would be to select the Invisible LineStyle to have the line eliminated from the chart.

See also ...

Baseline Property


SharpPlot 2.51 User Manual: SetBaselineStyle Method (Color,LineStyle,Double)

SharpPlot.SetBaselineStyle Method (Color,LineStyle,Double)

Set Baseline format given color, lineStyle and lineweight.

public void SetBaselineStyle(
    Color lineColor,
    LineStyle lineStyle,
    double lineWidth
);
lineColor
[todo]
lineStyle
Dash pattern (builtin or custom).
lineWidth
Width of line in points.

See also ...

SharpPlot Members | SetBaselineStyle Method


SharpPlot 2.51 User Manual: SetBaselineStyle Method (Color,LineStyle)

SharpPlot.SetBaselineStyle Method (Color,LineStyle)

Set Baseline format color and lineStyle.

public void SetBaselineStyle(
    Color lineColor,
    LineStyle lineStyle
);
lineColor
[todo]
lineStyle
Dash pattern (builtin or custom).

See also ...

SharpPlot Members | SetBaselineStyle Method


SharpPlot 2.51 User Manual: SetBaselineStyle Method (Color)

SharpPlot.SetBaselineStyle Method (Color)

Set Baseline format color only.

public void SetBaselineStyle(
    Color lineColor
);
lineColor
[todo]

See also ...

SharpPlot Members | SetBaselineStyle Method


SharpPlot 2.51 User Manual: SetBaselineStyle Method (LineStyle)

SharpPlot.SetBaselineStyle Method (LineStyle)

Set Baseline format line-style only.

public void SetBaselineStyle(
    LineStyle lineStyle
);
lineStyle
Dash pattern (builtin or custom).

See also ...

SharpPlot Members | SetBaselineStyle Method


SharpPlot 2.51 User Manual: SetBaselineStyle Method (Double)

SharpPlot.SetBaselineStyle Method (Double)

Set Baseline format line-weight (pts) only.

public void SetBaselineStyle(
    double lineWidth
);
lineWidth
Width of line in points.

See also ...

SharpPlot Members | SetBaselineStyle Method


SharpPlot 2.51 User Manual: SetCaptionFont Method

SharpPlot.SetCaptionFont Method

Set Caption font given any of fontname, point-size, style, color.

Example

sp.SetCaptionFont("Tahoma,Arial,Sans",12);
sp.SetCaptionFont("Times",12,Color.Navy);

Overloads

  • public void SetCaptionFont(string fontName);
  • public void SetCaptionFont(double fontSize);
  • public void SetCaptionFont(Color fontColor);
  • public void SetCaptionFont(FontStyle fontStyle);
  • public void SetCaptionFont(string fontName,double fontSize);
  • public void SetCaptionFont(string fontName,Color fontColor);
  • public void SetCaptionFont(double fontSize,Color fontColor);
  • public void SetCaptionFont(string fontName,FontStyle fontStyle);
  • public void SetCaptionFont(FontStyle fontStyle,Color fontColor);
  • public void SetCaptionFont(string fontName,double fontSize,Color fontColor);
  • public void SetCaptionFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetCaptionFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetCaptionFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

This method sets all three captions in a single call.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetCaptionFont Method (String,Double,FontStyle,Color)

SharpPlot.SetCaptionFont Method (String,Double,FontStyle,Color)

Set Caption font from fontname, point-size, style and color.

public void SetCaptionFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (Double,Color)

SharpPlot.SetCaptionFont Method (Double,Color)

Set Caption font point-size and color.

public void SetCaptionFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (String,Double,Color)

SharpPlot.SetCaptionFont Method (String,Double,Color)

Set Caption font name, point-size and color.

public void SetCaptionFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (String,FontStyle,Color)

SharpPlot.SetCaptionFont Method (String,FontStyle,Color)

Set Caption font name, style and color.

public void SetCaptionFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (String,Double,FontStyle)

SharpPlot.SetCaptionFont Method (String,Double,FontStyle)

Set Caption font name, point-size and style.

public void SetCaptionFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (String)

SharpPlot.SetCaptionFont Method (String)

Set Caption font fontname only.

public void SetCaptionFont(
    string fontName
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (Double)

SharpPlot.SetCaptionFont Method (Double)

Set Caption font point-size only.

public void SetCaptionFont(
    double fontSize
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (Color)

SharpPlot.SetCaptionFont Method (Color)

Set Caption font Color only.

public void SetCaptionFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (FontStyle)

SharpPlot.SetCaptionFont Method (FontStyle)

Set Caption font style only.

public void SetCaptionFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (String,Double)

SharpPlot.SetCaptionFont Method (String,Double)

Set Caption font name and point-size.

public void SetCaptionFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (String,FontStyle)

SharpPlot.SetCaptionFont Method (String,FontStyle)

Set Caption font name and style.

public void SetCaptionFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (String,Color)

SharpPlot.SetCaptionFont Method (String,Color)

Set Caption font name and color.

public void SetCaptionFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCaptionFont Method (FontStyle,Color)

SharpPlot.SetCaptionFont Method (FontStyle,Color)

Set Caption font style and color.

public void SetCaptionFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetCaptionFont Method


SharpPlot 2.51 User Manual: SetCellSize Method

SharpPlot.SetCellSize Method

Set Cellsize (width,height) from width and height.

public void SetCellSize(
    double width,
    double height
);

Example

sp.SetCellSize(100,60);

This call is used to allow an initial scatterplot to create a series of frames to hold a set of miniature charts, each drawn at a particular x,y location. The default is 72,72 points.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetChartBackground Method

SharpPlot.SetChartBackground Method

Set Chart background shading style from any of fill-color, fill-style, edge-width (pts).

Example

sp.SetChartBackground(Color.Navy,FillStyle.Opacity42);

Overloads

  • public void SetChartBackground(Color fillColor);
  • public void SetChartBackground(double edgeWidth);
  • public void SetChartBackground(FillStyle fillStyle);
  • public void SetChartBackground(Color fillColor,FillStyle fillStyle);
  • public void SetChartBackground(Color fillColor,FillStyle fillStyle,double edgeWidth);

This paints the region bounded by the chart axes.

See also ...

SharpPlot Members | FillStyle Struct


SharpPlot 2.51 User Manual: SetChartBackground Method (Color,FillStyle,Double)

SharpPlot.SetChartBackground Method (Color,FillStyle,Double)

Set Chart background shading (fill-color, fill-style, edge-width).

public void SetChartBackground(
    Color fillColor,
    FillStyle fillStyle,
    double edgeWidth
);

See also ...

SharpPlot Members | SetChartBackground Method


SharpPlot 2.51 User Manual: SetChartBackground Method (Color,FillStyle)

SharpPlot.SetChartBackground Method (Color,FillStyle)

Set Chart background fill-color and shading.

public void SetChartBackground(
    Color fillColor,
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetChartBackground Method


SharpPlot 2.51 User Manual: SetChartBackground Method (Color)

SharpPlot.SetChartBackground Method (Color)

Set Chart background fill-color only.

public void SetChartBackground(
    Color fillColor
);

See also ...

SharpPlot Members | SetChartBackground Method


SharpPlot 2.51 User Manual: SetChartBackground Method (FillStyle)

SharpPlot.SetChartBackground Method (FillStyle)

Set Chart background shading only.

public void SetChartBackground(
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetChartBackground Method


SharpPlot 2.51 User Manual: SetChartBackground Method (Double)

SharpPlot.SetChartBackground Method (Double)

Set Chart background edge-width (pts) only.

public void SetChartBackground(
    double edgeWidth
);

See also ...

SharpPlot Members | SetChartBackground Method


SharpPlot 2.51 User Manual: SetChartName Method

SharpPlot.SetChartName Method

Assign a non-default name to the current chart.

public void SetChartName(
    string newName
);

Example

sp.SetChartName("Summary");

Description

Assigning the chart a recognisable name has a number of effects, depending on the output medium. In web formats it causes all significant chart elements (data series, or any ScriptTarget item such as the main heading) to be given an id in the html tag. This allows you to write JavaScript code to (for example) have each data series drawn in a bold line when the mouse is over the matching legend entry.

It will also add an anchor tag to the chart in VML output.

If your application is tracking hotspots using the Active Charts components, it will be very helpful for debugging to have console output report nicely named charts and series.

See also ...

SharpPlot Members | SetSeriesNames Method | HotspotInfo Struct | PageMap Class – Introduction


SharpPlot 2.51 User Manual: SetColors Method

SharpPlot.SetColors Method

Set an array of colors for use by upcoming data series. The array is reused cyclically by all the series which follow.

Example

sp.SetColors(new Color[]{Color.Navy,Color.Maroon});

Overloads

  • public void SetColors(Color value);
  • public void SetColors(string value);
  • public void SetColors(Color[] colors);

A single color will ensure all series are colored identically until this is set again.

Note that ‘extra’ lines such as fitted curves use the color cycle also – this allows you to set chosen colors for all the significant elements in the chart.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetColors Method (Color[])

SharpPlot.SetColors Method (Color[])

Set an array of colors to be used by upcoming series.

public void SetColors(
    Color[] colors
);

See also ...

SharpPlot Members | SetColors Method


SharpPlot 2.51 User Manual: SetColors Method (Color)

SharpPlot.SetColors Method (Color)

All upcoming series get this color.

public void SetColors(
    Color value
);

See also ...

SharpPlot Members | SetColors Method


SharpPlot 2.51 User Manual: SetContourStyle Method

SharpPlot.SetContourStyle Method

Set Contour format given any of color, lineStyle and lineweight (pts).

Example

sp.SetContourStyle(Color.Red,LineStyle.Dash,1.2);

Overloads

  • public void SetContourStyle(Color lineColor);
  • public void SetContourStyle(double lineWidth);
  • public void SetContourStyle(LineStyle lineStyle);
  • public void SetContourStyle(Color lineColor,LineStyle lineStyle);
  • public void SetContourStyle(Color lineColor,LineStyle lineStyle,double lineWidth);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetContourStyle Method (Color,LineStyle,Double)

SharpPlot.SetContourStyle Method (Color,LineStyle,Double)

Set Contour format given color, lineStyle and lineweight.

public void SetContourStyle(
    Color lineColor,
    LineStyle lineStyle,
    double lineWidth
);

See also ...

SharpPlot Members | SetContourStyle Method


SharpPlot 2.51 User Manual: SetContourStyle Method (Color,LineStyle)

SharpPlot.SetContourStyle Method (Color,LineStyle)

Set Contour format color and lineStyle.

public void SetContourStyle(
    Color lineColor,
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetContourStyle Method


SharpPlot 2.51 User Manual: SetContourStyle Method (Color)

SharpPlot.SetContourStyle Method (Color)

Set Contour format color only.

public void SetContourStyle(
    Color lineColor
);

See also ...

SharpPlot Members | SetContourStyle Method


SharpPlot 2.51 User Manual: SetContourStyle Method (LineStyle)

SharpPlot.SetContourStyle Method (LineStyle)

Set Contour format line-style only.

public void SetContourStyle(
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetContourStyle Method


SharpPlot 2.51 User Manual: SetContourStyle Method (Double)

SharpPlot.SetContourStyle Method (Double)

Set Contour format line-weight (pts) only.

public void SetContourStyle(
    double lineWidth
);

See also ...

SharpPlot Members | SetContourStyle Method


SharpPlot 2.51 User Manual: SetContourTagFont Method

SharpPlot.SetContourTagFont Method

Set the font used to write contour-line tags given any of fontname, point-size, style, color.

Example

sp.SetContourTagFont("Arial",9); // Default color, but a little larger
sp.SetContourTagFont("Arial",6,FontStyle.Bold,Color.White); // Small and bold for altitude-shaded charts

Overloads

  • public void SetContourTagFont(string fontName);
  • public void SetContourTagFont(double fontSize);
  • public void SetContourTagFont(Color fontColor);
  • public void SetContourTagFont(FontStyle fontStyle);
  • public void SetContourTagFont(string fontName,double fontSize);
  • public void SetContourTagFont(string fontName,Color fontColor);
  • public void SetContourTagFont(double fontSize,Color fontColor);
  • public void SetContourTagFont(string fontName,FontStyle fontStyle);
  • public void SetContourTagFont(FontStyle fontStyle,Color fontColor);
  • public void SetContourTagFont(string fontName,double fontSize,Color fontColor);
  • public void SetContourTagFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetContourTagFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetContourTagFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);


SharpPlot 2.51 User Manual: SetContourTagFont Method (String,Double,FontStyle,Color)

SharpPlot.SetContourTagFont Method (String,Double,FontStyle,Color)

Set ContourTag font from fontname, point-size, style and color.

public void SetContourTagFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (Double,Color)

SharpPlot.SetContourTagFont Method (Double,Color)

Set ContourTag font point-size and color.

public void SetContourTagFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (String,Double,Color)

SharpPlot.SetContourTagFont Method (String,Double,Color)

Set ContourTag font name, point-size and color.

public void SetContourTagFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (String,FontStyle,Color)

SharpPlot.SetContourTagFont Method (String,FontStyle,Color)

Set ContourTag font name, style and color.

public void SetContourTagFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (String,Double,FontStyle)

SharpPlot.SetContourTagFont Method (String,Double,FontStyle)

Set ContourTag font name, point-size and style.

public void SetContourTagFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (String)

SharpPlot.SetContourTagFont Method (String)

Set ContourTag font fontname only.

public void SetContourTagFont(
    string fontName
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (Double)

SharpPlot.SetContourTagFont Method (Double)

Set ContourTag font point-size only.

public void SetContourTagFont(
    double fontSize
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (Color)

SharpPlot.SetContourTagFont Method (Color)

Set ContourTag font Color only.

public void SetContourTagFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (FontStyle)

SharpPlot.SetContourTagFont Method (FontStyle)

Set ContourTag font style only.

public void SetContourTagFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (String,Double)

SharpPlot.SetContourTagFont Method (String,Double)

Set ContourTag font name and point-size.

public void SetContourTagFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (String,FontStyle)

SharpPlot.SetContourTagFont Method (String,FontStyle)

Set ContourTag font name and style.

public void SetContourTagFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (String,Color)

SharpPlot.SetContourTagFont Method (String,Color)

Set ContourTag font name and color.

public void SetContourTagFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetContourTagFont Method (FontStyle,Color)

SharpPlot.SetContourTagFont Method (FontStyle,Color)

Set ContourTag font style and color.

public void SetContourTagFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetContourTagFont Method


SharpPlot 2.51 User Manual: SetDataWindow Method

SharpPlot.SetDataWindow Method

Window for data from an array of integers.

Example

sp.SetDataWindow(new int[]{20,60});

Overloads

  • public void SetDataWindow(int value);
  • public void SetDataWindow(int[] value);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetDataWindow Method (Int32[])

SharpPlot.SetDataWindow Method (Int32[])

Window for data.

public void SetDataWindow(
    int[] value
);

See also ...

SharpPlot Members | SetDataWindow Method


SharpPlot 2.51 User Manual: SetDataWindow Method (Int32)

SharpPlot.SetDataWindow Method (Int32)

Set Window for data from a single value.

public void SetDataWindow(
    int value
);

See also ...

SharpPlot Members | SetDataWindow Method


SharpPlot 2.51 User Manual: SetDatumLineStyle Method

SharpPlot.SetDatumLineStyle Method

Set DatumLine style given any of color, lineStyle and lineweight (pts).

Example

sp.SetDatumLineStyle(Color.Maroon,new LineStyle(new int[] {12,4,24,4})); // Long dashes

Overloads

  • public void SetDatumLineStyle(Color lineColor);
  • public void SetDatumLineStyle(double lineWidth);
  • public void SetDatumLineStyle(LineStyle lineStyle);
  • public void SetDatumLineStyle(Color lineColor,LineStyle lineStyle);
  • public void SetDatumLineStyle(Color lineColor,LineStyle lineStyle,double lineWidth);

Datum lines are drawn as specified by the user, or automatically at major tickmarks which exceed the Datumline threshold (default 160% of standard tick length).

See also ...

SharpPlot Members | LineStyle Struct


SharpPlot 2.51 User Manual: SetDatumLineStyle Method (Color,LineStyle,Double)

SharpPlot.SetDatumLineStyle Method (Color,LineStyle,Double)

Set DatumLine style given color, lineStyle and lineweight.

public void SetDatumLineStyle(
    Color lineColor,
    LineStyle lineStyle,
    double lineWidth
);

See also ...

SharpPlot Members | SetDatumLineStyle Method


SharpPlot 2.51 User Manual: SetDatumLineStyle Method (Color,LineStyle)

SharpPlot.SetDatumLineStyle Method (Color,LineStyle)

Set DatumLine style color and lineStyle.

public void SetDatumLineStyle(
    Color lineColor,
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetDatumLineStyle Method


SharpPlot 2.51 User Manual: SetDatumLineStyle Method (Color)

SharpPlot.SetDatumLineStyle Method (Color)

Set DatumLine style color only.

public void SetDatumLineStyle(
    Color lineColor
);

See also ...

SharpPlot Members | SetDatumLineStyle Method


SharpPlot 2.51 User Manual: SetDatumLineStyle Method (LineStyle)

SharpPlot.SetDatumLineStyle Method (LineStyle)

Set DatumLine style line-style only.

public void SetDatumLineStyle(
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetDatumLineStyle Method


SharpPlot 2.51 User Manual: SetDatumLineStyle Method (Double)

SharpPlot.SetDatumLineStyle Method (Double)

Set DatumLine style line-weight (pts) only.

public void SetDatumLineStyle(
    double lineWidth
);

See also ...

SharpPlot Members | SetDatumLineStyle Method


SharpPlot 2.51 User Manual: SetDatumLineTags Method

SharpPlot.SetDatumLineTags Method

Set tags to be written above each datum line given a string array or a simple string.

Example

sp.SetYDatumLines(new int[] {25,50});   // Acceptable range
sp.SetDatumTags(new string[]{"Lower limit","Upper limit"});  // Matching labels

Overloads

  • public void SetDatumLineTags(string label);
  • public void SetDatumLineTags(int[] values);
  • public void SetDatumLineTags(string[] labels);
  • public void SetDatumLineTags(double[] values);
  • public void SetDatumLineTags(string[][] labels);

Notes

The tags are written above (or vertically to the left) of Y and X datum lines at the end of the line opposite to the axis, so by default you will see YDatum lines at the right-hand side of the chart, written just above each line.

Tags are taken in X,Y,Z order if you need to label tags on more than one axis in the same chart.

For contour plots, the tags are written on the lines in the same style as the contour labels.


SharpPlot 2.51 User Manual: SetDatumLineTags Method (String[])

SharpPlot.SetDatumLineTags Method (String[])

Set Datumline tags from an array of strings.

public void SetDatumLineTags(
    string[] labels
);

See also ...

SharpPlot Members | SetDatumLineTags Method


SharpPlot 2.51 User Manual: SetDatumLineTags Method (String)

SharpPlot.SetDatumLineTags Method (String)

Set Datumline tags with a comma-separated string.

public void SetDatumLineTags(
    string label
);

See also ...

SharpPlot Members | SetDatumLineTags Method


SharpPlot 2.51 User Manual: SetDatumLineTags Method (String[][])

SharpPlot.SetDatumLineTags Method (String[][])

Set multiple rows of labels.

public void SetDatumLineTags(
    string[][] labels
);

See also ...

SharpPlot Members | SetDatumLineTags Method


SharpPlot 2.51 User Manual: SetDatumLineTags Method (Int32[])

SharpPlot.SetDatumLineTags Method (Int32[])

Format Datumline tags from an integer array with current formatter.

public void SetDatumLineTags(
    int[] values
);

See also ...

SharpPlot Members | SetDatumLineTags Method


SharpPlot 2.51 User Manual: SetDatumLineTags Method (Double[])

SharpPlot.SetDatumLineTags Method (Double[])

Format Datumline tags from a numeric array with current formatter.

public void SetDatumLineTags(
    double[] values
);

See also ...

SharpPlot Members | SetDatumLineTags Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method

SharpPlot.SetDatumTagFont Method

Set the font used to write datum-line tags given any of fontname, point-size, style, color.

Example

sp.SetDatumTagFont("Arial",10);   // Default color, but a little larger
sp.SetDatumTagFont("Arial",6,FontStyle.Bold); // Small and bold

Overloads

  • public void SetDatumTagFont(string fontName);
  • public void SetDatumTagFont(double fontSize);
  • public void SetDatumTagFont(Color fontColor);
  • public void SetDatumTagFont(FontStyle fontStyle);
  • public void SetDatumTagFont(string fontName,double fontSize);
  • public void SetDatumTagFont(string fontName,Color fontColor);
  • public void SetDatumTagFont(double fontSize,Color fontColor);
  • public void SetDatumTagFont(string fontName,FontStyle fontStyle);
  • public void SetDatumTagFont(FontStyle fontStyle,Color fontColor);
  • public void SetDatumTagFont(string fontName,double fontSize,Color fontColor);
  • public void SetDatumTagFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetDatumTagFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetDatumTagFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);


SharpPlot 2.51 User Manual: SetDatumTagFont Method (String,Double,FontStyle,Color)

SharpPlot.SetDatumTagFont Method (String,Double,FontStyle,Color)

Set DatumTag font from fontname, point-size, style and color.

public void SetDatumTagFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (Double,Color)

SharpPlot.SetDatumTagFont Method (Double,Color)

Set DatumTag font point-size and color.

public void SetDatumTagFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (String,Double,Color)

SharpPlot.SetDatumTagFont Method (String,Double,Color)

Set DatumTag font name, point-size and color.

public void SetDatumTagFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (String,FontStyle,Color)

SharpPlot.SetDatumTagFont Method (String,FontStyle,Color)

Set DatumTag font name, style and color.

public void SetDatumTagFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (String,Double,FontStyle)

SharpPlot.SetDatumTagFont Method (String,Double,FontStyle)

Set DatumTag font name, point-size and style.

public void SetDatumTagFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (String)

SharpPlot.SetDatumTagFont Method (String)

Set DatumTag font fontname only.

public void SetDatumTagFont(
    string fontName
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (Double)

SharpPlot.SetDatumTagFont Method (Double)

Set DatumTag font point-size only.

public void SetDatumTagFont(
    double fontSize
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (Color)

SharpPlot.SetDatumTagFont Method (Color)

Set DatumTag font Color only.

public void SetDatumTagFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (FontStyle)

SharpPlot.SetDatumTagFont Method (FontStyle)

Set DatumTag font style only.

public void SetDatumTagFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (String,Double)

SharpPlot.SetDatumTagFont Method (String,Double)

Set DatumTag font name and point-size.

public void SetDatumTagFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (String,FontStyle)

SharpPlot.SetDatumTagFont Method (String,FontStyle)

Set DatumTag font name and style.

public void SetDatumTagFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (String,Color)

SharpPlot.SetDatumTagFont Method (String,Color)

Set DatumTag font name and color.

public void SetDatumTagFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetDatumTagFont Method (FontStyle,Color)

SharpPlot.SetDatumTagFont Method (FontStyle,Color)

Set DatumTag font style and color.

public void SetDatumTagFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetEdgeStyle Method

SharpPlot.SetEdgeStyle Method

Set Edge format given any of color, lineStyle and lineweight (pts).

Example

sp.SetEdgeStyle(Color.White,LineStyle.Solid,2);

Overloads

  • public void SetEdgeStyle(Color lineColor);
  • public void SetEdgeStyle(double lineWidth);
  • public void SetEdgeStyle(LineStyle lineStyle);
  • public void SetEdgeStyle(Color lineColor,LineStyle lineStyle);
  • public void SetEdgeStyle(Color lineColor,LineStyle lineStyle,double lineWidth);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetEdgeStyle Method (Color,LineStyle,Double)

SharpPlot.SetEdgeStyle Method (Color,LineStyle,Double)

Set Edge format given color, lineStyle and lineweight.

public void SetEdgeStyle(
    Color lineColor,
    LineStyle lineStyle,
    double lineWidth
);

See also ...

SharpPlot Members | SetEdgeStyle Method


SharpPlot 2.51 User Manual: SetEdgeStyle Method (Color,LineStyle)

SharpPlot.SetEdgeStyle Method (Color,LineStyle)

Set Edge format color and lineStyle.

public void SetEdgeStyle(
    Color lineColor,
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetEdgeStyle Method


SharpPlot 2.51 User Manual: SetEdgeStyle Method (Color)

SharpPlot.SetEdgeStyle Method (Color)

Set Edge format color only.

public void SetEdgeStyle(
    Color lineColor
);

See also ...

SharpPlot Members | SetEdgeStyle Method


SharpPlot 2.51 User Manual: SetEdgeStyle Method (LineStyle)

SharpPlot.SetEdgeStyle Method (LineStyle)

Set Edge format line-style only.

public void SetEdgeStyle(
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetEdgeStyle Method


SharpPlot 2.51 User Manual: SetEdgeStyle Method (Double)

SharpPlot.SetEdgeStyle Method (Double)

Set Edge format line-weight (pts) only.

public void SetEdgeStyle(
    double lineWidth
);

See also ...

SharpPlot Members | SetEdgeStyle Method


SharpPlot 2.51 User Manual: SetEffects Method

SharpPlot.SetEffects Method

Effect list for use by upcoming data series.

Example

sp.SetEffects("filter:url(#pietile)");

Overloads

  • public void SetEffects(string effect);
  • public void SetEffects(string[] effects);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetEffects Method (String[])

SharpPlot.SetEffects Method (String[])

Set Effect cycle – array of strings defining effects.

public void SetEffects(
    string[] effects
);

See also ...

SharpPlot Members | SetEffects Method


SharpPlot 2.51 User Manual: SetEffects Method (String)

SharpPlot.SetEffects Method (String)

Set a single effect.

public void SetEffects(
    string effect
);

See also ...

SharpPlot Members | SetEffects Method


SharpPlot 2.51 User Manual: SetEquationPosition Method

SharpPlot.SetEquationPosition Method

Set Equation position from x,y

Overloads

  • public void SetEquationPosition(double Position);
  • public void SetEquationPosition(double xPosition,double yPosition);

See also ...

SharpPlot Members | EquationStyle Property


SharpPlot 2.51 User Manual: SetFillStyles Method

SharpPlot.SetFillStyles Method

Fill Patterns for use by upcoming data series. The patterns will be reused cyclically for any data-series which require shaded areas (typically barcharts or surface-shaded line-graphs).

Example

sp.SetFillStyles(new FillStyle[]{FillStyle.Saturate30,FillStyle.Saturate60});

Overloads

  • public void SetFillStyles(FillStyle fillStyle);
  • public void SetFillStyles(FillStyle[] fillStyles);

Calling this with a single FillStyle sets this as the style for all filled series from now on.

See also ...

SharpPlot Members | FillStyle Struct


SharpPlot 2.51 User Manual: SetFillStyles Method (FillStyle[])

SharpPlot.SetFillStyles Method (FillStyle[])

Set an array of fill-styles for use by upcoming series.

public void SetFillStyles(
    FillStyle[] fillStyles
);

See also ...

SharpPlot Members | SetFillStyles Method


SharpPlot 2.51 User Manual: SetFillStyles Method (FillStyle)

SharpPlot.SetFillStyles Method (FillStyle)

Use only this fill style for all series.

public void SetFillStyles(
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetFillStyles Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method

SharpPlot.SetFootnoteFont Method

Set Footnote font given any of fontname, point-size, style, color.

Example

sp.SetFootnoteFont("Arial,Sans",12,FontStyle.Italic,Color.Gray);

Overloads

  • public void SetFootnoteFont(string fontName);
  • public void SetFootnoteFont(double fontSize);
  • public void SetFootnoteFont(Color fontColor);
  • public void SetFootnoteFont(FontStyle fontStyle);
  • public void SetFootnoteFont(string fontName,double fontSize);
  • public void SetFootnoteFont(string fontName,Color fontColor);
  • public void SetFootnoteFont(double fontSize,Color fontColor);
  • public void SetFootnoteFont(string fontName,FontStyle fontStyle);
  • public void SetFootnoteFont(FontStyle fontStyle,Color fontColor);
  • public void SetFootnoteFont(string fontName,double fontSize,Color fontColor);
  • public void SetFootnoteFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetFootnoteFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetFootnoteFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetFootnoteFont Method (String,Double,FontStyle,Color)

SharpPlot.SetFootnoteFont Method (String,Double,FontStyle,Color)

Set Footnote font from fontname, point-size, style and color.

public void SetFootnoteFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (Double,Color)

SharpPlot.SetFootnoteFont Method (Double,Color)

Set Footnote font point-size and color.

public void SetFootnoteFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (String,Double,Color)

SharpPlot.SetFootnoteFont Method (String,Double,Color)

Set Footnote font name, point-size and color.

public void SetFootnoteFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (String,FontStyle,Color)

SharpPlot.SetFootnoteFont Method (String,FontStyle,Color)

Set Footnote font name, style and color.

public void SetFootnoteFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (String,Double,FontStyle)

SharpPlot.SetFootnoteFont Method (String,Double,FontStyle)

Set Footnote font name, point-size and style.

public void SetFootnoteFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (String)

SharpPlot.SetFootnoteFont Method (String)

Set Footnote font fontname only.

public void SetFootnoteFont(
    string fontName
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (Double)

SharpPlot.SetFootnoteFont Method (Double)

Set Footnote font point-size only.

public void SetFootnoteFont(
    double fontSize
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (Color)

SharpPlot.SetFootnoteFont Method (Color)

Set Footnote font Color only.

public void SetFootnoteFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (FontStyle)

SharpPlot.SetFootnoteFont Method (FontStyle)

Set Footnote font style only.

public void SetFootnoteFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (String,Double)

SharpPlot.SetFootnoteFont Method (String,Double)

Set Footnote font name and point-size.

public void SetFootnoteFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (String,FontStyle)

SharpPlot.SetFootnoteFont Method (String,FontStyle)

Set Footnote font name and style.

public void SetFootnoteFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (String,Color)

SharpPlot.SetFootnoteFont Method (String,Color)

Set Footnote font name and color.

public void SetFootnoteFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFootnoteFont Method (FontStyle,Color)

SharpPlot.SetFootnoteFont Method (FontStyle,Color)

Set Footnote font style and color.

public void SetFootnoteFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetFootnoteFont Method


SharpPlot 2.51 User Manual: SetFrameBackground Method

SharpPlot.SetFrameBackground Method

Set Frame background shading style from any of fill-color, fill-style, edge-width (pts).

Example

sp.SetFrameBackground(Color.WhiteSmoke,FillStyle.Solid);

Overloads

  • public void SetFrameBackground(Color fillColor);
  • public void SetFrameBackground(double edgeWidth);
  • public void SetFrameBackground(FillStyle fillStyle);
  • public void SetFrameBackground(Color fillColor,FillStyle fillStyle);
  • public void SetFrameBackground(Color fillColor,FillStyle fillStyle,double edgeWidth);

See also ...

SharpPlot Members | FillStyle Struct


SharpPlot 2.51 User Manual: SetFrameBackground Method (Color,FillStyle,Double)

SharpPlot.SetFrameBackground Method (Color,FillStyle,Double)

Set Frame background shading (fill-color, fill-style, edge-width).

public void SetFrameBackground(
    Color fillColor,
    FillStyle fillStyle,
    double edgeWidth
);

See also ...

SharpPlot Members | SetFrameBackground Method


SharpPlot 2.51 User Manual: SetFrameBackground Method (Color,FillStyle)

SharpPlot.SetFrameBackground Method (Color,FillStyle)

Set Frame background fill-color and shading.

public void SetFrameBackground(
    Color fillColor,
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetFrameBackground Method


SharpPlot 2.51 User Manual: SetFrameBackground Method (Color)

SharpPlot.SetFrameBackground Method (Color)

Set Frame background fill-color only.

public void SetFrameBackground(
    Color fillColor
);

See also ...

SharpPlot Members | SetFrameBackground Method


SharpPlot 2.51 User Manual: SetFrameBackground Method (FillStyle)

SharpPlot.SetFrameBackground Method (FillStyle)

Set Frame background shading only.

public void SetFrameBackground(
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetFrameBackground Method


SharpPlot 2.51 User Manual: SetFrameBackground Method (Double)

SharpPlot.SetFrameBackground Method (Double)

Set Frame background edge-width (pts) only.

public void SetFrameBackground(
    double edgeWidth
);

See also ...

SharpPlot Members | SetFrameBackground Method


SharpPlot 2.51 User Manual: SetGridLineStyle Method

SharpPlot.SetGridLineStyle Method

Set Gridline format given any of color, lineStyle and lineweight (pts).

Example

sp.SetGridLineStyle(Color.Gray,LineStyle.Solid,0.5);

Overloads

  • public void SetGridLineStyle(Color lineColor);
  • public void SetGridLineStyle(double lineWidth);
  • public void SetGridLineStyle(LineStyle lineStyle);
  • public void SetGridLineStyle(Color lineColor,LineStyle lineStyle);
  • public void SetGridLineStyle(Color lineColor,LineStyle lineStyle,double lineWidth);

Gridlines are drawn at major tickmarks which exceed the current grid threshold value (default 80% of standard tick length).

See also ...

SharpPlot Members | LineStyle Struct


SharpPlot 2.51 User Manual: SetGridLineStyle Method (Color,LineStyle,Double)

SharpPlot.SetGridLineStyle Method (Color,LineStyle,Double)

Set Gridline format given color, lineStyle and lineweight.

public void SetGridLineStyle(
    Color lineColor,
    LineStyle lineStyle,
    double lineWidth
);

See also ...

SharpPlot Members | SetGridLineStyle Method


SharpPlot 2.51 User Manual: SetGridLineStyle Method (Color,LineStyle)

SharpPlot.SetGridLineStyle Method (Color,LineStyle)

Set Gridline format color and lineStyle.

public void SetGridLineStyle(
    Color lineColor,
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetGridLineStyle Method


SharpPlot 2.51 User Manual: SetGridLineStyle Method (Color)

SharpPlot.SetGridLineStyle Method (Color)

Set Gridline format color only.

public void SetGridLineStyle(
    Color lineColor
);

See also ...

SharpPlot Members | SetGridLineStyle Method


SharpPlot 2.51 User Manual: SetGridLineStyle Method (LineStyle)

SharpPlot.SetGridLineStyle Method (LineStyle)

Set Gridline format line-style only.

public void SetGridLineStyle(
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetGridLineStyle Method


SharpPlot 2.51 User Manual: SetGridLineStyle Method (Double)

SharpPlot.SetGridLineStyle Method (Double)

Set Gridline format line-weight (pts) only.

public void SetGridLineStyle(
    double lineWidth
);

See also ...

SharpPlot Members | SetGridLineStyle Method


SharpPlot 2.51 User Manual: SetHeadingFont Method

SharpPlot.SetHeadingFont Method

Set Heading font given any of fontname, point-size, style, color.

Example

sp.SetHeadingFont("Baskerville,Times",16,FontStyle.Bold,Color.Maroon);

Overloads

  • public void SetHeadingFont(string fontName);
  • public void SetHeadingFont(double fontSize);
  • public void SetHeadingFont(Color fontColor);
  • public void SetHeadingFont(FontStyle fontStyle);
  • public void SetHeadingFont(string fontName,double fontSize);
  • public void SetHeadingFont(string fontName,Color fontColor);
  • public void SetHeadingFont(double fontSize,Color fontColor);
  • public void SetHeadingFont(string fontName,FontStyle fontStyle);
  • public void SetHeadingFont(FontStyle fontStyle,Color fontColor);
  • public void SetHeadingFont(string fontName,double fontSize,Color fontColor);
  • public void SetHeadingFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetHeadingFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetHeadingFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetHeadingFont Method (String,Double,FontStyle,Color)

SharpPlot.SetHeadingFont Method (String,Double,FontStyle,Color)

Set Heading font from fontname, point-size, style and color.

public void SetHeadingFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (Double,Color)

SharpPlot.SetHeadingFont Method (Double,Color)

Set Heading font point-size and color.

public void SetHeadingFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (String,Double,Color)

SharpPlot.SetHeadingFont Method (String,Double,Color)

Set Heading font name, point-size and color.

public void SetHeadingFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (String,FontStyle,Color)

SharpPlot.SetHeadingFont Method (String,FontStyle,Color)

Set Heading font name, style and color.

public void SetHeadingFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (String,Double,FontStyle)

SharpPlot.SetHeadingFont Method (String,Double,FontStyle)

Set Heading font name, point-size and style.

public void SetHeadingFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (String)

SharpPlot.SetHeadingFont Method (String)

Set Heading font fontname only.

public void SetHeadingFont(
    string fontName
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (Double)

SharpPlot.SetHeadingFont Method (Double)

Set Heading font point-size only.

public void SetHeadingFont(
    double fontSize
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (Color)

SharpPlot.SetHeadingFont Method (Color)

Set Heading font Color only.

public void SetHeadingFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (FontStyle)

SharpPlot.SetHeadingFont Method (FontStyle)

Set Heading font style only.

public void SetHeadingFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (String,Double)

SharpPlot.SetHeadingFont Method (String,Double)

Set Heading font name and point-size.

public void SetHeadingFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (String,FontStyle)

SharpPlot.SetHeadingFont Method (String,FontStyle)

Set Heading font name and style.

public void SetHeadingFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (String,Color)

SharpPlot.SetHeadingFont Method (String,Color)

Set Heading font name and color.

public void SetHeadingFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingFont Method (FontStyle,Color)

SharpPlot.SetHeadingFont Method (FontStyle,Color)

Set Heading font style and color.

public void SetHeadingFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetHeadingFont Method


SharpPlot 2.51 User Manual: SetHeadingNudge Method

SharpPlot.SetHeadingNudge Method

Set Heading nudge from displacements (right,up).

public void SetHeadingNudge(
    double nudgeX,
    double nudgeY
);

Example

sp.SetHeadingNudge(0,6);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetIDataRange Method

SharpPlot.SetIDataRange Method

You can call any of the plotting routines with an array of arrays to have multiple series ranged and plotted at one call. However it is often more convenient to make several calls, one for each series. This method allows you to pass in all your inner-axis data arrays in advance, and notes the extreme values for use when the first plot is drawn.

Example

sp.SetIDataRange(col_Year);

Overloads

  • public void SetIDataRange(double value);
  • public void SetIDataRange(int[] value);
  • public void SetIDataRange(double[] value);
  • public void SetIDataRange(int[][] valueset);
  • public void SetIDataRange(double[][] valueset);

All the other axis properties (range, tick-interval etc) continue to apply as normal.

See also ...

SetYDataRange Method


SharpPlot 2.51 User Manual: SetIDataRange Method (Double[])

SharpPlot.SetIDataRange Method (Double[])

Set Inner data range given a double vector.

public void SetIDataRange(
    double[] value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetIDataRange Method


SharpPlot 2.51 User Manual: SetIDataRange Method (Double)

SharpPlot.SetIDataRange Method (Double)

Set Inner data range to a single value.

public void SetIDataRange(
    double value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetIDataRange Method


SharpPlot 2.51 User Manual: SetIDataRange Method (Int32[])

SharpPlot.SetIDataRange Method (Int32[])

Set Inner data range to the min and max of an integer array.

public void SetIDataRange(
    int[] value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetIDataRange Method


SharpPlot 2.51 User Manual: SetIDataRange Method (Double[][])

SharpPlot.SetIDataRange Method (Double[][])

Set Inner data range to range several numeric arrays.

public void SetIDataRange(
    double[][] valueset
);
valueset
[todo]

See also ...

SharpPlot Members | SetIDataRange Method


SharpPlot 2.51 User Manual: SetIDataRange Method (Int32[][])

SharpPlot.SetIDataRange Method (Int32[][])

Set Inner data range to range several integer arrays.

public void SetIDataRange(
    int[][] valueset
);
valueset
[todo]

See also ...

SharpPlot Members | SetIDataRange Method


SharpPlot 2.51 User Manual: SetILabelFont Method

SharpPlot.SetILabelFont Method

Set Inner label font given any of fontname, point-size, style, color.

Example

sp.SetILabelFont("Arial",6);

Overloads

  • public void SetILabelFont(string fontName);
  • public void SetILabelFont(double fontSize);
  • public void SetILabelFont(Color fontColor);
  • public void SetILabelFont(FontStyle fontStyle);
  • public void SetILabelFont(string fontName,double fontSize);
  • public void SetILabelFont(string fontName,Color fontColor);
  • public void SetILabelFont(double fontSize,Color fontColor);
  • public void SetILabelFont(string fontName,FontStyle fontStyle);
  • public void SetILabelFont(FontStyle fontStyle,Color fontColor);
  • public void SetILabelFont(string fontName,double fontSize,Color fontColor);
  • public void SetILabelFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetILabelFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetILabelFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetILabelFont Method (String,Double,FontStyle,Color)

SharpPlot.SetILabelFont Method (String,Double,FontStyle,Color)

Set Inner label font from fontname, point-size, style and color.

public void SetILabelFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (Double,Color)

SharpPlot.SetILabelFont Method (Double,Color)

Set Inner label font point-size and color.

public void SetILabelFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (String,Double,Color)

SharpPlot.SetILabelFont Method (String,Double,Color)

Set Inner label font name, point-size and color.

public void SetILabelFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (String,FontStyle,Color)

SharpPlot.SetILabelFont Method (String,FontStyle,Color)

Set Inner label font name, style and color.

public void SetILabelFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (String,Double,FontStyle)

SharpPlot.SetILabelFont Method (String,Double,FontStyle)

Set Inner label font name, point-size and style.

public void SetILabelFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (String)

SharpPlot.SetILabelFont Method (String)

Set Inner label font fontname only.

public void SetILabelFont(
    string fontName
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (Double)

SharpPlot.SetILabelFont Method (Double)

Set Inner label font point-size only.

public void SetILabelFont(
    double fontSize
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (Color)

SharpPlot.SetILabelFont Method (Color)

Set Inner label font Color only.

public void SetILabelFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (FontStyle)

SharpPlot.SetILabelFont Method (FontStyle)

Set Inner label font style only.

public void SetILabelFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (String,Double)

SharpPlot.SetILabelFont Method (String,Double)

Set Inner label font name and point-size.

public void SetILabelFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (String,FontStyle)

SharpPlot.SetILabelFont Method (String,FontStyle)

Set Inner label font name and style.

public void SetILabelFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (String,Color)

SharpPlot.SetILabelFont Method (String,Color)

Set Inner label font name and color.

public void SetILabelFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabelFont Method (FontStyle,Color)

SharpPlot.SetILabelFont Method (FontStyle,Color)

Set Inner label font style and color.

public void SetILabelFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetILabelFont Method


SharpPlot 2.51 User Manual: SetILabels Method

SharpPlot.SetILabels Method

Set text items for each inner-tickmark.

public void SetILabels(
    string[] labels
);

Example

sp.SetILabels(new string[]{"L1","L2"});
  • public void SetILabels(string item);
  • public void SetILabels(string[] value);
  • public void SetILabels(string item);
  • public void SetILabels(string[] value);
  • public void SetILabels(string item);
  • public void SetILabels(string[] value);

See also ...

Formatting text with simple HTML tags | SharpPlot Members


SharpPlot 2.51 User Manual: SetILabels Method (String[])

SharpPlot.SetILabels Method (String[])

Set I labels from an array of strings.

public void SetILabels(
    string[] value
);

See also ...

SharpPlot Members | SetILabels Method


SharpPlot 2.51 User Manual: SetILabels Method (String)

SharpPlot.SetILabels Method (String)

Use first item only.

public void SetILabels(
    string item
);

See also ...

SharpPlot Members | SetILabels Method


SharpPlot 2.51 User Manual: SetIRange Method

SharpPlot.SetIRange Method

Set I axis range given one or two elements.

Example

sp.SetIRange(-10,10);

Overloads

  • public void SetIRange();
  • public void SetIRange(double max);
  • public void SetIRange(double min,double max);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetIRange Method (Double,Double)

SharpPlot.SetIRange Method (Double,Double)

Set Inner axis range minimum and maximum values.

public void SetIRange(
    double min,
    double max
);
min
[todo]
max
[todo]

See also ...

SharpPlot Members | SetIRange Method


SharpPlot 2.51 User Manual: SetIRange Method (Double)

SharpPlot.SetIRange Method (Double)

Set Inner axis range maximum value only.

public void SetIRange(
    double max
);
max
[todo]

See also ...

SharpPlot Members | SetIRange Method


SharpPlot 2.51 User Manual: SetIRange Method

SharpPlot.SetIRange Method

Reset Inner axis range to default.

public void SetIRange();

See also ...

SharpPlot Members | SetIRange Method


SharpPlot 2.51 User Manual: SetITickMarks Method

SharpPlot.SetITickMarks Method

Set I tick marks.

Example

sp.SetITickMarks(10);

Overloads

  • public void SetITickMarks(double value);
  • public void SetITickMarks(int[] value);
  • public void SetITickMarks(double[] value);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetITickMarks Method (Double[])

SharpPlot.SetITickMarks Method (Double[])

Set I tick marks given a double vector.

public void SetITickMarks(
    double[] value
);

See also ...

SharpPlot Members | SetITickMarks Method


SharpPlot 2.51 User Manual: SetITickMarks Method (Double)

SharpPlot.SetITickMarks Method (Double)

Set I tick marks to a single value.

public void SetITickMarks(
    double value
);

See also ...

SharpPlot Members | SetITickMarks Method


SharpPlot 2.51 User Manual: SetITickMarks Method (Int32[])

SharpPlot.SetITickMarks Method (Int32[])

Set I tick marks to a integer array.

public void SetITickMarks(
    int[] value
);

See also ...

SharpPlot Members | SetITickMarks Method


SharpPlot 2.51 User Manual: SetIZones Method

SharpPlot.SetIZones Method

Set I zones.

Example

sp.SetIZones(new Zone(40,60,Color.Silver,FillStyle.Solid));

Overloads

  • public void SetIZones(Zone value);
  • public void SetIZones(Zone[] value);

See also ...

SharpPlot Members | Zone Struct


SharpPlot 2.51 User Manual: SetIZones Method (Zone[])

SharpPlot.SetIZones Method (Zone[])

Set I zones from an array of Zone definitions.

public void SetIZones(
    Zone[] value
);

See also ...

SharpPlot Members | SetIZones Method


SharpPlot 2.51 User Manual: SetIZones Method (Zone)

SharpPlot.SetIZones Method (Zone)

Set a single Zone definition.

public void SetIZones(
    Zone value
);

See also ...

SharpPlot Members | SetIZones Method


SharpPlot 2.51 User Manual: SetKeyBackground Method

SharpPlot.SetKeyBackground Method

Set Key background shading style from any of fill-color, fill-style, edge-width (pts).

Example

sp.SetKeyBackground(Color.Silver,FillStyle.Solid);

Overloads

  • public void SetKeyBackground(Color fillColor);
  • public void SetKeyBackground(double edgeWidth);
  • public void SetKeyBackground(FillStyle fillStyle);
  • public void SetKeyBackground(Color fillColor,FillStyle fillStyle);
  • public void SetKeyBackground(Color fillColor,FillStyle fillStyle,double edgeWidth);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetKeyBackground Method (Color,FillStyle,Double)

SharpPlot.SetKeyBackground Method (Color,FillStyle,Double)

Set Key background shading (fill-color, fill-style, edge-width).

public void SetKeyBackground(
    Color fillColor,
    FillStyle fillStyle,
    double edgeWidth
);

See also ...

SharpPlot Members | SetKeyBackground Method


SharpPlot 2.51 User Manual: SetKeyBackground Method (Color,FillStyle)

SharpPlot.SetKeyBackground Method (Color,FillStyle)

Set Key background fill-color and shading.

public void SetKeyBackground(
    Color fillColor,
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetKeyBackground Method


SharpPlot 2.51 User Manual: SetKeyBackground Method (Color)

SharpPlot.SetKeyBackground Method (Color)

Set Key background fill-color only.

public void SetKeyBackground(
    Color fillColor
);

See also ...

SharpPlot Members | SetKeyBackground Method


SharpPlot 2.51 User Manual: SetKeyBackground Method (FillStyle)

SharpPlot.SetKeyBackground Method (FillStyle)

Set Key background shading only.

public void SetKeyBackground(
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetKeyBackground Method


SharpPlot 2.51 User Manual: SetKeyBackground Method (Double)

SharpPlot.SetKeyBackground Method (Double)

Set Key background edge-width (pts) only.

public void SetKeyBackground(
    double edgeWidth
);

See also ...

SharpPlot Members | SetKeyBackground Method


SharpPlot 2.51 User Manual: SetKeyFont Method

SharpPlot.SetKeyFont Method

Set Key font given any of fontname, point-size, style, color.

Example

sp.SetKeyFont("Verdana,Arial",14);

Overloads

  • public void SetKeyFont(string fontName);
  • public void SetKeyFont(double fontSize);
  • public void SetKeyFont(Color fontColor);
  • public void SetKeyFont(FontStyle fontStyle);
  • public void SetKeyFont(string fontName,double fontSize);
  • public void SetKeyFont(string fontName,Color fontColor);
  • public void SetKeyFont(double fontSize,Color fontColor);
  • public void SetKeyFont(string fontName,FontStyle fontStyle);
  • public void SetKeyFont(FontStyle fontStyle,Color fontColor);
  • public void SetKeyFont(string fontName,double fontSize,Color fontColor);
  • public void SetKeyFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetKeyFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetKeyFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetKeyFont Method (String,Double,FontStyle,Color)

SharpPlot.SetKeyFont Method (String,Double,FontStyle,Color)

Set Key font from fontname, point-size, style and color.

public void SetKeyFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (Double,Color)

SharpPlot.SetKeyFont Method (Double,Color)

Set Key font point-size and color.

public void SetKeyFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (String,Double,Color)

SharpPlot.SetKeyFont Method (String,Double,Color)

Set Key font name, point-size and color.

public void SetKeyFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (String,FontStyle,Color)

SharpPlot.SetKeyFont Method (String,FontStyle,Color)

Set Key font name, style and color.

public void SetKeyFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (String,Double,FontStyle)

SharpPlot.SetKeyFont Method (String,Double,FontStyle)

Set Key font name, point-size and style.

public void SetKeyFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (String)

SharpPlot.SetKeyFont Method (String)

Set Key font fontname only.

public void SetKeyFont(
    string fontName
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (Double)

SharpPlot.SetKeyFont Method (Double)

Set Key font point-size only.

public void SetKeyFont(
    double fontSize
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (Color)

SharpPlot.SetKeyFont Method (Color)

Set Key font Color only.

public void SetKeyFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (FontStyle)

SharpPlot.SetKeyFont Method (FontStyle)

Set Key font style only.

public void SetKeyFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (String,Double)

SharpPlot.SetKeyFont Method (String,Double)

Set Key font name and point-size.

public void SetKeyFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (String,FontStyle)

SharpPlot.SetKeyFont Method (String,FontStyle)

Set Key font name and style.

public void SetKeyFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (String,Color)

SharpPlot.SetKeyFont Method (String,Color)

Set Key font name and color.

public void SetKeyFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFont Method (FontStyle,Color)

SharpPlot.SetKeyFont Method (FontStyle,Color)

Set Key font style and color.

public void SetKeyFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetKeyFont Method


SharpPlot 2.51 User Manual: SetKeyFrame Method

SharpPlot.SetKeyFrame Method

Key frame (left top width height in pts) to place the chart legend in a non-default location. The legend text will be wrapped into the frame width if necessary, and key-style ‘Autofit’ will force the key font to reduce until all the legend fits within the frame. The first legend is always written in the upper-left corner of the frame.

public void SetKeyFrame(
    double left,
    double top,
    double width,
    double height
);

Example

sp.SetKeyFrame(200,300,40,60);

The frame is relative to the entire chart area – the paper size less the gutter width (typically 4pts all round). If the key has style ‘Boxed’ the box will be drawn around the text by default, not the entire extent of the frame. To draw around the frame, use the BoxFrame keystyle.

See also ...

SharpPlot Members | KeyStyles Enumeration


SharpPlot 2.51 User Manual: SetKeyIndices Method

SharpPlot.SetKeyIndices Method

Makes an arbitrary selection from the currently defined key placeholders and associated legend texts.

Example

sp.SetKeyIndices(new int[] {5,4,1});
sp.KeyStyle = KeyStyles.Vertical|KeyStyles.Boxed|KeyStyles.RightAlign|KeyStyles.MiddleAlign;
sp.DrawKey(70,5);

Overloads

  • public void SetKeyIndices(int value);
  • public void SetKeyIndices(int[] value);

Description

As elements are added to a complex chart, the legend definitions are accumulated in the order the charts are created. This order may not be how the legend should appear, or it may be necessary to select only some of the legend items. This setting may be used (as here) to control one or more calls to DrawKey, or simply to choose the entries flushed out by default when the chart is rendered.

Note that the legend text is given in the same sequence as the original (default) ordering – both the placeholders and legends are selected by this setting. If you request a Trend line and a Model fit with a Scatterplot, the legend items are added in the sequence (data,trend.model) for each series plotted.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetKeyIndices Method (Int32[])

SharpPlot.SetKeyIndices Method (Int32[])

Key indices.

public void SetKeyIndices(
    int[] value
);

See also ...

SharpPlot Members | SetKeyIndices Method


SharpPlot 2.51 User Manual: SetKeyIndices Method (Int32)

SharpPlot.SetKeyIndices Method (Int32)

Set Key indices from a single value.

public void SetKeyIndices(
    int value
);

See also ...

SharpPlot Members | SetKeyIndices Method


SharpPlot 2.51 User Manual: SetKeyNudge Method

SharpPlot.SetKeyNudge Method

Apply final ajustment to legend position from displacements (right,up) in points.

public void SetKeyNudge(
    double nudgeX,
    double nudgeY
);

Example

sp.SetKeyNudge(12,12);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetKeyText Method

SharpPlot.SetKeyText Method

Set Legends for key given a string array or a simple string.

Example

sp.SetKeyText(new string[]{"Tonnes","Value"});

Overloads

  • public void SetKeyText(string label);
  • public void SetKeyText(int[] values);
  • public void SetKeyText(string[] labels);
  • public void SetKeyText(double[] values);
  • public void SetKeyText(string[][] labels);

Adding text for trend lines

Every time SharpPlot draws a line (either a data line or a curve fit) it adds an entry to the table of keys and cycles through the list of line-styles and colours. This is to allow you (for example) to have a key reading:

Raw data ---- Trend Line ---- Cubic model

If you have 2 series each with a modelfit, you will get 4 key entries. If you only want to key your data, then set the key text to have 2 empty entries, for example

sp.SetKeyText (new string[] {"First series","","Second series",""});

The placeholder entries for the fitted lines will be skipped over in the legend.

See also ...

Formatting text with simple HTML tags | SharpPlot Members | ModelFitKey Property | TrendLineKey Property


SharpPlot 2.51 User Manual: SetKeyText Method (String[])

SharpPlot.SetKeyText Method (String[])

Set Legends for key from an array of strings.

public void SetKeyText(
    string[] labels
);

See also ...

SharpPlot Members | SetKeyText Method


SharpPlot 2.51 User Manual: SetKeyText Method (String)

SharpPlot.SetKeyText Method (String)

Set all Legends for key to a simple string.

public void SetKeyText(
    string label
);

See also ...

SharpPlot Members | SetKeyText Method


SharpPlot 2.51 User Manual: SetKeyText Method (String[][])

SharpPlot.SetKeyText Method (String[][])

Set multiple rows of labels.

public void SetKeyText(
    string[][] labels
);

See also ...

SharpPlot Members | SetKeyText Method


SharpPlot 2.51 User Manual: SetKeyText Method (Int32[])

SharpPlot.SetKeyText Method (Int32[])

Format Legends for key from an integer array.

public void SetKeyText(
    int[] values
);

See also ...

SharpPlot Members | SetKeyText Method


SharpPlot 2.51 User Manual: SetKeyText Method (Double[])

SharpPlot.SetKeyText Method (Double[])

Format Legends for key from a numeric array.

public void SetKeyText(
    double[] values
);

See also ...

SharpPlot Members | SetKeyText Method


SharpPlot 2.51 User Manual: SetLabelFont Method

SharpPlot.SetLabelFont Method

Set Label font given any of fontname, point-size, style, color.

Example

sp.SetLabelFont("Arial",14,FontStyle.Bold,Color.Firebrick);

Overloads

  • public void SetLabelFont(string fontName);
  • public void SetLabelFont(double fontSize);
  • public void SetLabelFont(Color fontColor);
  • public void SetLabelFont(FontStyle fontStyle);
  • public void SetLabelFont(string fontName,double fontSize);
  • public void SetLabelFont(string fontName,Color fontColor);
  • public void SetLabelFont(double fontSize,Color fontColor);
  • public void SetLabelFont(string fontName,FontStyle fontStyle);
  • public void SetLabelFont(FontStyle fontStyle,Color fontColor);
  • public void SetLabelFont(string fontName,double fontSize,Color fontColor);
  • public void SetLabelFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetLabelFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetLabelFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetLabelFont Method (String,Double,FontStyle,Color)

SharpPlot.SetLabelFont Method (String,Double,FontStyle,Color)

Set Label font from fontname, point-size, style and color.

public void SetLabelFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (Double,Color)

SharpPlot.SetLabelFont Method (Double,Color)

Set Label font point-size and color.

public void SetLabelFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (String,Double,Color)

SharpPlot.SetLabelFont Method (String,Double,Color)

Set Label font name, point-size and color.

public void SetLabelFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (String,FontStyle,Color)

SharpPlot.SetLabelFont Method (String,FontStyle,Color)

Set Label font name, style and color.

public void SetLabelFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (String,Double,FontStyle)

SharpPlot.SetLabelFont Method (String,Double,FontStyle)

Set Label font name, point-size and style.

public void SetLabelFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (String)

SharpPlot.SetLabelFont Method (String)

Set Label font fontname only.

public void SetLabelFont(
    string fontName
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (Double)

SharpPlot.SetLabelFont Method (Double)

Set Label font point-size only.

public void SetLabelFont(
    double fontSize
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (Color)

SharpPlot.SetLabelFont Method (Color)

Set Label font Color only.

public void SetLabelFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (FontStyle)

SharpPlot.SetLabelFont Method (FontStyle)

Set Label font style only.

public void SetLabelFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (String,Double)

SharpPlot.SetLabelFont Method (String,Double)

Set Label font name and point-size.

public void SetLabelFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (String,FontStyle)

SharpPlot.SetLabelFont Method (String,FontStyle)

Set Label font name and style.

public void SetLabelFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (String,Color)

SharpPlot.SetLabelFont Method (String,Color)

Set Label font name and color.

public void SetLabelFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelFont Method (FontStyle,Color)

SharpPlot.SetLabelFont Method (FontStyle,Color)

Set Label font style and color.

public void SetLabelFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetLabelFont Method


SharpPlot 2.51 User Manual: SetLabelMask Method

SharpPlot.SetLabelMask Method

This call allows you to selectively eliminate the x-axis labels. SharpPlot tries to do this for you automatically (if the labels collide) but it may not do it quite to your liking. Also it never eliminates labels if you use the angled setting on the X-axis, or for Dial or Polar charts.

Example

sp.SetLabelMask(new bool[] {true,false});  // Alternate labels

The example shows a DialChart with alternate labels omitted to avoid crowding.

  • public void SetLabelMask(int[] mask);
  • public void SetLabelMask(bool[] mask);

The array of flags (you may use integers to save typing) is converted to boolean values and replicated to match the number of labels. It correctly takes account of Barcharts (which have a dummy label added at the Y-axis).

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetLabelMask Method (Boolean[])

SharpPlot.SetLabelMask Method (Boolean[])

Set Label mask given a boolean array as a mask.

public void SetLabelMask(
    bool[] mask
);
mask
Array of flags, replicated to match X-labels.

See also ...

SharpPlot Members | SetLabelMask Method


SharpPlot 2.51 User Manual: SetLabelMask Method (Int32[])

SharpPlot.SetLabelMask Method (Int32[])

Set Label mask to positive integer values.

public void SetLabelMask(
    int[] mask
);
mask
Array of flags, replicated to match X-labels.

See also ...

SharpPlot Members | SetLabelMask Method


SharpPlot 2.51 User Manual: SetLineStyles Method

SharpPlot.SetLineStyles Method

Set line-styles for use by upcoming data series.

Example

sp.SetLineStyles(new LineStyle[]{LineStyle.Solid,LineStyle.DashDot});

Overloads

  • public void SetLineStyles(LineStyle lineStyle);
  • public void SetLineStyles(LineStyle[] lineStyles);

Note that ‘extra’ lines such as fitted curves use the linestyle cycle also – this allows you to set chosen styles for all the significant elements in the chart, typically solid for the data and dashed for a trendline.

See also ...

SharpPlot Members | LineStyle Struct


SharpPlot 2.51 User Manual: SetLineStyles Method (LineStyle[])

SharpPlot.SetLineStyles Method (LineStyle[])

Set an array of line-styles to be used by upcoming series.

public void SetLineStyles(
    LineStyle[] lineStyles
);

See also ...

SharpPlot Members | SetLineStyles Method


SharpPlot 2.51 User Manual: SetLineStyles Method (LineStyle)

SharpPlot.SetLineStyles Method (LineStyle)

Use this line style for all series.

public void SetLineStyles(
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetLineStyles Method


SharpPlot 2.51 User Manual: SetMargins Method

SharpPlot.SetMargins Method

Set all four chart margins (in pts) in one call (a single value sets all four to the same).

Example

sp.SetMargins(12); // Same all round
sp.SetMargins(16,24,48,6);

Overloads

  • public void SetMargins();
  • public void SetMargins(double margins);
  • public void SetMargins(double top,double bottom,double left,double right);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetMargins Method (Double,Double,Double,Double)

SharpPlot.SetMargins Method (Double,Double,Double,Double)

Set chart margins (top,left,bottom,right).

public void SetMargins(
    double top,
    double bottom,
    double left,
    double right
);
top
Distance in points from top edge to topmost Y tickmark.
bottom
Distance in points from lower edge to X axis (or first Y tickmark).
left
Distance in points from left edge to Y-axis (or first X tickmark).
right
Distance in points from right edge to last X tickmark.

See also ...

SharpPlot Members | SetMargins Method


SharpPlot 2.51 User Manual: SetMargins Method (Double)

SharpPlot.SetMargins Method (Double)

Set all four margins to this value.

public void SetMargins(
    double margins
);

See also ...

SharpPlot Members | SetMargins Method


SharpPlot 2.51 User Manual: SetMargins Method

SharpPlot.SetMargins Method

Reset all margins to default.

public void SetMargins();

See also ...

SharpPlot Members | SetMargins Method


SharpPlot 2.51 User Manual: SetMarkerColors Method

SharpPlot.SetMarkerColors Method

Set an array of colors to be used for individual markers. This overrides the series color and may be used to encode extra information in any LineGraph or ScatterPlot. The array you give will be replicated to match the number of markers in the series. A list of color names (or HTML codes) may be passed as an alternative.

  • public void SetMarkerColors(Color value);
  • public void SetMarkerColors(string value);
  • public void SetMarkerColors(Color[] colors);

Note that the BubbleChart can generate a color range for you from the current Altitude colors. This offers an alternative to varying the marker size as a way to encode the extra dimension.

See also ...

SharpPlot Members | DrawBubbleChart Method


SharpPlot 2.51 User Manual: SetMarkerColors Method (Color[])

SharpPlot.SetMarkerColors Method (Color[])

Set an array of colors to be used in Altitude-colored markers.

public void SetMarkerColors(
    Color[] colors
);

See also ...

SharpPlot Members | SetMarkerColors Method


SharpPlot 2.51 User Manual: SetMarkerColors Method (Color)

SharpPlot.SetMarkerColors Method (Color)

Single altitude color grades to white.

public void SetMarkerColors(
    Color value
);

See also ...

SharpPlot Members | SetMarkerColors Method


SharpPlot 2.51 User Manual: SetMarkerColors Method (String)

SharpPlot.SetMarkerColors Method (String)

Interpret a list of color names as a color array.

public void SetMarkerColors(
    string value
);

See also ...

SharpPlot Members | SetMarkerColors Method


SharpPlot 2.51 User Manual: SetMarkerScales Method

SharpPlot.SetMarkerScales Method

Set Marker scales for individual markers (relative to 1). The array you give will be replicated to match the number of markers in the series.

Example

sp.SetMarkerScales(2);
sp.SetMarkerScales(new double[] {1,2.2,3,2});

Overloads

  • public void SetMarkerScales(double value);
  • public void SetMarkerScales(int[] value);
  • public void SetMarkerScales(double[] value);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetMarkerScales Method (Double[])

SharpPlot.SetMarkerScales Method (Double[])

Set Marker scales given a double vector.

public void SetMarkerScales(
    double[] value
);

See also ...

SharpPlot Members | SetMarkerScales Method


SharpPlot 2.51 User Manual: SetMarkerScales Method (Double)

SharpPlot.SetMarkerScales Method (Double)

Set Marker scales to a single value.

public void SetMarkerScales(
    double value
);

See also ...

SharpPlot Members | SetMarkerScales Method


SharpPlot 2.51 User Manual: SetMarkerScales Method (Int32[])

SharpPlot.SetMarkerScales Method (Int32[])

Set Marker scales to a integer array.

public void SetMarkerScales(
    int[] value
);

See also ...

SharpPlot Members | SetMarkerScales Method


SharpPlot 2.51 User Manual: SetMarkers Method

SharpPlot.SetMarkers Method

Set marker cycle for use by upcoming data series.

Example

sp.SetMarkers(new Marker[]{Marker.Cross,Marker.Lozenge});

Overloads

  • public void SetMarkers(Marker marker);
  • public void SetMarkers(Marker[] markers);

See also ...

SharpPlot Members | Marker Struct


SharpPlot 2.51 User Manual: SetMarkers Method (Marker[])

SharpPlot.SetMarkers Method (Marker[])

Set up an array of markers for upcoming series.

public void SetMarkers(
    Marker[] markers
);

See also ...

SharpPlot Members | SetMarkers Method


SharpPlot 2.51 User Manual: SetMarkers Method (Marker)

SharpPlot.SetMarkers Method (Marker)

Use only this marker.

public void SetMarkers(
    Marker marker
);

See also ...

SharpPlot Members | SetMarkers Method


SharpPlot 2.51 User Manual: SetModelSpan Method

SharpPlot.SetModelSpan Method

Set the x-axis range for the data used in any model-fit.

Example

sp.SetModelSpan(34);     // Upper limit given
sp.SetModelSpan(42,77);  // Both ends given

This allows you to run several models against the same timeseries if there is an obvious change of slope.


SharpPlot 2.51 User Manual: SetNewline Method

SharpPlot.SetNewline Method

Set an additional line-break character.

public void SetNewline(
    char value
);

This may be convenient when calling SharpPlot from scripting languages that don’t support the handy C# convention of treating \n as a newline character.

Example

sp.SetNewline(';');
sp.Heading = "Here is my;two-line Heading");

The ‘hardwired’ newlines \n and \r will continue to split the line in addition to the character you give here.

See also ...

SharpPlot Members | Heading Property


SharpPlot 2.51 User Manual: SetNoteBackground Method

SharpPlot.SetNoteBackground Method

Set Note background shading style from any of fill-color, fill-style, edge-width (pts).

Example

sp.SetNoteBackground(Color.DodgerBlue,FillStyle.GradientTop);

Overloads

  • public void SetNoteBackground(Color fillColor);
  • public void SetNoteBackground(double edgeWidth);
  • public void SetNoteBackground(FillStyle fillStyle);
  • public void SetNoteBackground(Color fillColor,FillStyle fillStyle);
  • public void SetNoteBackground(Color fillColor,FillStyle fillStyle,double edgeWidth);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetNoteBackground Method (Color,FillStyle,Double)

SharpPlot.SetNoteBackground Method (Color,FillStyle,Double)

Set Note background shading (fill-color, fill-style, edge-width).

public void SetNoteBackground(
    Color fillColor,
    FillStyle fillStyle,
    double edgeWidth
);

See also ...

SharpPlot Members | SetNoteBackground Method


SharpPlot 2.51 User Manual: SetNoteBackground Method (Color,FillStyle)

SharpPlot.SetNoteBackground Method (Color,FillStyle)

Set Note background fill-color and shading.

public void SetNoteBackground(
    Color fillColor,
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetNoteBackground Method


SharpPlot 2.51 User Manual: SetNoteBackground Method (Color)

SharpPlot.SetNoteBackground Method (Color)

Set Note background fill-color only.

public void SetNoteBackground(
    Color fillColor
);

See also ...

SharpPlot Members | SetNoteBackground Method


SharpPlot 2.51 User Manual: SetNoteBackground Method (FillStyle)

SharpPlot.SetNoteBackground Method (FillStyle)

Set Note background shading only.

public void SetNoteBackground(
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetNoteBackground Method


SharpPlot 2.51 User Manual: SetNoteBackground Method (Double)

SharpPlot.SetNoteBackground Method (Double)

Set Note background edge-width (pts) only.

public void SetNoteBackground(
    double edgeWidth
);

See also ...

SharpPlot Members | SetNoteBackground Method


SharpPlot 2.51 User Manual: SetNoteFont Method

SharpPlot.SetNoteFont Method

Set Note font given any of fontname, point-size, style, color.

Example

sp.SetNoteFont("Verdana,Arial",12);

Overloads

  • public void SetNoteFont(string fontName);
  • public void SetNoteFont(double fontSize);
  • public void SetNoteFont(Color fontColor);
  • public void SetNoteFont(FontStyle fontStyle);
  • public void SetNoteFont(string fontName,double fontSize);
  • public void SetNoteFont(string fontName,Color fontColor);
  • public void SetNoteFont(double fontSize,Color fontColor);
  • public void SetNoteFont(string fontName,FontStyle fontStyle);
  • public void SetNoteFont(FontStyle fontStyle,Color fontColor);
  • public void SetNoteFont(string fontName,double fontSize,Color fontColor);
  • public void SetNoteFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetNoteFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetNoteFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetNoteFont Method (String,Double,FontStyle,Color)

SharpPlot.SetNoteFont Method (String,Double,FontStyle,Color)

Set Note font from fontname, point-size, style and color.

public void SetNoteFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (Double,Color)

SharpPlot.SetNoteFont Method (Double,Color)

Set Note font point-size and color.

public void SetNoteFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (String,Double,Color)

SharpPlot.SetNoteFont Method (String,Double,Color)

Set Note font name, point-size and color.

public void SetNoteFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (String,FontStyle,Color)

SharpPlot.SetNoteFont Method (String,FontStyle,Color)

Set Note font name, style and color.

public void SetNoteFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (String,Double,FontStyle)

SharpPlot.SetNoteFont Method (String,Double,FontStyle)

Set Note font name, point-size and style.

public void SetNoteFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (String)

SharpPlot.SetNoteFont Method (String)

Set Note font fontname only.

public void SetNoteFont(
    string fontName
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (Double)

SharpPlot.SetNoteFont Method (Double)

Set Note font point-size only.

public void SetNoteFont(
    double fontSize
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (Color)

SharpPlot.SetNoteFont Method (Color)

Set Note font Color only.

public void SetNoteFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (FontStyle)

SharpPlot.SetNoteFont Method (FontStyle)

Set Note font style only.

public void SetNoteFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (String,Double)

SharpPlot.SetNoteFont Method (String,Double)

Set Note font name and point-size.

public void SetNoteFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (String,FontStyle)

SharpPlot.SetNoteFont Method (String,FontStyle)

Set Note font name and style.

public void SetNoteFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (String,Color)

SharpPlot.SetNoteFont Method (String,Color)

Set Note font name and color.

public void SetNoteFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteFont Method (FontStyle,Color)

SharpPlot.SetNoteFont Method (FontStyle,Color)

Set Note font style and color.

public void SetNoteFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetNoteFont Method


SharpPlot 2.51 User Manual: SetNoteNudge Method

SharpPlot.SetNoteNudge Method

Set Note nudge from displacements (right,up).

public void SetNoteNudge(
    double nudgeX,
    double nudgeY
);

Example

sp.SetNoteNudge(12,0);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetOrderOfFit Method

SharpPlot.SetOrderOfFit Method

Set Order of fit given one or two integers.

Example

sp.SetOrderOfFit(2); // ScatterPlot
sp.SetOrderOfFit(2,1); // For CloudChart

Overloads

  • public void SetOrderOfFit(int orderXY);
  • public void SetOrderOfFit(int orderX,int orderY);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetOrderOfFit Method (Int32,Int32)

SharpPlot.SetOrderOfFit Method (Int32,Int32)

Order of fit for x and y axes (3D charts).

public void SetOrderOfFit(
    int orderX,
    int orderY
);

See also ...

SharpPlot Members | SetOrderOfFit Method


SharpPlot 2.51 User Manual: SetOrderOfFit Method (Int32)

SharpPlot.SetOrderOfFit Method (Int32)

Set Order of fit for 2D charts.

public void SetOrderOfFit(
    int orderXY
);

See also ...

SharpPlot Members | SetOrderOfFit Method


SharpPlot 2.51 User Manual: SetPageLabels Method

SharpPlot.SetPageLabels Method

Create a set of labels to show the current page of a multi-dimensional dataset.

public void SetPageLabels(
    string[] labels
);

Example

sp.SetPageLabels(new string[]{"Budget","Actual"});
  • public void SetPageLabels(string item);
  • public void SetPageLabels(string[] value);
  • public void SetPageLabels(string item);
  • public void SetPageLabels(string[] value);
  • public void SetPageLabels(string item);
  • public void SetPageLabels(string[] value);

See also ...

Formatting text with simple HTML tags | SharpPlot Members | DrawMultiple Method


SharpPlot 2.51 User Manual: SetPageLabels Method (String[])

SharpPlot.SetPageLabels Method (String[])

Set Page-labels from an array of strings.

public void SetPageLabels(
    string[] value
);

See also ...

SharpPlot Members | SetPageLabels Method


SharpPlot 2.51 User Manual: SetPageLabels Method (String)

SharpPlot.SetPageLabels Method (String)

Use first item only.

public void SetPageLabels(
    string item
);

See also ...

SharpPlot Members | SetPageLabels Method


SharpPlot 2.51 User Manual: SetParityLimitStyle Method

SharpPlot.SetParityLimitStyle Method

Set Parity tolerance line format given any of color, lineStyle and lineweight (pts).

Example

sp.SetParityLimitStyle(Color.Maroon,LineStyle.Dash,1);

Overloads

  • public void SetParityLimitStyle(Color lineColor);
  • public void SetParityLimitStyle(double lineWidth);
  • public void SetParityLimitStyle(LineStyle lineStyle);
  • public void SetParityLimitStyle(Color lineColor,LineStyle lineStyle);
  • public void SetParityLimitStyle(Color lineColor,LineStyle lineStyle,double lineWidth);


SharpPlot 2.51 User Manual: SetParityLimitStyle Method (Color,LineStyle,Double)

SharpPlot.SetParityLimitStyle Method (Color,LineStyle,Double)

Set Parity limit style given color, lineStyle and lineweight.

public void SetParityLimitStyle(
    Color lineColor,
    LineStyle lineStyle,
    double lineWidth
);

See also ...

SharpPlot Members | SetParityLimitStyle Method


SharpPlot 2.51 User Manual: SetParityLimitStyle Method (Color,LineStyle)

SharpPlot.SetParityLimitStyle Method (Color,LineStyle)

Set Parity limit style color and lineStyle.

public void SetParityLimitStyle(
    Color lineColor,
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetParityLimitStyle Method


SharpPlot 2.51 User Manual: SetParityLimitStyle Method (Color)

SharpPlot.SetParityLimitStyle Method (Color)

Set Parity limit style color only.

public void SetParityLimitStyle(
    Color lineColor
);

See also ...

SharpPlot Members | SetParityLimitStyle Method


SharpPlot 2.51 User Manual: SetParityLimitStyle Method (LineStyle)

SharpPlot.SetParityLimitStyle Method (LineStyle)

Set Parity limit style line-style only.

public void SetParityLimitStyle(
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetParityLimitStyle Method


SharpPlot 2.51 User Manual: SetParityLimitStyle Method (Double)

SharpPlot.SetParityLimitStyle Method (Double)

Set Parity limit style line-weight (pts) only.

public void SetParityLimitStyle(
    double lineWidth
);

See also ...

SharpPlot Members | SetParityLimitStyle Method


SharpPlot 2.51 User Manual: SetParityLineStyle Method

SharpPlot.SetParityLineStyle Method

Set Parity axis line format given any of color, lineStyle and lineweight (pts). The default is to draw this using the standard axis style.

Example

sp.SetParityLineStyle(Color.Purple,LineStyle.Dash);

Overloads

  • public void SetParityLineStyle(Color lineColor);
  • public void SetParityLineStyle(double lineWidth);
  • public void SetParityLineStyle(LineStyle lineStyle);
  • public void SetParityLineStyle(Color lineColor,LineStyle lineStyle);
  • public void SetParityLineStyle(Color lineColor,LineStyle lineStyle,double lineWidth);


SharpPlot 2.51 User Manual: SetParityLineStyle Method (Color,LineStyle,Double)

SharpPlot.SetParityLineStyle Method (Color,LineStyle,Double)

Set Parity axis style given color, lineStyle and lineweight.

public void SetParityLineStyle(
    Color lineColor,
    LineStyle lineStyle,
    double lineWidth
);

See also ...

SharpPlot Members | SetParityLineStyle Method


SharpPlot 2.51 User Manual: SetParityLineStyle Method (Color,LineStyle)

SharpPlot.SetParityLineStyle Method (Color,LineStyle)

Set Parity axis style color and lineStyle.

public void SetParityLineStyle(
    Color lineColor,
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetParityLineStyle Method


SharpPlot 2.51 User Manual: SetParityLineStyle Method (Color)

SharpPlot.SetParityLineStyle Method (Color)

Set Parity axis style color only.

public void SetParityLineStyle(
    Color lineColor
);

See also ...

SharpPlot Members | SetParityLineStyle Method


SharpPlot 2.51 User Manual: SetParityLineStyle Method (LineStyle)

SharpPlot.SetParityLineStyle Method (LineStyle)

Set Parity axis style line-style only.

public void SetParityLineStyle(
    LineStyle lineStyle
);

See also ...

SharpPlot Members | SetParityLineStyle Method


SharpPlot 2.51 User Manual: SetParityLineStyle Method (Double)

SharpPlot.SetParityLineStyle Method (Double)

Set Parity axis style line-weight (pts) only.

public void SetParityLineStyle(
    double lineWidth
);

See also ...

SharpPlot Members | SetParityLineStyle Method


SharpPlot 2.51 User Manual: SetParityZoneStyle Method

SharpPlot.SetParityZoneStyle Method

Set Parity tolerance zone format given any of color, fillStyle and lineweight (pts) for the edge. The default is that this is unfilled and unedged – it sill only be drawn if the fillStyle is set.

Example

sp.SetParityZoneStyle(Color.Silver,FillStyle.Opacity18);

Overloads

  • public void SetParityZoneStyle(Color fillColor);
  • public void SetParityZoneStyle(double edgeWidth);
  • public void SetParityZoneStyle(FillStyle fillStyle);
  • public void SetParityZoneStyle(Color fillColor,FillStyle fillStyle);
  • public void SetParityZoneStyle(Color fillColor,FillStyle fillStyle,double edgeWidth);


SharpPlot 2.51 User Manual: SetParityZoneStyle Method (Color,FillStyle,Double)

SharpPlot.SetParityZoneStyle Method (Color,FillStyle,Double)

Set Parity zone style shading (fill-color, fill-style, edge-width).

public void SetParityZoneStyle(
    Color fillColor,
    FillStyle fillStyle,
    double edgeWidth
);

See also ...

SharpPlot Members | SetParityZoneStyle Method


SharpPlot 2.51 User Manual: SetParityZoneStyle Method (Color,FillStyle)

SharpPlot.SetParityZoneStyle Method (Color,FillStyle)

Set Parity zone style fill-color and shading.

public void SetParityZoneStyle(
    Color fillColor,
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetParityZoneStyle Method


SharpPlot 2.51 User Manual: SetParityZoneStyle Method (Color)

SharpPlot.SetParityZoneStyle Method (Color)

Set Parity zone style fill-color only.

public void SetParityZoneStyle(
    Color fillColor
);

See also ...

SharpPlot Members | SetParityZoneStyle Method


SharpPlot 2.51 User Manual: SetParityZoneStyle Method (FillStyle)

SharpPlot.SetParityZoneStyle Method (FillStyle)

Set Parity zone style shading only.

public void SetParityZoneStyle(
    FillStyle fillStyle
);

See also ...

SharpPlot Members | SetParityZoneStyle Method


SharpPlot 2.51 User Manual: SetParityZoneStyle Method (Double)

SharpPlot.SetParityZoneStyle Method (Double)

Set Parity zone style edge-width (pts) only.

public void SetParityZoneStyle(
    double edgeWidth
);

See also ...

SharpPlot Members | SetParityZoneStyle Method


SharpPlot 2.51 User Manual: SetPenWidths Method

SharpPlot.SetPenWidths Method

Set line-widths for use by upcoming data series.

Example

sp.SetPenWidths(new double[] {0.5,2});

Overloads

  • public void SetPenWidths(int lineWidth);
  • public void SetPenWidths(double lineWidth);
  • public void SetPenWidths(int[] lineWidths);
  • public void SetPenWidths(double[] lineWidths);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetPenWidths Method (Double[])

SharpPlot.SetPenWidths Method (Double[])

Set an array of line-widths for use by upcoming data series.

public void SetPenWidths(
    double[] lineWidths
);

See also ...

SharpPlot Members | SetPenWidths Method


SharpPlot 2.51 User Manual: SetPenWidths Method (Int32[])

SharpPlot.SetPenWidths Method (Int32[])

Use integer widths for all series.

public void SetPenWidths(
    int[] lineWidths
);

See also ...

SharpPlot Members | SetPenWidths Method


SharpPlot 2.51 User Manual: SetPenWidths Method (Double)

SharpPlot.SetPenWidths Method (Double)

Use a single line-width for all series.

public void SetPenWidths(
    double lineWidth
);

See also ...

SharpPlot Members | SetPenWidths Method


SharpPlot 2.51 User Manual: SetPenWidths Method (Int32)

SharpPlot.SetPenWidths Method (Int32)

Use a single integer line-width for all series.

public void SetPenWidths(
    int lineWidth
);

See also ...

SharpPlot Members | SetPenWidths Method


SharpPlot 2.51 User Manual: SetPieCenter Method

SharpPlot.SetPieCenter Method

Set Pie centre (absolute xy in points ) relative to the chart frame.

public void SetPieCenter(
    double xpos,
    double ypos
);

Example

sp.SetPieCenter(220,170);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetSelection Method

SharpPlot.SetSelection Method

Set Selection mask for data.

Example

sp.SetSelection(new bool[]{true,false,true,true});

Overloads

  • public void SetSelection(int[] mask);
  • public void SetSelection(bool[] mask);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetSelection Method (Boolean[])

SharpPlot.SetSelection Method (Boolean[])

Set Selection mask for data given a boolean array as a mask.

public void SetSelection(
    bool[] mask
);

See also ...

SharpPlot Members | SetSelection Method


SharpPlot 2.51 User Manual: SetSelection Method (Int32[])

SharpPlot.SetSelection Method (Int32[])

Set Selection mask for data to positive integer values.

public void SetSelection(
    int[] mask
);

See also ...

SharpPlot Members | SetSelection Method


SharpPlot 2.51 User Manual: SetSeriesNames Method

SharpPlot.SetSeriesNames Method

Assign a non-default name or names to the upcoming data series.

Example

sp.SetSeriesNames(new string[]{"Budget","Forecast"});

Overloads

  • public void SetSeriesNames(string newName);
  • public void SetSeriesNames(string[] newNames);

Description

This call will add the series name to the id tag in any web-formatted output. This makes it easy to write JavaScript which changes the elements as you mouse-over them or click on them (for example emphasising the border on mouse-enter).

It is also very helpful if your application is tracking hotspots using the Active Charts components, as you can output meaningful hotspot information to the console. For example:

Chart=Bar1, Series=Hats, Item=2, Type=Bar, Locator=186.9 52 216 193.2 0

Here the chart was named “Bar1” and the two series were named “Hats,Coats”. You could use the feedback from this structure to implement drill-down to get the detail of the ‘Hats’ series, second item.

See also ...

SharpPlot Members | SetChartName Method | HotspotInfo Struct | PageMap Class – Introduction


SharpPlot 2.51 User Manual: SetSeriesNames Method (String[])

SharpPlot.SetSeriesNames Method (String[])

Assign a list of names to the upcoming data series.

public void SetSeriesNames(
    string[] newNames
);

See also ...

SharpPlot Members | SetSeriesNames Method


SharpPlot 2.51 User Manual: SetSeriesNames Method (String)

SharpPlot.SetSeriesNames Method (String)

Assign a name to next series.

public void SetSeriesNames(
    string newName
);

See also ...

SharpPlot Members | SetSeriesNames Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method

SharpPlot.SetSubheadingFont Method

Set Subheading font given any of fontname, point-size, style, color.

Example

sp.SetSubheadingFont("Times,serif",16);

Overloads

  • public void SetSubheadingFont(string fontName);
  • public void SetSubheadingFont(double fontSize);
  • public void SetSubheadingFont(Color fontColor);
  • public void SetSubheadingFont(FontStyle fontStyle);
  • public void SetSubheadingFont(string fontName,double fontSize);
  • public void SetSubheadingFont(string fontName,Color fontColor);
  • public void SetSubheadingFont(double fontSize,Color fontColor);
  • public void SetSubheadingFont(string fontName,FontStyle fontStyle);
  • public void SetSubheadingFont(FontStyle fontStyle,Color fontColor);
  • public void SetSubheadingFont(string fontName,double fontSize,Color fontColor);
  • public void SetSubheadingFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetSubheadingFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetSubheadingFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetSubheadingFont Method (String,Double,FontStyle,Color)

SharpPlot.SetSubheadingFont Method (String,Double,FontStyle,Color)

Set Subheading font from fontname, point-size, style and color.

public void SetSubheadingFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (Double,Color)

SharpPlot.SetSubheadingFont Method (Double,Color)

Set Subheading font point-size and color.

public void SetSubheadingFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (String,Double,Color)

SharpPlot.SetSubheadingFont Method (String,Double,Color)

Set Subheading font name, point-size and color.

public void SetSubheadingFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (String,FontStyle,Color)

SharpPlot.SetSubheadingFont Method (String,FontStyle,Color)

Set Subheading font name, style and color.

public void SetSubheadingFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (String,Double,FontStyle)

SharpPlot.SetSubheadingFont Method (String,Double,FontStyle)

Set Subheading font name, point-size and style.

public void SetSubheadingFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (String)

SharpPlot.SetSubheadingFont Method (String)

Set Subheading font fontname only.

public void SetSubheadingFont(
    string fontName
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (Double)

SharpPlot.SetSubheadingFont Method (Double)

Set Subheading font point-size only.

public void SetSubheadingFont(
    double fontSize
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (Color)

SharpPlot.SetSubheadingFont Method (Color)

Set Subheading font Color only.

public void SetSubheadingFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (FontStyle)

SharpPlot.SetSubheadingFont Method (FontStyle)

Set Subheading font style only.

public void SetSubheadingFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (String,Double)

SharpPlot.SetSubheadingFont Method (String,Double)

Set Subheading font name and point-size.

public void SetSubheadingFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (String,FontStyle)

SharpPlot.SetSubheadingFont Method (String,FontStyle)

Set Subheading font name and style.

public void SetSubheadingFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (String,Color)

SharpPlot.SetSubheadingFont Method (String,Color)

Set Subheading font name and color.

public void SetSubheadingFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetSubheadingFont Method (FontStyle,Color)

SharpPlot.SetSubheadingFont Method (FontStyle,Color)

Set Subheading font style and color.

public void SetSubheadingFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetSubheadingFont Method


SharpPlot 2.51 User Manual: SetTablePosition Method

SharpPlot.SetTablePosition Method

Set Table position from x,y and optional width.

Example

sp.SetTablePosition(120,80,80);

Overloads

  • public void SetTablePosition(double xPosition,double yPosition);
  • public void SetTablePosition(double xPosition,double yPosition,double width);

See also ...

SharpPlot Members | TableStyle Property


SharpPlot 2.51 User Manual: SetTablePosition Method (Double,Double,Double)

SharpPlot.SetTablePosition Method (Double,Double,Double)

Set Table position from x,y and given width.

public void SetTablePosition(
    double xPosition,
    double yPosition,
    double width
);

See also ...

SharpPlot Members | SetTablePosition Method


SharpPlot 2.51 User Manual: SetTablePosition Method (Double,Double)

SharpPlot.SetTablePosition Method (Double,Double)

Set position, leaving width to default.

public void SetTablePosition(
    double xPosition,
    double yPosition
);

See also ...

SharpPlot Members | SetTablePosition Method


SharpPlot 2.51 User Manual: SetTowerFillStyles Method

SharpPlot.SetTowerFillStyles Method

Set Tower shadings (Top,Face,Edge) from any standard FillStyle.

Example

sp.SetTowerFillStyles(FillStyle.Saturate20,FillStyle.GradientTopRight,FillStyle.Solid);

Overloads

  • public void SetTowerFillStyles(FillStyle pattern);
  • public void SetTowerFillStyles(FillStyle topStyle,FillStyle faceStyle,FillStyle edgeStyle);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetTowerFillStyles Method (FillStyle,FillStyle,FillStyle)

SharpPlot.SetTowerFillStyles Method (FillStyle,FillStyle,FillStyle)

Tower ptns (top,face,edge) for Horizontal, Face, Edge.

public void SetTowerFillStyles(
    FillStyle topStyle,
    FillStyle faceStyle,
    FillStyle edgeStyle
);

See also ...

SharpPlot Members | SetTowerFillStyles Method


SharpPlot 2.51 User Manual: SetTowerFillStyles Method (FillStyle)

SharpPlot.SetTowerFillStyles Method (FillStyle)

All planes alike.

public void SetTowerFillStyles(
    FillStyle pattern
);

See also ...

SharpPlot Members | SetTowerFillStyles Method


SharpPlot 2.51 User Manual: SetTrellis Method

SharpPlot.SetTrellis Method

Creates a trellised layout given (cells down, cells across) or the total cell count.

Example

sp.SetTrellis(19); // Auto layout
sp.SetTrellis(3,4); // Grid

Overloads

  • public void SetTrellis(int cellCount);
  • public void SetTrellis(int down,int across);

This method carves up the available paper size into a rectangular collection of frames. The first chart to be drawn will use the first cell in the trellis, and calls to NewCell will move to the next available cell, working across the rows or snaking down the columns depending on the TrellisStyle setting.

If the requested total cell count does not fit nicely into the page shape, there will be vacant cells in the lower right corner.

See also ...

SharpPlot Members | TrellisStyle Property | DrawMultiple Method | NewCell Method


SharpPlot 2.51 User Manual: SetTrellis Method (Int32,Int32)

SharpPlot.SetTrellis Method (Int32,Int32)

Makes a trellis specification from a cell layout (rows,columns).

public void SetTrellis(
    int down,
    int across
);

See also ...

SharpPlot Members | SetTrellis Method


SharpPlot 2.51 User Manual: SetTrellis Method (Int32)

SharpPlot.SetTrellis Method (Int32)

Creates required number of cells in a default arrangement.

public void SetTrellis(
    int cellCount
);

See also ...

SharpPlot Members | SetTrellis Method


SharpPlot 2.51 User Manual: SetValueFont Method

SharpPlot.SetValueFont Method

Set Value label font given any of fontname, point-size, style, color.

Example

sp.SetValueFont("Arial",12,FontStyle.Bold,Color.Firebrick);

Overloads

  • public void SetValueFont(string fontName);
  • public void SetValueFont(double fontSize);
  • public void SetValueFont(Color fontColor);
  • public void SetValueFont(FontStyle fontStyle);
  • public void SetValueFont(string fontName,double fontSize);
  • public void SetValueFont(string fontName,Color fontColor);
  • public void SetValueFont(double fontSize,Color fontColor);
  • public void SetValueFont(string fontName,FontStyle fontStyle);
  • public void SetValueFont(FontStyle fontStyle,Color fontColor);
  • public void SetValueFont(string fontName,double fontSize,Color fontColor);
  • public void SetValueFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetValueFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetValueFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetValueFont Method (String,Double,FontStyle,Color)

SharpPlot.SetValueFont Method (String,Double,FontStyle,Color)

Set Value tag font from fontname, point-size, style and color.

public void SetValueFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (Double,Color)

SharpPlot.SetValueFont Method (Double,Color)

Set Value tag font point-size and color.

public void SetValueFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (String,Double,Color)

SharpPlot.SetValueFont Method (String,Double,Color)

Set Value tag font name, point-size and color.

public void SetValueFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (String,FontStyle,Color)

SharpPlot.SetValueFont Method (String,FontStyle,Color)

Set Value tag font name, style and color.

public void SetValueFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (String,Double,FontStyle)

SharpPlot.SetValueFont Method (String,Double,FontStyle)

Set Value tag font name, point-size and style.

public void SetValueFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (String)

SharpPlot.SetValueFont Method (String)

Set Value tag font fontname only.

public void SetValueFont(
    string fontName
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (Double)

SharpPlot.SetValueFont Method (Double)

Set Value tag font point-size only.

public void SetValueFont(
    double fontSize
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (Color)

SharpPlot.SetValueFont Method (Color)

Set Value tag font Color only.

public void SetValueFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (FontStyle)

SharpPlot.SetValueFont Method (FontStyle)

Set Value tag font style only.

public void SetValueFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (String,Double)

SharpPlot.SetValueFont Method (String,Double)

Set Value tag font name and point-size.

public void SetValueFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (String,FontStyle)

SharpPlot.SetValueFont Method (String,FontStyle)

Set Value tag font name and style.

public void SetValueFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (String,Color)

SharpPlot.SetValueFont Method (String,Color)

Set Value tag font name and color.

public void SetValueFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueFont Method (FontStyle,Color)

SharpPlot.SetValueFont Method (FontStyle,Color)

Set Value tag font style and color.

public void SetValueFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetValueFont Method


SharpPlot 2.51 User Manual: SetValueNudge Method

SharpPlot.SetValueNudge Method

Apply fine adjustment to value tags from displacements (right,up) in points.

public void SetValueNudge(
    double nudgeX,
    double nudgeY
);

Example

sp.SetValueNudge(0,6);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetValueTags Method

SharpPlot.SetValueTags Method

Set Value tags given a string (or numeric) array or a simple string.

Example

sp.SetValueTags(new string[]{"First","Second"});

Overloads

  • public void SetValueTags(string label);
  • public void SetValueTags(int[] values);
  • public void SetValueTags(string[] labels);
  • public void SetValueTags(double[] values);
  • public void SetValueTags(string[][] labels);

Notes

By default, setting the ValueTags style on any chart simply adds the formatted Y-values to each data-point. However you may choose to display some other value, for example in a chart of house prices, a scatterplot of floor-area against age of house could show the price at each data-point. This is often a good way to add an extra dimension to a simple 2-dimensional presentation.

See also ...

Formatting text with simple HTML tags | SharpPlot Members | ValueTagFormat Property


SharpPlot 2.51 User Manual: SetValueTags Method (String[])

SharpPlot.SetValueTags Method (String[])

Set Value tags from an array of strings.

public void SetValueTags(
    string[] labels
);

See also ...

SharpPlot Members | SetValueTags Method


SharpPlot 2.51 User Manual: SetValueTags Method (String)

SharpPlot.SetValueTags Method (String)

Set all Value tags to a simple string.

public void SetValueTags(
    string label
);

See also ...

SharpPlot Members | SetValueTags Method


SharpPlot 2.51 User Manual: SetValueTags Method (String[][])

SharpPlot.SetValueTags Method (String[][])

Set multiple rows of labels.

public void SetValueTags(
    string[][] labels
);

See also ...

SharpPlot Members | SetValueTags Method


SharpPlot 2.51 User Manual: SetValueTags Method (Int32[])

SharpPlot.SetValueTags Method (Int32[])

Format Value tags from an integer array.

public void SetValueTags(
    int[] values
);

See also ...

SharpPlot Members | SetValueTags Method


SharpPlot 2.51 User Manual: SetValueTags Method (Double[])

SharpPlot.SetValueTags Method (Double[])

Format Value tags from a numeric array.

public void SetValueTags(
    double[] values
);

See also ...

SharpPlot Members | SetValueTags Method


SharpPlot 2.51 User Manual: SetViewpoint Method

SharpPlot.SetViewpoint Method

Set 3D viewpoint given a set of roll,pitch,yaw values.

public void SetViewpoint(
    double roll,
    double pitch,
    double yaw
);

Example

sp.SetViewpoint(40,30,40);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetWallFillStyles Method

SharpPlot.SetWallFillStyles Method

Set 3D backplanes (Base,Face,Edge) from any standard FillStyle.

Example

sp.SetWallFillStyles(FillStyle.Saturate20,FillStyle.GradientTopRight,FillStyle.Solid);

Overloads

  • public void SetWallFillStyles(FillStyle pattern);
  • public void SetWallFillStyles(FillStyle topStyle,FillStyle faceStyle,FillStyle edgeStyle);


SharpPlot 2.51 User Manual: SetWallFillStyles Method (FillStyle,FillStyle,FillStyle)

SharpPlot.SetWallFillStyles Method (FillStyle,FillStyle,FillStyle)

Wall patterns (YZ,XZ,XY) for Horizontal, Face, Edge.

public void SetWallFillStyles(
    FillStyle topStyle,
    FillStyle faceStyle,
    FillStyle edgeStyle
);

See also ...

SharpPlot Members | SetWallFillStyles Method


SharpPlot 2.51 User Manual: SetWallFillStyles Method (FillStyle)

SharpPlot.SetWallFillStyles Method (FillStyle)

All planes alike.

public void SetWallFillStyles(
    FillStyle pattern
);

See also ...

SharpPlot Members | SetWallFillStyles Method


SharpPlot 2.51 User Manual: SetWeightings Method

SharpPlot.SetWeightings Method

Set Weights for modelfit.

Example

sp.SetWeightings(new int[] {1,0,1,2,1});

Overloads

  • public void SetWeightings(double value);
  • public void SetWeightings(int[] value);
  • public void SetWeightings(double[] value);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetWeightings Method (Double[])

SharpPlot.SetWeightings Method (Double[])

Set Weights for modelfit given a double vector.

public void SetWeightings(
    double[] value
);

See also ...

SharpPlot Members | SetWeightings Method


SharpPlot 2.51 User Manual: SetWeightings Method (Double)

SharpPlot.SetWeightings Method (Double)

Set Weights for modelfit to a single value.

public void SetWeightings(
    double value
);

See also ...

SharpPlot Members | SetWeightings Method


SharpPlot 2.51 User Manual: SetWeightings Method (Int32[])

SharpPlot.SetWeightings Method (Int32[])

Set Weights for modelfit to a integer array.

public void SetWeightings(
    int[] value
);

See also ...

SharpPlot Members | SetWeightings Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method

SharpPlot.SetXCaptionFont Method

Set X Caption font given any of fontname, point-size, style, color.

Example

sp.SetXCaptionFont("Verdana,Sans",15);

Overloads

  • public void SetXCaptionFont(string fontName);
  • public void SetXCaptionFont(double fontSize);
  • public void SetXCaptionFont(Color fontColor);
  • public void SetXCaptionFont(FontStyle fontStyle);
  • public void SetXCaptionFont(string fontName,double fontSize);
  • public void SetXCaptionFont(string fontName,Color fontColor);
  • public void SetXCaptionFont(double fontSize,Color fontColor);
  • public void SetXCaptionFont(string fontName,FontStyle fontStyle);
  • public void SetXCaptionFont(FontStyle fontStyle,Color fontColor);
  • public void SetXCaptionFont(string fontName,double fontSize,Color fontColor);
  • public void SetXCaptionFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetXCaptionFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetXCaptionFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetXCaptionFont Method (String,Double,FontStyle,Color)

SharpPlot.SetXCaptionFont Method (String,Double,FontStyle,Color)

Set X Caption font from fontname, point-size, style and color.

public void SetXCaptionFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (Double,Color)

SharpPlot.SetXCaptionFont Method (Double,Color)

Set X Caption font point-size and color.

public void SetXCaptionFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (String,Double,Color)

SharpPlot.SetXCaptionFont Method (String,Double,Color)

Set X Caption font name, point-size and color.

public void SetXCaptionFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (String,FontStyle,Color)

SharpPlot.SetXCaptionFont Method (String,FontStyle,Color)

Set X Caption font name, style and color.

public void SetXCaptionFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (String,Double,FontStyle)

SharpPlot.SetXCaptionFont Method (String,Double,FontStyle)

Set X Caption font name, point-size and style.

public void SetXCaptionFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (String)

SharpPlot.SetXCaptionFont Method (String)

Set X Caption font fontname only.

public void SetXCaptionFont(
    string fontName
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (Double)

SharpPlot.SetXCaptionFont Method (Double)

Set X Caption font point-size only.

public void SetXCaptionFont(
    double fontSize
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (Color)

SharpPlot.SetXCaptionFont Method (Color)

Set X Caption font Color only.

public void SetXCaptionFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (FontStyle)

SharpPlot.SetXCaptionFont Method (FontStyle)

Set X Caption font style only.

public void SetXCaptionFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (String,Double)

SharpPlot.SetXCaptionFont Method (String,Double)

Set X Caption font name and point-size.

public void SetXCaptionFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (String,FontStyle)

SharpPlot.SetXCaptionFont Method (String,FontStyle)

Set X Caption font name and style.

public void SetXCaptionFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (String,Color)

SharpPlot.SetXCaptionFont Method (String,Color)

Set X Caption font name and color.

public void SetXCaptionFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXCaptionFont Method (FontStyle,Color)

SharpPlot.SetXCaptionFont Method (FontStyle,Color)

Set X Caption font style and color.

public void SetXCaptionFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetXCaptionFont Method


SharpPlot 2.51 User Manual: SetXDataRange Method

SharpPlot.SetXDataRange Method

You can call any of the plotting routines with an array of arrays to have multiple series ranged and plotted at one call. However it is often more convenient to make several calls, one for each series. This method allows you to pass in all your x-axis data arrays in advance, and notes the extreme values for use when the first plot is drawn.

Example

sp.SetXDataRange(col_Data);

Overloads

  • public void SetXDataRange(double value);
  • public void SetXDataRange(int[] value);
  • public void SetXDataRange(double[] value);
  • public void SetXDataRange(int[][] valueset);
  • public void SetXDataRange(double[][] valueset);

All the other axis properties (range, tick-interval etc) continue to apply as normal.


SharpPlot 2.51 User Manual: SetXDataRange Method (Double[])

SharpPlot.SetXDataRange Method (Double[])

Set X data range given a double vector.

public void SetXDataRange(
    double[] value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetXDataRange Method


SharpPlot 2.51 User Manual: SetXDataRange Method (Double)

SharpPlot.SetXDataRange Method (Double)

Set X data range to a single value.

public void SetXDataRange(
    double value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetXDataRange Method


SharpPlot 2.51 User Manual: SetXDataRange Method (Int32[])

SharpPlot.SetXDataRange Method (Int32[])

Set X data range to the min and max of an integer array.

public void SetXDataRange(
    int[] value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetXDataRange Method


SharpPlot 2.51 User Manual: SetXDataRange Method (Double[][])

SharpPlot.SetXDataRange Method (Double[][])

Set X data range to range several numeric arrays.

public void SetXDataRange(
    double[][] valueset
);
valueset
[todo]

See also ...

SharpPlot Members | SetXDataRange Method


SharpPlot 2.51 User Manual: SetXDataRange Method (Int32[][])

SharpPlot.SetXDataRange Method (Int32[][])

Set X data range to range several integer arrays.

public void SetXDataRange(
    int[][] valueset
);
valueset
[todo]

See also ...

SharpPlot Members | SetXDataRange Method


SharpPlot 2.51 User Manual: SetXDatumLines Method

SharpPlot.SetXDatumLines Method

Set X datum line(s).

Example

sp.SetXDatumLines(new int[] {25,50,75});

Overloads

  • public void SetXDatumLines(double value);
  • public void SetXDatumLines(int[] value);
  • public void SetXDatumLines(double[] value);

Vertical datum lines can also be triggered automatically at tickmarks which exceed the XDatum Threshold.

See also ...

SharpPlot Members | SetDatumLineStyle Method | SetDatumLineTags Method | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetXDatumLines Method (Double[])

SharpPlot.SetXDatumLines Method (Double[])

Set X datum line(s) given a double vector.

public void SetXDatumLines(
    double[] value
);

See also ...

SharpPlot Members | SetXDatumLines Method


SharpPlot 2.51 User Manual: SetXDatumLines Method (Double)

SharpPlot.SetXDatumLines Method (Double)

Set X datum line(s) to a single value.

public void SetXDatumLines(
    double value
);

See also ...

SharpPlot Members | SetXDatumLines Method


SharpPlot 2.51 User Manual: SetXDatumLines Method (Int32[])

SharpPlot.SetXDatumLines Method (Int32[])

Set X datum line(s) to a integer array.

public void SetXDatumLines(
    int[] value
);

See also ...

SharpPlot Members | SetXDatumLines Method


SharpPlot 2.51 User Manual: SetXGridLines Method

SharpPlot.SetXGridLines Method

Set X gridline(s) at chosen values.

Example

sp.SetXGridLines(new int[] {5,10,17,18,19,20,21});

Overloads

  • public void SetXGridLines(double value);
  • public void SetXGridLines(int[] value);
  • public void SetXGridLines(double[] value);

Note that gridlines will be clipped at the axis range – they do not automatically extend the range for you.


SharpPlot 2.51 User Manual: SetXGridLines Method (Double[])

SharpPlot.SetXGridLines Method (Double[])

Set X gridline(s) given a double vector.

public void SetXGridLines(
    double[] value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetXGridLines Method


SharpPlot 2.51 User Manual: SetXGridLines Method (Double)

SharpPlot.SetXGridLines Method (Double)

Set X gridline(s) to a single value.

public void SetXGridLines(
    double value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetXGridLines Method


SharpPlot 2.51 User Manual: SetXGridLines Method (Int32[])

SharpPlot.SetXGridLines Method (Int32[])

Set X gridline(s) to a integer array.

public void SetXGridLines(
    int[] value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetXGridLines Method


SharpPlot 2.51 User Manual: SetXLabelFont Method

SharpPlot.SetXLabelFont Method

Set X label font given any of fontname, point-size, style, color.

Example

sp.SetXLabelFont("Arial",14,FontStyle.Bold,Color.Navy);

Overloads

  • public void SetXLabelFont(string fontName);
  • public void SetXLabelFont(double fontSize);
  • public void SetXLabelFont(Color fontColor);
  • public void SetXLabelFont(FontStyle fontStyle);
  • public void SetXLabelFont(string fontName,double fontSize);
  • public void SetXLabelFont(string fontName,Color fontColor);
  • public void SetXLabelFont(double fontSize,Color fontColor);
  • public void SetXLabelFont(string fontName,FontStyle fontStyle);
  • public void SetXLabelFont(FontStyle fontStyle,Color fontColor);
  • public void SetXLabelFont(string fontName,double fontSize,Color fontColor);
  • public void SetXLabelFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetXLabelFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetXLabelFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetXLabelFont Method (String,Double,FontStyle,Color)

SharpPlot.SetXLabelFont Method (String,Double,FontStyle,Color)

Set X label font from fontname, point-size, style and color.

public void SetXLabelFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (Double,Color)

SharpPlot.SetXLabelFont Method (Double,Color)

Set X label font point-size and color.

public void SetXLabelFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (String,Double,Color)

SharpPlot.SetXLabelFont Method (String,Double,Color)

Set X label font name, point-size and color.

public void SetXLabelFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (String,FontStyle,Color)

SharpPlot.SetXLabelFont Method (String,FontStyle,Color)

Set X label font name, style and color.

public void SetXLabelFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (String,Double,FontStyle)

SharpPlot.SetXLabelFont Method (String,Double,FontStyle)

Set X label font name, point-size and style.

public void SetXLabelFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (String)

SharpPlot.SetXLabelFont Method (String)

Set X label font fontname only.

public void SetXLabelFont(
    string fontName
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (Double)

SharpPlot.SetXLabelFont Method (Double)

Set X label font point-size only.

public void SetXLabelFont(
    double fontSize
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (Color)

SharpPlot.SetXLabelFont Method (Color)

Set X label font Color only.

public void SetXLabelFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (FontStyle)

SharpPlot.SetXLabelFont Method (FontStyle)

Set X label font style only.

public void SetXLabelFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (String,Double)

SharpPlot.SetXLabelFont Method (String,Double)

Set X label font name and point-size.

public void SetXLabelFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (String,FontStyle)

SharpPlot.SetXLabelFont Method (String,FontStyle)

Set X label font name and style.

public void SetXLabelFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (String,Color)

SharpPlot.SetXLabelFont Method (String,Color)

Set X label font name and color.

public void SetXLabelFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelFont Method (FontStyle,Color)

SharpPlot.SetXLabelFont Method (FontStyle,Color)

Set X label font style and color.

public void SetXLabelFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetXLabelFont Method


SharpPlot 2.51 User Manual: SetXLabelNudge Method

SharpPlot.SetXLabelNudge Method

Apply fine adjustment to X-axis labels from displacements (right,up) in points.

public void SetXLabelNudge(
    double nudgeX,
    double nudgeY
);

Example

// Move labels right and up to appear
// beside the tickmarks rather than below
 sp.SetXLabelNudge(6,4);

This could be used as a space-saver option, for example to move the labels rightward and upwards to reduce the requirement for a bottom margin, or just to ensure that the output charts conform to a particular house-style.


SharpPlot 2.51 User Manual: SetXLabels Method

SharpPlot.SetXLabels Method

Set X labels given a string array or a simple string. Arrays of numeric values are formatted using the current setting of the label format string. Dates (OLE format integers or YYYYMMDD composite values) will be formatted using the current XDateFormat if the XAxis style is set to Date at the point where this method is called.

Example

sp.SetXLabels(new string[]{"North","South"});

Overloads

  • public void SetXLabels(string label);
  • public void SetXLabels(int[] values);
  • public void SetXLabels(string[] labels);
  • public void SetXLabels(double[] values);
  • public void SetXLabels(string[][] labels);

If an array of arrays of strings is given, these are treated as the rows of a multi-line set of labels. It may be appropriate to use the Spanned style to have repeated elements merged across the axis.

See also ...

Formatting text with simple HTML tags | SharpPlot Members | XLabelFormat Property


SharpPlot 2.51 User Manual: SetXLabels Method (String[])

SharpPlot.SetXLabels Method (String[])

Set X labels from an array of strings.

public void SetXLabels(
    string[] labels
);

See also ...

SharpPlot Members | SetXLabels Method


SharpPlot 2.51 User Manual: SetXLabels Method (String)

SharpPlot.SetXLabels Method (String)

Set all X labels to a simple string.

public void SetXLabels(
    string label
);

See also ...

SharpPlot Members | SetXLabels Method


SharpPlot 2.51 User Manual: SetXLabels Method (String[][])

SharpPlot.SetXLabels Method (String[][])

Set multiple rows of labels.

public void SetXLabels(
    string[][] labels
);

See also ...

SharpPlot Members | SetXLabels Method


SharpPlot 2.51 User Manual: SetXLabels Method (Int32[])

SharpPlot.SetXLabels Method (Int32[])

Format X labels from an integer array.

public void SetXLabels(
    int[] values
);

See also ...

SharpPlot Members | SetXLabels Method


SharpPlot 2.51 User Manual: SetXLabels Method (Double[])

SharpPlot.SetXLabels Method (Double[])

Format X labels from a numeric array.

public void SetXLabels(
    double[] values
);

See also ...

SharpPlot Members | SetXLabels Method


SharpPlot 2.51 User Manual: SetXRange Method

SharpPlot.SetXRange Method

Set X axis range given one or two elements.

Example

sp.SetXRange(100); // Maximum
sp.SetXRange(500,1000); // Span

Overloads

  • public void SetXRange();
  • public void SetXRange(double max);
  • public void SetXRange(double min,double max);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetXRange Method (Double,Double)

SharpPlot.SetXRange Method (Double,Double)

Set X axis range minimum and maximum values.

public void SetXRange(
    double min,
    double max
);
min
[todo]
max
[todo]

See also ...

SharpPlot Members | SetXRange Method


SharpPlot 2.51 User Manual: SetXRange Method (Double)

SharpPlot.SetXRange Method (Double)

Set X axis range maximum value only.

public void SetXRange(
    double max
);
max
[todo]

See also ...

SharpPlot Members | SetXRange Method


SharpPlot 2.51 User Manual: SetXRange Method

SharpPlot.SetXRange Method

Reset X axis range to default.

public void SetXRange();

See also ...

SharpPlot Members | SetXRange Method


SharpPlot 2.51 User Manual: SetXTickLengths Method

SharpPlot.SetXTickLengths Method

Set the lengths of all X-tickmarks individually, as a percentage of standard, or as exact values in points if XTickStyle is Absolute.

Example

sp.SetXTickLengths(150); // Extend all ticks
sp.SetXTickLengths(new int[] {120,60,60,60}); // Cyclic pattern

sp.XTickStyle = XTickStyles.Absolute;
sp.SetXTickLengths(new int[] {12,4,4,4});  // Values in pts

Overloads

  • public void SetXTickLengths(double value);
  • public void SetXTickLengths(int[] value);
  • public void SetXTickLengths(double[] value);

See also ...

XDatumThreshold Property | XGridThreshold Property | XTickStyle Property


SharpPlot 2.51 User Manual: SetXTickLengths Method (Double[])

SharpPlot.SetXTickLengths Method (Double[])

Set X tick lengths given a double vector.

public void SetXTickLengths(
    double[] value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetXTickLengths Method


SharpPlot 2.51 User Manual: SetXTickLengths Method (Double)

SharpPlot.SetXTickLengths Method (Double)

Set X tick lengths to a single value.

public void SetXTickLengths(
    double value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetXTickLengths Method


SharpPlot 2.51 User Manual: SetXTickLengths Method (Int32[])

SharpPlot.SetXTickLengths Method (Int32[])

Set X tick lengths to a integer array.

public void SetXTickLengths(
    int[] value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetXTickLengths Method


SharpPlot 2.51 User Manual: SetXTickMarks Method

SharpPlot.SetXTickMarks Method

Set X tick marks given a tickmark specification.

Example

sp.SetXTickMarks(10); // Every 10
sp.SetXTickMarks(20,4); // Major,minor
sp.SetXTickMarks(new int[] {10,20,50,100}); // Exact placement

Overloads

  • public void SetXTickMarks(double majorInterval);
  • public void SetXTickMarks(int[] tickPlacement);
  • public void SetXTickMarks(double[] tickPlacement);
  • public void SetXTickMarks(double majorInterval,int minorTickCount);

The units of the major tick interval are normally just the units of the data, but there are some special cases when plotting time-related values. Axis styles which affect this calculation are:

  • Date – ticks are in days (as you would expect from the OLE date values) but part-days are fine
  • Annual – ticks are in whole years
  • Monthly – ticks are computed for you at month boundaries
  • Time – ticks are in hours (fractions of an hour are fine)
  • Duration – ticks are in data units, typically minutes or seconds

The same applies if you choose to give tickmarks exactly as an array, except that in the ‘monthly’ case you give the positions in days to match the OLE date values.

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetXTickMarks Method (Double)

SharpPlot.SetXTickMarks Method (Double)

Set X tick marks major tick interval.

public void SetXTickMarks(
    double majorInterval
);

See also ...

SharpPlot Members | SetXTickMarks Method


SharpPlot 2.51 User Manual: SetXTickMarks Method (Double,Int32)

SharpPlot.SetXTickMarks Method (Double,Int32)

Set X tick marks major interval and minor count.

public void SetXTickMarks(
    double majorInterval,
    int minorTickCount
);

See also ...

SharpPlot Members | SetXTickMarks Method


SharpPlot 2.51 User Manual: SetXTickMarks Method (Double[])

SharpPlot.SetXTickMarks Method (Double[])

Set X tick marks to exact positions (no minor ticks).

public void SetXTickMarks(
    double[] tickPlacement
);

See also ...

SharpPlot Members | SetXTickMarks Method


SharpPlot 2.51 User Manual: SetXTickMarks Method (Int32[])

SharpPlot.SetXTickMarks Method (Int32[])

Set X tick marks to integer positions (no minor ticks).

public void SetXTickMarks(
    int[] tickPlacement
);

See also ...

SharpPlot Members | SetXTickMarks Method


SharpPlot 2.51 User Manual: SetXZones Method

SharpPlot.SetXZones Method

Set X zone.

Example

sp.SetXZones(new Zone(40,60,Color.Green,FillStyle.Opacity30));

Overloads

  • public void SetXZones(Zone value);
  • public void SetXZones(Zone[] value);

See also ...

SharpPlot Members | Zone Struct


SharpPlot 2.51 User Manual: SetXZones Method (Zone[])

SharpPlot.SetXZones Method (Zone[])

Set X zone from an array of Zone definitions.

public void SetXZones(
    Zone[] value
);

See also ...

SharpPlot Members | SetXZones Method


SharpPlot 2.51 User Manual: SetXZones Method (Zone)

SharpPlot.SetXZones Method (Zone)

Set a single Zone definition.

public void SetXZones(
    Zone value
);

See also ...

SharpPlot Members | SetXZones Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method

SharpPlot.SetYCaptionFont Method

Set Y Caption font given any of fontname, point-size, style, color.

Example

sp.SetYCaptionFont("Arial,sans",14,Color.Goldenrod);

Overloads

  • public void SetYCaptionFont(string fontName);
  • public void SetYCaptionFont(double fontSize);
  • public void SetYCaptionFont(Color fontColor);
  • public void SetYCaptionFont(FontStyle fontStyle);
  • public void SetYCaptionFont(string fontName,double fontSize);
  • public void SetYCaptionFont(string fontName,Color fontColor);
  • public void SetYCaptionFont(double fontSize,Color fontColor);
  • public void SetYCaptionFont(string fontName,FontStyle fontStyle);
  • public void SetYCaptionFont(FontStyle fontStyle,Color fontColor);
  • public void SetYCaptionFont(string fontName,double fontSize,Color fontColor);
  • public void SetYCaptionFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetYCaptionFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetYCaptionFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetYCaptionFont Method (String,Double,FontStyle,Color)

SharpPlot.SetYCaptionFont Method (String,Double,FontStyle,Color)

Set Y Caption font from fontname, point-size, style and color.

public void SetYCaptionFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (Double,Color)

SharpPlot.SetYCaptionFont Method (Double,Color)

Set Y Caption font point-size and color.

public void SetYCaptionFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (String,Double,Color)

SharpPlot.SetYCaptionFont Method (String,Double,Color)

Set Y Caption font name, point-size and color.

public void SetYCaptionFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (String,FontStyle,Color)

SharpPlot.SetYCaptionFont Method (String,FontStyle,Color)

Set Y Caption font name, style and color.

public void SetYCaptionFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (String,Double,FontStyle)

SharpPlot.SetYCaptionFont Method (String,Double,FontStyle)

Set Y Caption font name, point-size and style.

public void SetYCaptionFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (String)

SharpPlot.SetYCaptionFont Method (String)

Set Y Caption font fontname only.

public void SetYCaptionFont(
    string fontName
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (Double)

SharpPlot.SetYCaptionFont Method (Double)

Set Y Caption font point-size only.

public void SetYCaptionFont(
    double fontSize
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (Color)

SharpPlot.SetYCaptionFont Method (Color)

Set Y Caption font Color only.

public void SetYCaptionFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (FontStyle)

SharpPlot.SetYCaptionFont Method (FontStyle)

Set Y Caption font style only.

public void SetYCaptionFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (String,Double)

SharpPlot.SetYCaptionFont Method (String,Double)

Set Y Caption font name and point-size.

public void SetYCaptionFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (String,FontStyle)

SharpPlot.SetYCaptionFont Method (String,FontStyle)

Set Y Caption font name and style.

public void SetYCaptionFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (String,Color)

SharpPlot.SetYCaptionFont Method (String,Color)

Set Y Caption font name and color.

public void SetYCaptionFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYCaptionFont Method (FontStyle,Color)

SharpPlot.SetYCaptionFont Method (FontStyle,Color)

Set Y Caption font style and color.

public void SetYCaptionFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetYCaptionFont Method


SharpPlot 2.51 User Manual: SetYDataRange Method

SharpPlot.SetYDataRange Method

You can call any of the plotting routines with an array of arrays to have multiple series ranged and plotted at one call. However it is often more convenient to make several calls, one for each series. This method allows you to pass in all your y-axis data arrays in advance, and notes the extreme values for use when the first plot is drawn.

Example

sp.SetYDataRange(col_Yield);

Overloads

  • public void SetYDataRange(double value);
  • public void SetYDataRange(int[] value);
  • public void SetYDataRange(double[] value);
  • public void SetYDataRange(int[][] valueset);
  • public void SetYDataRange(double[][] valueset);

All the other axis properties (range, tick-interval etc) continue to apply as normal.

See also ...

SetXDataRange Method


SharpPlot 2.51 User Manual: SetYDataRange Method (Double[])

SharpPlot.SetYDataRange Method (Double[])

Set Y data range given a double vector.

public void SetYDataRange(
    double[] value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetYDataRange Method


SharpPlot 2.51 User Manual: SetYDataRange Method (Double)

SharpPlot.SetYDataRange Method (Double)

Set Y data range to a single value.

public void SetYDataRange(
    double value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetYDataRange Method


SharpPlot 2.51 User Manual: SetYDataRange Method (Int32[])

SharpPlot.SetYDataRange Method (Int32[])

Set Y data range to the min and max of an integer array.

public void SetYDataRange(
    int[] value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetYDataRange Method


SharpPlot 2.51 User Manual: SetYDataRange Method (Double[][])

SharpPlot.SetYDataRange Method (Double[][])

Set Y data range to range several numeric arrays.

public void SetYDataRange(
    double[][] valueset
);
valueset
[todo]

See also ...

SharpPlot Members | SetYDataRange Method


SharpPlot 2.51 User Manual: SetYDataRange Method (Int32[][])

SharpPlot.SetYDataRange Method (Int32[][])

Set Y data range to range several integer arrays.

public void SetYDataRange(
    int[][] valueset
);
valueset
[todo]

See also ...

SharpPlot Members | SetYDataRange Method


SharpPlot 2.51 User Manual: SetYDatumLines Method

SharpPlot.SetYDatumLines Method

Set Y datum line(s).

Example

sp.SetYDatumLines(new int[] {50,75,100});

Overloads

  • public void SetYDatumLines(double value);
  • public void SetYDatumLines(int[] value);
  • public void SetYDatumLines(double[] value);

Horizontal datum lines can also be triggered automatically at tickmarks which exceed the YDatum Threshold.

See also ...

SharpPlot Members | SetDatumLineStyle Method | SetDatumLineTags Method | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetYDatumLines Method (Double[])

SharpPlot.SetYDatumLines Method (Double[])

Set Y datum line(s) given a double vector.

public void SetYDatumLines(
    double[] value
);

See also ...

SharpPlot Members | SetYDatumLines Method


SharpPlot 2.51 User Manual: SetYDatumLines Method (Double)

SharpPlot.SetYDatumLines Method (Double)

Set Y datum line(s) to a single value.

public void SetYDatumLines(
    double value
);

See also ...

SharpPlot Members | SetYDatumLines Method


SharpPlot 2.51 User Manual: SetYDatumLines Method (Int32[])

SharpPlot.SetYDatumLines Method (Int32[])

Set Y datum line(s) to a integer array.

public void SetYDatumLines(
    int[] value
);

See also ...

SharpPlot Members | SetYDatumLines Method


SharpPlot 2.51 User Manual: SetYGridLines Method

SharpPlot.SetYGridLines Method

Set Y gridline(s) at chosen values.

Example

sp.SetYGridLines(new int[] {0,4,16,19,22,25});

Overloads

  • public void SetYGridLines(double value);
  • public void SetYGridLines(int[] value);
  • public void SetYGridLines(double[] value);

Note that gridlines will be clipped at the axis range – they do not automatically extend the range for you.


SharpPlot 2.51 User Manual: SetYGridLines Method (Double[])

SharpPlot.SetYGridLines Method (Double[])

Set Y gridline(s) given a double vector.

public void SetYGridLines(
    double[] value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetYGridLines Method


SharpPlot 2.51 User Manual: SetYGridLines Method (Double)

SharpPlot.SetYGridLines Method (Double)

Set Y gridline(s) to a single value.

public void SetYGridLines(
    double value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetYGridLines Method


SharpPlot 2.51 User Manual: SetYGridLines Method (Int32[])

SharpPlot.SetYGridLines Method (Int32[])

Set Y gridline(s) to a integer array.

public void SetYGridLines(
    int[] value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetYGridLines Method


SharpPlot 2.51 User Manual: SetYLabelFont Method

SharpPlot.SetYLabelFont Method

Set Y label font given any of fontname, point-size, style, color.

Example

sp.SetYLabelFont("Arial,sans",11.5,FontStyle.Bold);

Overloads

  • public void SetYLabelFont(string fontName);
  • public void SetYLabelFont(double fontSize);
  • public void SetYLabelFont(Color fontColor);
  • public void SetYLabelFont(FontStyle fontStyle);
  • public void SetYLabelFont(string fontName,double fontSize);
  • public void SetYLabelFont(string fontName,Color fontColor);
  • public void SetYLabelFont(double fontSize,Color fontColor);
  • public void SetYLabelFont(string fontName,FontStyle fontStyle);
  • public void SetYLabelFont(FontStyle fontStyle,Color fontColor);
  • public void SetYLabelFont(string fontName,double fontSize,Color fontColor);
  • public void SetYLabelFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetYLabelFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetYLabelFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetYLabelFont Method (String,Double,FontStyle,Color)

SharpPlot.SetYLabelFont Method (String,Double,FontStyle,Color)

Set Y label font from fontname, point-size, style and color.

public void SetYLabelFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (Double,Color)

SharpPlot.SetYLabelFont Method (Double,Color)

Set Y label font point-size and color.

public void SetYLabelFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (String,Double,Color)

SharpPlot.SetYLabelFont Method (String,Double,Color)

Set Y label font name, point-size and color.

public void SetYLabelFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (String,FontStyle,Color)

SharpPlot.SetYLabelFont Method (String,FontStyle,Color)

Set Y label font name, style and color.

public void SetYLabelFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (String,Double,FontStyle)

SharpPlot.SetYLabelFont Method (String,Double,FontStyle)

Set Y label font name, point-size and style.

public void SetYLabelFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (String)

SharpPlot.SetYLabelFont Method (String)

Set Y label font fontname only.

public void SetYLabelFont(
    string fontName
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (Double)

SharpPlot.SetYLabelFont Method (Double)

Set Y label font point-size only.

public void SetYLabelFont(
    double fontSize
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (Color)

SharpPlot.SetYLabelFont Method (Color)

Set Y label font Color only.

public void SetYLabelFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (FontStyle)

SharpPlot.SetYLabelFont Method (FontStyle)

Set Y label font style only.

public void SetYLabelFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (String,Double)

SharpPlot.SetYLabelFont Method (String,Double)

Set Y label font name and point-size.

public void SetYLabelFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (String,FontStyle)

SharpPlot.SetYLabelFont Method (String,FontStyle)

Set Y label font name and style.

public void SetYLabelFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (String,Color)

SharpPlot.SetYLabelFont Method (String,Color)

Set Y label font name and color.

public void SetYLabelFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelFont Method (FontStyle,Color)

SharpPlot.SetYLabelFont Method (FontStyle,Color)

Set Y label font style and color.

public void SetYLabelFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetYLabelFont Method


SharpPlot 2.51 User Manual: SetYLabelNudge Method

SharpPlot.SetYLabelNudge Method

Apply fine adjustment to Y-axis labels from displacements (right,up) in points.

public void SetYLabelNudge(
    double nudgeX,
    double nudgeY
);

Example

// Move labels right and up to appear
// above the Y-axis tickmarks
 sp.SetYLabelNudge(4,4);

This could be used as a space-saver option, for example to move the labels upwards and inwards to reduce the requirement for a left margin, or just to ensure that the output charts conform to a particular house-style.


SharpPlot 2.51 User Manual: SetYLabels Method

SharpPlot.SetYLabels Method

Set Y labels given a string array or a simple string or an array of numbers. Numbers are formatted using the current label format string or wrapped into the available space in the left margin if no formatter is given.

Dates (OLE format integers or YYYYMMDD composite values) will be formatted using the current YDateFormat if the YAxis style is set to Date at the point where this method is called.

Example

sp.SetYLabels(new string[]{"Nuts","Bolts","Washers"});

Overloads

  • public void SetYLabels(string label);
  • public void SetYLabels(int[] values);
  • public void SetYLabels(string[] labels);
  • public void SetYLabels(double[] values);
  • public void SetYLabels(string[][] labels);

If an array of arrays of strings is given, these are treated as the rows of a multi-line set of labels.

See also ...

Formatting text with simple HTML tags | SharpPlot Members | YLabelFormat Property


SharpPlot 2.51 User Manual: SetYLabels Method (String[])

SharpPlot.SetYLabels Method (String[])

Set Y labels from an array of strings.

public void SetYLabels(
    string[] labels
);

See also ...

SharpPlot Members | SetYLabels Method


SharpPlot 2.51 User Manual: SetYLabels Method (String)

SharpPlot.SetYLabels Method (String)

Set all Y labels to a simple string.

public void SetYLabels(
    string label
);

See also ...

SharpPlot Members | SetYLabels Method


SharpPlot 2.51 User Manual: SetYLabels Method (String[][])

SharpPlot.SetYLabels Method (String[][])

Set multiple rows of labels.

public void SetYLabels(
    string[][] labels
);

See also ...

SharpPlot Members | SetYLabels Method


SharpPlot 2.51 User Manual: SetYLabels Method (Int32[])

SharpPlot.SetYLabels Method (Int32[])

Format Y labels from an integer array.

public void SetYLabels(
    int[] values
);

See also ...

SharpPlot Members | SetYLabels Method


SharpPlot 2.51 User Manual: SetYLabels Method (Double[])

SharpPlot.SetYLabels Method (Double[])

Format Y labels from a numeric array.

public void SetYLabels(
    double[] values
);

See also ...

SharpPlot Members | SetYLabels Method


SharpPlot 2.51 User Manual: SetYRange Method

SharpPlot.SetYRange Method

Set Y axis range given one or two elements.

Example

sp.SetYRange(1000); // Maximum
sp.SetYRange(-20,20); // Span
sp.SetYRange(); // Return to unset state

Overloads

  • public void SetYRange();
  • public void SetYRange(double max);
  • public void SetYRange(double min,double max);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetYRange Method (Double,Double)

SharpPlot.SetYRange Method (Double,Double)

Set Y axis range minimum and maximum values.

public void SetYRange(
    double min,
    double max
);
min
[todo]
max
[todo]

See also ...

SharpPlot Members | SetYRange Method


SharpPlot 2.51 User Manual: SetYRange Method (Double)

SharpPlot.SetYRange Method (Double)

Set Y axis range maximum value only.

public void SetYRange(
    double max
);
max
[todo]

See also ...

SharpPlot Members | SetYRange Method


SharpPlot 2.51 User Manual: SetYRange Method

SharpPlot.SetYRange Method

Reset Y axis range to default.

public void SetYRange();

See also ...

SharpPlot Members | SetYRange Method


SharpPlot 2.51 User Manual: SetYTickLengths Method

SharpPlot.SetYTickLengths Method

Set the lengths of all Y-tickmarks individually, as a percentage of standard, or as exact values in points if YTickStyle is Absolute.

Example

sp.SetYTickLengths(120); // Extend all ticks
sp.SetYTickLengths(new int[] {150,80,80}); // Cyclic pattern

sp.YTickStyle = YTickStyles.Absolute;
sp.SetYTickLengths(new int[] {8,2,4,2});  // Values in pts

Overloads

  • public void SetYTickLengths(double value);
  • public void SetYTickLengths(int[] value);
  • public void SetYTickLengths(double[] value);

See also ...

YDatumThreshold Property | YGridThreshold Property | YTickStyle Property


SharpPlot 2.51 User Manual: SetYTickLengths Method (Double[])

SharpPlot.SetYTickLengths Method (Double[])

Set Y-tick lengths given a double vector.

public void SetYTickLengths(
    double[] value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetYTickLengths Method


SharpPlot 2.51 User Manual: SetYTickLengths Method (Double)

SharpPlot.SetYTickLengths Method (Double)

Set Y-tick lengths to a single value.

public void SetYTickLengths(
    double value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetYTickLengths Method


SharpPlot 2.51 User Manual: SetYTickLengths Method (Int32[])

SharpPlot.SetYTickLengths Method (Int32[])

Set Y-tick lengths to a integer array.

public void SetYTickLengths(
    int[] value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetYTickLengths Method


SharpPlot 2.51 User Manual: SetYTickMarks Method

SharpPlot.SetYTickMarks Method

Set Y tick marks given a tickmark specification.

Example

sp.SetYTickMarks(100); // Every 100
sp.SetYTickMarks(AE.Join(50,1)); // Major,minor
sp.SetYTickMarks(new int[] {0,10,20,50,100}); // Exact placement

Overloads

  • public void SetYTickMarks(double majorInterval);
  • public void SetYTickMarks(int[] tickPlacement);
  • public void SetYTickMarks(double[] tickPlacement);
  • public void SetYTickMarks(double majorInterval,int minorTickCount);

The units of the major tick interval are normally just the units of the data, but there are some special cases when plotting time-related values. Axis styles which affect this calculation are:

  • Time – ticks are in hours (fractions of an hour are fine)
  • Duration – ticks are in data units, typically minutes or seconds

The same applies if you choose to give tickmarks exactly as an array.

See also ...

SharpPlot Members | YAxisStyle Property


SharpPlot 2.51 User Manual: SetYTickMarks Method (Double)

SharpPlot.SetYTickMarks Method (Double)

Set Y tick marks major tick interval.

public void SetYTickMarks(
    double majorInterval
);

See also ...

SharpPlot Members | SetYTickMarks Method


SharpPlot 2.51 User Manual: SetYTickMarks Method (Double,Int32)

SharpPlot.SetYTickMarks Method (Double,Int32)

Set Y tick marks major interval and minor count.

public void SetYTickMarks(
    double majorInterval,
    int minorTickCount
);

See also ...

SharpPlot Members | SetYTickMarks Method


SharpPlot 2.51 User Manual: SetYTickMarks Method (Double[])

SharpPlot.SetYTickMarks Method (Double[])

Set Y tick marks to exact positions (no minor ticks).

public void SetYTickMarks(
    double[] tickPlacement
);

See also ...

SharpPlot Members | SetYTickMarks Method


SharpPlot 2.51 User Manual: SetYTickMarks Method (Int32[])

SharpPlot.SetYTickMarks Method (Int32[])

Set Y tick marks to integer positions (no minor ticks).

public void SetYTickMarks(
    int[] tickPlacement
);

See also ...

SharpPlot Members | SetYTickMarks Method


SharpPlot 2.51 User Manual: SetYZones Method

SharpPlot.SetYZones Method

Set Y zone.

Example

sp.SetYZones(new Zone(40,60,Color.Orange,FillStyle.GradientTop));

Overloads

  • public void SetYZones(Zone value);
  • public void SetYZones(Zone[] value);

See also ...

SharpPlot Members | Zone Struct


SharpPlot 2.51 User Manual: SetYZones Method (Zone[])

SharpPlot.SetYZones Method (Zone[])

Set Y zone from an array of Zone definitions.

public void SetYZones(
    Zone[] value
);

See also ...

SharpPlot Members | SetYZones Method


SharpPlot 2.51 User Manual: SetYZones Method (Zone)

SharpPlot.SetYZones Method (Zone)

Set a single Zone definition.

public void SetYZones(
    Zone value
);

See also ...

SharpPlot Members | SetYZones Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method

SharpPlot.SetZCaptionFont Method

Set Z Caption font given any of fontname, point-size, style, color.

Example

sp.SetZCaptionFont("Times",10);

Overloads

  • public void SetZCaptionFont(string fontName);
  • public void SetZCaptionFont(double fontSize);
  • public void SetZCaptionFont(Color fontColor);
  • public void SetZCaptionFont(FontStyle fontStyle);
  • public void SetZCaptionFont(string fontName,double fontSize);
  • public void SetZCaptionFont(string fontName,Color fontColor);
  • public void SetZCaptionFont(double fontSize,Color fontColor);
  • public void SetZCaptionFont(string fontName,FontStyle fontStyle);
  • public void SetZCaptionFont(FontStyle fontStyle,Color fontColor);
  • public void SetZCaptionFont(string fontName,double fontSize,Color fontColor);
  • public void SetZCaptionFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetZCaptionFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetZCaptionFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetZCaptionFont Method (String,Double,FontStyle,Color)

SharpPlot.SetZCaptionFont Method (String,Double,FontStyle,Color)

Set Z Caption font from fontname, point-size, style and color.

public void SetZCaptionFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (Double,Color)

SharpPlot.SetZCaptionFont Method (Double,Color)

Set Z Caption font point-size and color.

public void SetZCaptionFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (String,Double,Color)

SharpPlot.SetZCaptionFont Method (String,Double,Color)

Set Z Caption font name, point-size and color.

public void SetZCaptionFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (String,FontStyle,Color)

SharpPlot.SetZCaptionFont Method (String,FontStyle,Color)

Set Z Caption font name, style and color.

public void SetZCaptionFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (String,Double,FontStyle)

SharpPlot.SetZCaptionFont Method (String,Double,FontStyle)

Set Z Caption font name, point-size and style.

public void SetZCaptionFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (String)

SharpPlot.SetZCaptionFont Method (String)

Set Z Caption font fontname only.

public void SetZCaptionFont(
    string fontName
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (Double)

SharpPlot.SetZCaptionFont Method (Double)

Set Z Caption font point-size only.

public void SetZCaptionFont(
    double fontSize
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (Color)

SharpPlot.SetZCaptionFont Method (Color)

Set Z Caption font Color only.

public void SetZCaptionFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (FontStyle)

SharpPlot.SetZCaptionFont Method (FontStyle)

Set Z Caption font style only.

public void SetZCaptionFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (String,Double)

SharpPlot.SetZCaptionFont Method (String,Double)

Set Z Caption font name and point-size.

public void SetZCaptionFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (String,FontStyle)

SharpPlot.SetZCaptionFont Method (String,FontStyle)

Set Z Caption font name and style.

public void SetZCaptionFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (String,Color)

SharpPlot.SetZCaptionFont Method (String,Color)

Set Z Caption font name and color.

public void SetZCaptionFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZCaptionFont Method (FontStyle,Color)

SharpPlot.SetZCaptionFont Method (FontStyle,Color)

Set Z Caption font style and color.

public void SetZCaptionFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetZCaptionFont Method


SharpPlot 2.51 User Manual: SetZDataRange Method

SharpPlot.SetZDataRange Method

You can call any of the plotting routines with an array of arrays to have multiple series ranged and plotted at one call. However it is often more convenient to make several calls, one for each series. This method allows you to pass in all your z-axis data arrays in advance, and notes the extreme values for use when the first plot is drawn.

Example

sp.SetZDataRange(col_Yield);

Overloads

  • public void SetZDataRange(double value);
  • public void SetZDataRange(int[] value);
  • public void SetZDataRange(double[] value);
  • public void SetZDataRange(int[][] valueset);
  • public void SetZDataRange(double[][] valueset);

All the other axis properties (range, tick-interval etc) continue to apply as normal.


SharpPlot 2.51 User Manual: SetZDataRange Method (Double[])

SharpPlot.SetZDataRange Method (Double[])

Set Z data range given a double vector.

public void SetZDataRange(
    double[] value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetZDataRange Method


SharpPlot 2.51 User Manual: SetZDataRange Method (Double)

SharpPlot.SetZDataRange Method (Double)

Set Z data range to a single value.

public void SetZDataRange(
    double value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetZDataRange Method


SharpPlot 2.51 User Manual: SetZDataRange Method (Int32[])

SharpPlot.SetZDataRange Method (Int32[])

Set Z data range to the min and max of an integer array.

public void SetZDataRange(
    int[] value
);
value
Data to be checked for smallest and largest values.

See also ...

SharpPlot Members | SetZDataRange Method


SharpPlot 2.51 User Manual: SetZDataRange Method (Double[][])

SharpPlot.SetZDataRange Method (Double[][])

Set Z data range to range several numeric arrays.

public void SetZDataRange(
    double[][] valueset
);
valueset
[todo]

See also ...

SharpPlot Members | SetZDataRange Method


SharpPlot 2.51 User Manual: SetZDataRange Method (Int32[][])

SharpPlot.SetZDataRange Method (Int32[][])

Set Z data range to range several integer arrays.

public void SetZDataRange(
    int[][] valueset
);
valueset
[todo]

See also ...

SharpPlot Members | SetZDataRange Method


SharpPlot 2.51 User Manual: SetZDatumLines Method

SharpPlot.SetZDatumLines Method

Set Z-axis datum line(s).

Example

sp.SetZDatumLines(new int[] {50,100});  // Significant contours
sp.SetDatumLineTags("Low,High");        // Labels for them

Overloads

  • public void SetZDatumLines();
  • public void SetZDatumLines(double value);
  • public void SetZDatumLines(int[] value);
  • public void SetZDatumLines(double[] value);

These will be drawn around the walls of the 3D charts (Cloud, Tower etc) and as extra contours in 2D contour plots. If contours are drawn on a fitted 3D surface, the datum lines will also be drawn across the surface.

See also ...

SetDatumLineTags Method | SetDatumTagFont Method


SharpPlot 2.51 User Manual: SetZDatumLines Method (Double[])

SharpPlot.SetZDatumLines Method (Double[])

Set Z datum line(s) given a double vector.

public void SetZDatumLines(
    double[] value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetZDatumLines Method


SharpPlot 2.51 User Manual: SetZDatumLines Method (Double)

SharpPlot.SetZDatumLines Method (Double)

Set Z datum line(s) to a single value.

public void SetZDatumLines(
    double value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetZDatumLines Method


SharpPlot 2.51 User Manual: SetZDatumLines Method (Int32[])

SharpPlot.SetZDatumLines Method (Int32[])

Set Z datum line(s) to a integer array.

public void SetZDatumLines(
    int[] value
);
value
Tick lengths as a percentage of default or exact length in points.

See also ...

SharpPlot Members | SetZDatumLines Method


SharpPlot 2.51 User Manual: SetZDatumLines Method

SharpPlot.SetZDatumLines Method

Reset Z datum line(s) to default.

public void SetZDatumLines();

See also ...

SharpPlot Members | SetZDatumLines Method


SharpPlot 2.51 User Manual: SetZLabelFont Method

SharpPlot.SetZLabelFont Method

Set Z label font given any of fontname, point-size, style, color.

Example

sp.SetZLabelFont("Arial,sans",9.5,Color.Navy);

Overloads

  • public void SetZLabelFont(string fontName);
  • public void SetZLabelFont(double fontSize);
  • public void SetZLabelFont(Color fontColor);
  • public void SetZLabelFont(FontStyle fontStyle);
  • public void SetZLabelFont(string fontName,double fontSize);
  • public void SetZLabelFont(string fontName,Color fontColor);
  • public void SetZLabelFont(double fontSize,Color fontColor);
  • public void SetZLabelFont(string fontName,FontStyle fontStyle);
  • public void SetZLabelFont(FontStyle fontStyle,Color fontColor);
  • public void SetZLabelFont(string fontName,double fontSize,Color fontColor);
  • public void SetZLabelFont(string fontName,FontStyle fontStyle,Color fontColor);
  • public void SetZLabelFont(string fontName,double fontSize,FontStyle fontStyle);
  • public void SetZLabelFont(string fontName,double fontSize,FontStyle fontStyle,Color fontColor);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetZLabelFont Method (String,Double,FontStyle,Color)

SharpPlot.SetZLabelFont Method (String,Double,FontStyle,Color)

Set Z label font from fontname, point-size, style and color.

public void SetZLabelFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (Double,Color)

SharpPlot.SetZLabelFont Method (Double,Color)

Set Z label font point-size and color.

public void SetZLabelFont(
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (String,Double,Color)

SharpPlot.SetZLabelFont Method (String,Double,Color)

Set Z label font name, point-size and color.

public void SetZLabelFont(
    string fontName,
    double fontSize,
    Color fontColor
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (String,FontStyle,Color)

SharpPlot.SetZLabelFont Method (String,FontStyle,Color)

Set Z label font name, style and color.

public void SetZLabelFont(
    string fontName,
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (String,Double,FontStyle)

SharpPlot.SetZLabelFont Method (String,Double,FontStyle)

Set Z label font name, point-size and style.

public void SetZLabelFont(
    string fontName,
    double fontSize,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (String)

SharpPlot.SetZLabelFont Method (String)

Set Z label font fontname only.

public void SetZLabelFont(
    string fontName
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (Double)

SharpPlot.SetZLabelFont Method (Double)

Set Z label font point-size only.

public void SetZLabelFont(
    double fontSize
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (Color)

SharpPlot.SetZLabelFont Method (Color)

Set Z label font Color only.

public void SetZLabelFont(
    Color fontColor
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (FontStyle)

SharpPlot.SetZLabelFont Method (FontStyle)

Set Z label font style only.

public void SetZLabelFont(
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (String,Double)

SharpPlot.SetZLabelFont Method (String,Double)

Set Z label font name and point-size.

public void SetZLabelFont(
    string fontName,
    double fontSize
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (String,FontStyle)

SharpPlot.SetZLabelFont Method (String,FontStyle)

Set Z label font name and style.

public void SetZLabelFont(
    string fontName,
    FontStyle fontStyle
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (String,Color)

SharpPlot.SetZLabelFont Method (String,Color)

Set Z label font name and color.

public void SetZLabelFont(
    string fontName,
    Color fontColor
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabelFont Method (FontStyle,Color)

SharpPlot.SetZLabelFont Method (FontStyle,Color)

Set Z label font style and color.

public void SetZLabelFont(
    FontStyle fontStyle,
    Color fontColor
);

See also ...

SharpPlot Members | SetZLabelFont Method


SharpPlot 2.51 User Manual: SetZLabels Method

SharpPlot.SetZLabels Method

Set text items for each z-tickmark.

public void SetZLabels(
    string[] labels
);

Example

sp.SetZLabels(new string[]{"One","Two","Three"});

Note that the Z-axis does not support multi-line labels.

  • public void SetZLabels(string item);
  • public void SetZLabels(string[] value);
  • public void SetZLabels(string item);
  • public void SetZLabels(string[] value);
  • public void SetZLabels(string item);
  • public void SetZLabels(string[] value);

See also ...

Formatting text with simple HTML tags | SharpPlot Members


SharpPlot 2.51 User Manual: SetZLabels Method (String[])

SharpPlot.SetZLabels Method (String[])

Set Z labels from an array of strings.

public void SetZLabels(
    string[] value
);

See also ...

SharpPlot Members | SetZLabels Method


SharpPlot 2.51 User Manual: SetZLabels Method (String)

SharpPlot.SetZLabels Method (String)

Use first item only.

public void SetZLabels(
    string item
);

See also ...

SharpPlot Members | SetZLabels Method


SharpPlot 2.51 User Manual: SetZRange Method

SharpPlot.SetZRange Method

Set Z axis range given one or two elements.

Example

sp.SetZRange(200);

Overloads

  • public void SetZRange();
  • public void SetZRange(double max);
  • public void SetZRange(double min,double max);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetZRange Method (Double,Double)

SharpPlot.SetZRange Method (Double,Double)

Set Z axis range minimum and maximum values.

public void SetZRange(
    double min,
    double max
);
min
[todo]
max
[todo]

See also ...

SharpPlot Members | SetZRange Method


SharpPlot 2.51 User Manual: SetZRange Method (Double)

SharpPlot.SetZRange Method (Double)

Set Z axis range maximum value only.

public void SetZRange(
    double max
);
max
[todo]

See also ...

SharpPlot Members | SetZRange Method


SharpPlot 2.51 User Manual: SetZRange Method

SharpPlot.SetZRange Method

Reset Z axis range to default.

public void SetZRange();

See also ...

SharpPlot Members | SetZRange Method


SharpPlot 2.51 User Manual: SetZTickMarks Method

SharpPlot.SetZTickMarks Method

Set Z tick marks given a tickmark specification.

Example

sp.SetZTickMarks(100); // Major interval

Overloads

  • public void SetZTickMarks(double majorInterval);
  • public void SetZTickMarks(int[] tickPlacement);
  • public void SetZTickMarks(double[] tickPlacement);
  • public void SetZTickMarks(double majorInterval,int minorTickCount);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SetZTickMarks Method (Double)

SharpPlot.SetZTickMarks Method (Double)

Set Z tick marks major tick interval.

public void SetZTickMarks(
    double majorInterval
);

See also ...

SharpPlot Members | SetZTickMarks Method


SharpPlot 2.51 User Manual: SetZTickMarks Method (Double,Int32)

SharpPlot.SetZTickMarks Method (Double,Int32)

Set Z tick marks major interval and minor count.

public void SetZTickMarks(
    double majorInterval,
    int minorTickCount
);

See also ...

SharpPlot Members | SetZTickMarks Method


SharpPlot 2.51 User Manual: SetZTickMarks Method (Double[])

SharpPlot.SetZTickMarks Method (Double[])

Set Z tick marks to exact positions (no minor ticks).

public void SetZTickMarks(
    double[] tickPlacement
);

See also ...

SharpPlot Members | SetZTickMarks Method


SharpPlot 2.51 User Manual: SetZTickMarks Method (Int32[])

SharpPlot.SetZTickMarks Method (Int32[])

Set Z tick marks to integer positions (no minor ticks).

public void SetZTickMarks(
    int[] tickPlacement
);

See also ...

SharpPlot Members | SetZTickMarks Method


SharpPlot 2.51 User Manual: SplitBy Method

SharpPlot.SplitBy Method

Enables data to be split according to some criterion prior to plotting.

Example

sp.SplitBy(todo);

Overloads

  • public void SplitBy(int[] values,int[] categories);
  • public void SplitBy(int[] values);
  • public void SplitBy(int[] values,string[] categories);
  • public void SplitBy(string[] values,string[] categories);
  • public void SplitBy(string[] values);
  • public void SplitBy(bool[] values,bool[] categories);
  • public void SplitBy(bool[] values,string[] categories);
  • public void SplitBy(bool[] values);

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: SplitBy Method (Int32[],Int32[])

SharpPlot.SplitBy Method (Int32[],Int32[])

Enables data to be split according to some criterion prior to plotting.

public void SplitBy(
    int[] values,
    int[] categories
);

See also ...

SharpPlot Members | SplitBy Method


SharpPlot 2.51 User Manual: SplitBy Method (Int32[])

SharpPlot.SplitBy Method (Int32[])

Enables data to be split according to some criterion prior to plotting.

public void SplitBy(
    int[] values
);

See also ...

SharpPlot Members | SplitBy Method


SharpPlot 2.51 User Manual: SplitBy Method (Int32[],String[])

SharpPlot.SplitBy Method (Int32[],String[])

Enables data to be split according to some criterion prior to plotting.

public void SplitBy(
    int[] values,
    string[] categories
);

See also ...

SharpPlot Members | SplitBy Method


SharpPlot 2.51 User Manual: SplitBy Method (String[],String[])

SharpPlot.SplitBy Method (String[],String[])

Enables data to be split according to some criterion prior to plotting.

public void SplitBy(
    string[] values,
    string[] categories
);

See also ...

SharpPlot Members | SplitBy Method


SharpPlot 2.51 User Manual: SplitBy Method (String[])

SharpPlot.SplitBy Method (String[])

Enables data to be split according to some criterion prior to plotting.

public void SplitBy(
    string[] values
);

See also ...

SharpPlot Members | SplitBy Method


SharpPlot 2.51 User Manual: SplitBy Method (Boolean[],Boolean[])

SharpPlot.SplitBy Method (Boolean[],Boolean[])

Enables data to be split according to some criterion prior to plotting.

public void SplitBy(
    bool[] values,
    bool[] categories
);

See also ...

SharpPlot Members | SplitBy Method


SharpPlot 2.51 User Manual: SplitBy Method (Boolean[],String[])

SharpPlot.SplitBy Method (Boolean[],String[])

Enables data to be split according to some criterion prior to plotting.

public void SplitBy(
    bool[] values,
    string[] categories
);

See also ...

SharpPlot Members | SplitBy Method


SharpPlot 2.51 User Manual: SplitBy Method (Boolean[])

SharpPlot.SplitBy Method (Boolean[])

Enables data to be split according to some criterion prior to plotting.

public void SplitBy(
    bool[] values
);

See also ...

SharpPlot Members | SplitBy Method


SharpPlot 2.51 User Manual: UseCmyk

SharpPlot.UseCmyk

Create a color using the CMYK model. This allows full control over the inks used by PostScript printers if the output is saved in EPS or PDF formats. All other formats simply convert the chosen color to RGB for screen display.

Example

  sp.SetBackground(sp.UseCmyk(0,2,20,0),FillStyle.Solid,0);

  sp.Heading = "Check out Alternate Colour Models";
  sp.Subheading = "This should look very like the main heading";

  Color darkolive = sp.UseCmyk(9,0,24,58);

  sp.SetHeadingFont("Times New Roman",16,FontStyle.Italic,darkolive);
  sp.SetSubheadingFont("Times",12,FontStyle.Regular,Color.DarkOliveGreen);

Overloads

  • public Color UseCmyk(int c,int m,int y);
  • public Color UseCmyk(double c,double m,double y);
  • public Color UseCmyk(int c,int m,int y,int k);
  • public Color UseCmyk(double c,double m,double y,double k);

Returns a standard Color object encoding the required CMYK values. This is used directly by EPS and PDF output (both of which support the CMYK color space) or converted back to RGB for screen display by all other formats. The exact colors shown on screen may vary depending on the software used to view the file.

See also ...

The CMYK Color Model


SharpPlot 2.51 User Manual: UseCmyk Method (Double,Double,Double,Double)

SharpPlot.UseCmyk Method (Double,Double,Double,Double)

Record ink proportions in the range 0-1 for CMYK standard.

public Color UseCmyk(
    double c,
    double m,
    double y,
    double k
);
c
Proportion of Cyan ink.
m
Proportion of Magenta ink.
y
Proportion of Yellow ink.
k
Proportion of Black ink.

See also ...

SharpPlot Members | UseCmyk


SharpPlot 2.51 User Manual: UseCmyk Method (Double,Double,Double)

SharpPlot.UseCmyk Method (Double,Double,Double)

Assume no black if proportion omitted.

public Color UseCmyk(
    double c,
    double m,
    double y
);
c
Proportion of Cyan ink.
m
Proportion of Magenta ink.
y
Proportion of Yellow ink.

See also ...

SharpPlot Members | UseCmyk


SharpPlot 2.51 User Manual: UseCmyk Method (Int32,Int32,Int32,Int32)

SharpPlot.UseCmyk Method (Int32,Int32,Int32,Int32)

Percentages of each ink.

public Color UseCmyk(
    int c,
    int m,
    int y,
    int k
);
c
Proportion of Cyan ink.
m
Proportion of Magenta ink.
y
Proportion of Yellow ink.
k
Proportion of Black ink.

See also ...

SharpPlot Members | UseCmyk


SharpPlot 2.51 User Manual: UseCmyk Method (Int32,Int32,Int32)

SharpPlot.UseCmyk Method (Int32,Int32,Int32)

Assume no black if percentage omitted.

public Color UseCmyk(
    int c,
    int m,
    int y
);
c
Proportion of Cyan ink.
m
Proportion of Magenta ink.
y
Proportion of Yellow ink.

See also ...

SharpPlot Members | UseCmyk


SharpPlot 2.51 User Manual: Structures

Structures

Structures are used instead of enumerations for Linestyles, Fillstyles and Markers to allow users to define these on the fly, as well as using pre-defined options.

Structures

FillStyle | Standard fill styles and gradients
HotspotInfo | Holding pen for hotspot locator info
KeyDefinition | Definition structure for data-placeholder in chart keys. Mostly used internally, but may be defined by the calling application.
LineStyle | Specifies the style of dashed lines drawn.
Marker | Standard markers
Zone | Structure to define a shaded region which appears as part of the chart background.

See Also

HotspotInfo structure

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: FillStyle Struct

FillStyle Struct

Fill-styles (built-in and user-defined tilings). SharpPlot offers a good range of pre-defined shading patterns, but the majority of output formats allow you to add your own custom fills. for SVG, these would typically be more sophisticated gradients, or 3D-effect filters to give the effect of extrusion and lighting on the completed graphic. For raster output, you can use any standard .Net Brush object here. See Gradients for more background on how the fills may be customised.

public struct FillStyle

Public Static Properties

Background | Shape is filled with the current background
BackwardDiagonal | Shape is diagonally hatched right to left
DiagonalCross | Shape is diagonally cross-hatched
Dome | Fill has 3D domed effect
Drum | Fill has 3D Column effect
ForwardDiagonal | Shape is diagonally hatched left to right
GradientBottom | Fill has S-N gradient
GradientBottomLeft | Fill has SW-NE gradient
GradientBottomRight | Fill has SE-NW gradient
GradientLeft | Fill has W-E gradient
GradientRight | Fill has E-W gradient
GradientTop | Fill has N-S gradient
GradientTopLeft | Fill has NW-SE gradient
GradientTopRight | Fill has NE-SW gradient
Halftone | Fill colour has 50% saturation
HorizontalBrick | Shape is filled with bricking pattern
Opacity18 | Fill colour has 18% opacity
Opacity30 | Fill colour has 30% opacity
Opacity42 | Fill colour has 42% opacity
Opacity54 | Fill colour has 54% opacity
Opacity6 | Fill colour has 6% opacity
Opacity66 | Fill colour has 66% opacity
Opacity78 | Fill colour has 78% opacity
Opacity90 | Fill colour has 90% opacity
Pipe | Fill has 3D Pipe effect
Saturate10 | Fill colour has 10% saturation
Saturate20 | Fill colour has 20% saturation
Saturate30 | Fill colour has 30% saturation
Saturate60 | Fill colour has 60% saturation
Saturate80 | Fill colour has 80% saturation
Saturate90 | Fill colour has 90% saturation
Shingle | Shape is filled with fish-scale pattern
Solid | Shape is filled with solid colour
SpotBottomLeft | Fill has Bottom-Left spotlight
SpotBottomRight | Fill has Bottom-Right spotlight
SpotTopLeft | Fill has Top-Left spotlight
SpotTopRight | Fill has Top-Right spotlight
Sunrise | Fill has Sunrise gradient
Unfilled | Shape is not filled
Weave | Shape is shaded with basket-weave pattern

Creating Fills for Vector Output

Creates a custom shading from an existing gradient or URI to a file.

public FillStyle(
    string sourceName  // Brush is also accepted here
);
sp.SetBackground(Color.Bisque,FillStyle.GradientBottomRight);
FillStyle fs = new FillStyle("#gentlelight"); // SVG filter
sp.SetBackground(new FillStyle("tartan.png"));

Bitmap fills are currently only supported in output rendered as VML, XAML and raster. Customised gradients may be used with any of the formats, and arbitrary filters are specific to SVG. A typical filter could look like:

<defs>
  <desc>Background wash (light colour)</desc>
   <linearGradient id="wash" gradientTransform="rotate(35)" >
    <stop offset="15%" style="stop-color:#D7E1E3"/>
    <stop offset="90%" style="stop-color:#9CDCEE"/>
   </linearGradient>
</defs>

You refer to this as “#wash” in the source name for the fill style. Remember to Include the source for the filter in the chart so that it is added at the beginning of the SVG output.

Creating Fills for Raster Output

To create a custom shading from an existing Brush:

public FillStyle(
    Brush brush
);
bg = new TextureBrush(new Bitmap("marble.jpg"));
sp.SetChartBackground(new FillStyle(bg));

You can use the WrapMode setting of the Brush to determine how the texture is tiled. It may be convenient to combine both methods to create a chart which can render either to vector or raster outout. In this case you may pass the Brush object and the URL to the image when you create the custom fill:

bg = new TextureBrush(new Bitmap("marble.jpg"));
sp.SetChartBackground(new FillStyle(bg,"http://serverpath/marble.jpg"));

Clearly, the vector output may require a full http path to the image, and you may choose a completely different image here.

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

Using | SharpPlot | SetBackground | SetChartBackground | SetFillStyles | SetFrameBackground | SetKeyBackground | SetNoteBackground


SharpPlot 2.51 User Manual: HotspotInfo Struct

HotspotInfo Struct

This structure is used to pass details of chart hotspots between various utilities in the PageMap class. It is likely that a programmer will find it very helpful when debugging a Gui application to have the contents written to the console to check that the mouse really did hit the expected series item.

For advanced applications (for example graphical editing by dragging markers or bars) it holds the detail necessary for developing an appropriate Gui front end. For simple applications, it will identify which item in the data series the user clicked on, which could be used to drill to appropriate detail, or simply highlight the point.

public struct HotspotInfo

Example

  pm = sp.RenderPageMap();
  int hix = pm.FindHotspot(200,120);
  HotspotInfo hi = pm.GetHotspotInfo(hix);
  System.Console.WriteLine(hi.ToString());

Chart=Bar1, Series=Hats, Item=2, Shape=Bar, Locator=186.9 52 216 193.2 0

HotspotInfo Properties (all Readonly)

Chart
Name of chart (set by SetChartName or auto-generated) as a string
Series
Name of series (set by SetSeriesNames or auto-generated) as a string
Item
Index of selected data item (1-origin) in the series
Locator
Array of numbers (depending on item shape) which define it on the page
Shape
Enumeration giving the item shape – typically 1=point, 2=rectangle, 3=wedge or zero if no hotspot detected

For a point-marker, the Locator gives 6 numbers – the (x,y) location of the marker and of its immediate neighbours (or of itself again if it is the first or last of the set). For a rectangle it gives the bounding box as (x,y,x,y) lower-left, top-right. For a pie-wedge it gives (x,y,radius,startangle,endangle) where the angles measure in degrees anticlockwise from the 3:00 line.

All text-based hotspots (headings, axis-labels) are type=2 and have a bounding rectangle, so the user can click anywhere in the region containing the text.

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

HotspotType Enumeration | PageMap Class – Introduction


SharpPlot 2.51 User Manual: KeyDefinition Struct

KeyDefinition Struct

Definition structure for data-placeholder in chart keys. Mostly used internally, but may be defined by the calling application to customise legend placeholders.

public struct KeyDefinition

Public Constructors

Create a custom key placeholder (type 1 = line/marker, type 2 = block key for surface or bar, type 3 = stepped line).

Block key uses type=2 and requires colour, and optional FillStyle (solid fill is the default):

public KeyDefinition(
   int type,
   Color color,
   FillStyle pattern
);

Line/marker key is always type=1 and requires Colour,LineStyle and PenWidth. If MarkerSyle is omitted, no markers are drawn.

public KeyDefinition(
   int type,
   Color color,
   LineStyle line
   double penwidth
   Marker marker
);

You may also use this constructor to make a Stepped line key (type=3) suitable for Stepcharts.

Example

// Make 2 custom legend placeholders
 key1 = new KeyDefinition(1,Color.Red,LineStyle.Solid,0.8,Marker.SmallBullet);
 key2 = new KeyDefinition(1,Color.Navy,LineStyle.Solid,0.8,Marker.Ring);
// Use them in a hand-made legend block
 sp.DrawKey(2,10,new KeyDefinition[]{key1,key2});

This creates two placeholders suitable for a chart with lines and markers.

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | DrawKey Method


SharpPlot 2.51 User Manual: LineStyle Struct

LineStyle Struct

Line-styles (built-in and user-defined dash-repeat sequences).

public struct LineStyle

Public Constructor

Creates a custom dashed line from a vector of even length giving on-off pattern in points.

public LineStyle(
    double[] newDefinition  // int[] and Pen are also accepted here
);

Example

sp.SetContourStyle(Color.Red,LineStyle.Dash,1.2);
sp.SetDatumLineStyle(Color.Maroon,new LineStyle(new int[] {12,4,24,4})); // Long dashes

Public Static Properties

Dash | Specifies a dashed line
DashDot | Specifies a line with alternating dashes and dots
DashDotDot | Specifies a line with alternating dashes and paired dots
Dot | Specifies a dotted line
Invisible | Specifies an undrawn (invisible) line
Solid | Specifies a solid line

Creating Custom Dashed Lines

A dashed line is defined by an array of integers which give the on-off-on-off cycle in points. Custom lines are drawn with square ends to make the segments exactly the length you ask for. The cycle always begins at the start of the pattern (so the dash-offset is zero) here. For example:

LineStyle mydash = new LineStyle(new int[]{1,2,2,2,3,2,4,2});

Note that in charts rendered to SVG you can animate the dash-offset to give the effect of a ‘walking line’.

Using a Pen object with Raster Output

It is possible to use an existing .Net Pen object to create your line, but this method will only be effective in charts rendered to raster formats.

public LineStyle(
    Pen myPen
);

The color and Width of the pen will be overridden by the color setting and width of the line being drawn.

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | SetDatumLineStyle Method | SetGridLineStyle Method | SetLineStyles Method


SharpPlot 2.51 User Manual: Marker Struct

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, XAML paths, or any text character in a suitable font (e.g. WingDings).

public struct Marker

Public Static Properties

Ball | Marker is a large 3D-effect circle
Bar | Marker is a short vertical line
Block | Marker is a filled square
Bullet | Marker is a medium-sized filled circle
Circle | Marker is an open circle
Cross | Marker is a multiply sign
Del | Marker is a triangle on its point
Diamond | Marker is an open diamond
Dot | Marker is a tiny (approx 1 pixel) dot
DownTick | Marker is a downward tick
Hyphen | Marker is a short horizontal line
Invisible | Marker is not drawn
LeftTick | Marker is a left-aligned tick
Lozenge | Marker is a filled diamond
Node | Marker is a small 3D-effect circle
Plus | Marker is a plus sign
RightTick | Marker is a right-aligned tick
Ring | Marker is a large open circle
SmallBullet | Marker is a small filled circle
Triangle | Marker is a triangle on its base
UpTick | Marker is an upward tick

Public Constructor

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

public Marker(
   string sourceName  // Image is also accepted here
);

Example

Marker ms = new Marker("wingdings,9,#146");
Marker hex = new Marker("{ m -3,0 l 2,2 2,0 2,-2 -2,-2 -2,0 z }");
sp.SetMarkers(new Marker[]{Marker.Cross,Marker.Lozenge,ms,hex});

Creating Custom Markers from Text

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:

  • the font name, with optional capitalisation but containing any embedded spaces.
  • the character size to form markers for markerscale=1 (they will be scaled as required).
  • the character or short string that forms the marker. This will be horizontally and vertically centered at each data point. Characters may be given literally (for example in the definition “Arial,10,pH”) or as the decimal code following a # symbol.

Creating Custom Markers from Images

It is also possible to reference small image files as markers in which case you can 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 be scaled to (16,16) 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 if you override the size.

For charts to be rendered as Raster output, it may be convenient to pass an existing Image object here:

public Marker(
   Image image
);

In this case the size is completely determined by the width and height of the object, so you may need to scale it before passing it to SharpPlot. Using very large markers may make the legend align poorly – be warned!

Example

Marker bug = new Marker(new Bitmap("ladybug.png"));
sp.SetMarkers(bug);

The image will be used at actual size unless the MarkerScale array is set to scale them as needed.

You may combine both methods, giving an Image for raster use and a source URL for the same (or a different) image for use in vector output:

Marker bug = new Marker(new Bitmap("ladybug.png"),"http://serverpath/ladybug16.gif");
sp.SetMarkers(bug);

Creating Custom Markers from Paths

The XAML specification has a simple notation for drawing any vector path, so this is what SharpPlot uses to allow you to build any vector path as a marker. This notation works in all output formats, so is preferred to the symbol reference which is supported only by SVG.

Some examples of simple paths are:

hex = "{ m -3,0 l 2,2 2,0 2,-2 -2,-2 -2,0 z }";  // stroke is implied but note the closepath!
box = "{ m -2 -2 v 4 h 4 v -4 z }";  // Minimalist square
duck = "{  m -11 4 c 1.95 -1.65 3.66 -1.89 6.81 -0.33 3.12  ....  5.91} F";   // Filled duck

The path is enclosed in braces, and the commands you can use are:

m
relative moveto
l
relative lineto
c
relative curveto
v
relative vertical lineto
h
relative horizontal lineto
z
closepath (join the figure to its startpoint cleanly)
S
stroke the finished path (implied if omitted)
F
fill the finished path

Pairs of co-ordinates may be separated by commas or spaces, and the path command does not need to be repeated when there is a long sequence of similar commands (typically a polyline). Note that only the relative path commands may be used and that the marker is drawn with the (0,0) point at the data – it is up to you to get a good visual balance for complex symbols such as the duck.

Filled symbols will be outlined in the current background color if the Halo style has been set on the chart.

Creating Custom Markers from SVG Symbols (SVG output only)

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 | IncludeSource Method | SetMarkers Method


SharpPlot 2.51 User Manual: Zone Struct

Zone Struct

Structure to define a shaded region which appears as part of the chart background. Zones may be used on any conventional 2-dimensional chart (see the Gantt tutorials) or on Dial charts to mark out significant areas on the scale. Each Zone has a start and stop value, a color and an optional fillstyle.

For xy-plots (scatterplots or bubblecharts) you may define a matching array of x-zones and y-zones to mark out arbitrary rectangular areas on the chart by using ZoneStyles.Intersect. These are shaded at the intersection of the zone pairs rather than spanning the axis range.

public struct Zone

Public Constructors

Creates a solid-filled shaded region.

public Zone(
   double startValue,
   double stopValue,
   Color regionColor
);

Creates a shaded region with given fill-style.

public Zone(
   double startValue,
   double stopValue,
   Color regionColor,
   FillStyle regionPattern
);

Creates a shaded region with given fill-style and zone-style

public Zone(
   double startValue,
   double stopValue,
   Color regionColor,
   FillStyle regionPattern,
   ZoneStyles regionStyle
);

Creates a solid region with given zone-style

public Zone(
   double startValue,
   double stopValue,
   Color regionColor,
   ZoneStyles regionStyle
);

Example

sp.SetXZones(new Zone(40,60,Color.Green,FillStyle.Opacity30));

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot | SetIZones | SetXZones | SetYZones | ZoneStyles


SharpPlot 2.51 User Manual: Enumerations

Enumerations

These lists are (mostly) flags which combine to set chart styles or determine how the chart is rendered.

Enumerations

BarChartStyles | No summary available
BoxPlotStyles | No summary available
BubbleChartStyles | No summary available
CaptionStyles | No summary available
ChartType | Chart types which may be used with DrawMultiple to create a trellis automatically
CloudChartStyles | No summary available
ContourPlotStyles | No summary available
DataStyles | No summary available
DialChartStyles | No summary available
EquationStyles | Placement and other options for model-fit equation (flags)
FootnoteStyles | No summary available
FrameStyles | No summary available
GanttChartStyles | No summary available
GroupByFunction | Alternative strategies for aggregating data (simple summation is the default).
HeadingStyles | No summary available
HistogramStyles | No summary available
HotspotType | No summary available
IAxisStyles | No summary available
ITickStyles | No summary available
KeyStyles | No summary available
LabelStyles | No summary available
LineGraphStyles | No summary available
MinMaxChartStyles | No summary available
NoteStyles | No summary available
ParityStyles | No summary available
PdfMode | Various options to control the way Acrobat Reader first shows the completed PDF document.
PieChartStyles | No summary available
PolarChartStyles | No summary available
ResetOptions | Reset options (what persists through a reset)
ResponsePlotStyles | No summary available
ScalebarStyles | Scalebar options for contours and treemaps (flags)
ScatterPlotStyles | No summary available
ScriptTarget | Chart text elements which may be used as targets for JavaScript handlers or SVG attributes.
StepChartStyles | No summary available
SvgMode | Various options for scaling the completed graphic in the browser.
TableStyles | No summary available
TowerChartStyles | No summary available
TraceChartStyles | No summary available
TreeMapStyles | No summary available
TrellisStyles | No summary available
TriangleStyles | No summary available
ValueTagStyles | No summary available
VectorStyles | No summary available
VennDiagramStyles | No summary available
XAxisStyles | No summary available
XBarChartStyles | No summary available
XTickStyles | No summary available
YAxisStyles | No summary available
YTickStyles | No summary available
ZAxisStyles | No summary available
ZoneStyles | No summary available
ZTickStyles | No summary available

See Also

HotspotType enumeration

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: BarChartStyles Enumeration

BarChartStyles Enumeration

Barchart Style (flags).

[flags]
public enum BarChartStyles

Members

CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FloatingBars | Floating bars (lowest bar of stack not drawn)
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Horizontal | Horizontal chart
Indexed | Data is indexed to the initial value = 100
Logarithmic | All chart axes are drawn logarithmically
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
StackedBars | Stacked barcharts (data is accumulated)
TicksBetween | Tickmarks are drawn between bars or groups of bars
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | BarChartStyle Property


SharpPlot 2.51 User Manual: BoxPlotStyles Enumeration

BoxPlotStyles Enumeration

Box and Whisker style (flags).

[flags]
public enum BoxPlotStyles

Members

CroppedAxes | Crops all chart elements at the axis boundary
DecileWhiskers | BoxWhisker indicates deciles with dotted lines
ErrorBars | Shows errorbars on Hi-Lo charts and boxplots
ExplodeAxes | Axes are set back from the plotting area
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Horizontal | Boxes are drawn horizontally
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
Plain | Omits median line from boxplots
TabularData | Array elements represent categories of data, not categorisations
TicksBetween | Tickmarks are drawn between bars or groups of bars

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | BoxPlotStyle Property


SharpPlot 2.51 User Manual: BubbleChartStyles Enumeration

BubbleChartStyles Enumeration

Bubblechart Style (flags).

[flags]
public enum BubbleChartStyles

Members

AltitudeShading | Altitude shading is used with contour plots, bubble charts and response surfaces
AnnotateModel | Annotate model with computed equation
Clipped | Clip axes and all lines and markers at chart edge
CroppedAxes | Crops all chart elements at the axis boundary
Curves | Points are joined with smooth curves rather than straight lines
ExplodeAxes | Axes are set back from the plotting area
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Lines | Datapoints are connected with lines
Logarithmic | All chart axes are drawn logarithmically
ModelFit | Compute and show regression line or surface
NoAxes | No axes are drawn on the chart
NoMarkers | Do not draw markers at data points
OnTopModel | Modelfit is drawn ontop of data
OverlayGrid | Gridlines are drawn ontop of data
RadialScaling | Bubble charts scale using radius rather than area
ScaleBar | Bubble charts and altitude-shaded Contour plots add a nominal Z-Axis
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: CaptionStyles Enumeration

CaptionStyles Enumeration

Caption style (flags).

[flags]
public enum CaptionStyles

Members

FlatText | Flat text is used for 3D captions
LeftAlign | Left aligned caption
NoWrap | Captions are not wrapped automatically.
RightAlign | Right aligned caption

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | CaptionStyle Property


SharpPlot 2.51 User Manual: ChartType Enumeration

ChartType Enumeration

Chart types which may be used with DrawMultiple to create a trellis automatically.

public enum ChartType

Members

BarChart | Bar Chart
DialChart | Dial Chart
Histogram | Histogram
LineGraph | Line Graph
None | No chart
PieChart | Pie Chart
PolarChart | Polar Chart
ScatterPlot | Scatter Plot
VennDiagram | Venn Diagram
XBarChart | XBar Chart

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: CloudChartStyles Enumeration

CloudChartStyles Enumeration

Cloudchart Style (flags).

[flags]
public enum CloudChartStyles

Members

AltitudeShading | Altitude shading is used with contour plots, bubble charts and response surfaces
Contours | Draw contour lines between data points
Curves | Points are joined with smooth curves rather than straight lines
Fine | Altitude shading interpolated in fine detail
FlatText | Flat labels and captions are used on 3D charts
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Indexed | Data is indexed to the initial value = 100
Lines | Datapoints are connected with lines
ModelFit | Compute and show regression line or surface
NoAxes | No axes are drawn on the chart
NoMarkers | No markers are drawn (turns off default)
ProjectContours | Contours are drawn on the xy-plane in 3D charts
Risers | Draw risers to data points from axis or fitted model
ScaleBar | Bubble charts and altitude-shaded Contour plots add a nominal Z-Axis
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
TiledSurface | Tile surfaces on response plots
TrendSurface | Compute trend surface (2D Gaussian smooth)
WallShading | Shade walls on all 3D charts
XYPlot | First column gives the X-values for LinePlot

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | CloudChartStyle Property


SharpPlot 2.51 User Manual: ContourPlotStyles Enumeration

ContourPlotStyles Enumeration

Contourplot Style (flags).

[flags]
public enum ContourPlotStyles

Members

AltitudeShading | Altitude shading is used with contour plots, bubble charts and response surfaces
Clipped | Clip axes and all lines and markers at chart edge
Coarse | No refinement is done to colors on altitude-shaded plots
CroppedAxes | Crops all chart elements at the axis boundary
Curves | Points are joined with smooth curves rather than straight lines
ExplodeAxes | Axes are set back from the plotting area
Fine | Altitude shading interpolated in fine detail
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Lines | Datapoints are connected with lines
NoAxes | No axes are drawn on the chart
NoMarkers | Markers are not drawn at data points
NoTags | Contour lines are not tagged with the height values
OverlayGrid | Gridlines are drawn ontop of data
ScaleBar | Bubble charts and altitude-shaded Contour plots add a nominal Z-Axis
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: DataStyles Enumeration

DataStyles Enumeration

Data Style (flags).

[flags]
public enum DataStyles

Members

Relative | Relative data (values are accumulated)
Rows | Series are presented in rows, not columns

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: DialChartStyles Enumeration

DialChartStyles Enumeration

Dial-chart Style (flags).

[flags]
public enum DialChartStyles

Members

Anticlockwise | Scale on dialchart runs from right to left
ArrowLines | Draw arrows at ends of lines
WedgeZones | Use wedge zones on dialcharts rather than annular zones

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | DialChartStyle Property


SharpPlot 2.51 User Manual: EquationStyles Enumeration

EquationStyles Enumeration

Placement and other options for model-fit equation (flags).

[flags]
public enum EquationStyles

Members

Absolute | Position is interpreted in points
AtEnd | Outside the line at the right-hand end
Below | Below the line
ForceOrigin | Force fitted line through the origin
Left | Left end of fitted line
LinearFit | Force a linear equation even if we have logarithmic axes
Middle | Middle of fitted line
Opaque | Opaque background to text
Percentage | Position is interpreted in percentage of axes
SpanData | Fitted line spans data range, not X-axis
Straddle | Straddling the line

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | EquationStyle Property


SharpPlot 2.51 User Manual: FootnoteStyles Enumeration

FootnoteStyles Enumeration

Footnote style (flags).

[flags]
public enum FootnoteStyles

Members

Center | Centered footnote
NoWrap | Footers are not wrapped automatically.
Right | Right-aligned footnote
RuledAbove | Footnote is ruled above

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | FootnoteStyle Property


SharpPlot 2.51 User Manual: FrameStyles Enumeration

FrameStyles Enumeration

Frame style (flags).

[flags]
public enum FrameStyles

Members

Boxed | Boxed frame
Filled | Filled with background colour
Rounded | Rounded corners
Shadowed | Shadowed box

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | FrameStyle Property


SharpPlot 2.51 User Manual: GanttChartStyles Enumeration

GanttChartStyles Enumeration

Gantt chart style (flags).

[flags]
public enum GanttChartStyles

Members

CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | GanttChartStyle Property


SharpPlot 2.51 User Manual: GroupByFunction Enumeration

GroupByFunction Enumeration

Alternative strategies for aggregating data (simple summation is the default).

public enum GroupByFunction

Members

Average | Finds the largest value in each category
Count | Counts the occurences of items in each category
Maximum | Totals the values in each category (default)
Minimum | Finds the smallest value in each category
Sum | Takes the arithmetic mean of the items in each category

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: HeadingStyles Enumeration

HeadingStyles Enumeration

Heading style (flags).

[flags]
public enum HeadingStyles

Members

Bottom | Bottom-aligned heading
Left | Left-aligned heading
NoWrap | Headings are not wrapped automatically.
Opaque | Opaque background to heading text
Right | Right-aligned heading
RuledBelow | Heading is ruled below

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | HeadingStyle Property


SharpPlot 2.51 User Manual: HistogramStyles Enumeration

HistogramStyles Enumeration

Histogram style (flags).

[flags]
public enum HistogramStyles

Members

CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Mean | Histogram marks the mean value with a datumline
NormalCurve | Histogram shows a fitted Normal Distribution
OverlayGrid | Gridlines are drawn ontop of data
Risers | Draw risers to data points from axis or fitted model
SDev1 | Histogram marks 1 StdDev with a datumline
SDev2 | Histogram marks 2 StdDev with a datumline
SDev3 | Histogram marks 3 StdDev with a datumline
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | HistogramStyle Property


SharpPlot 2.51 User Manual: HotspotType Enumeration

HotspotType Enumeration

Various types of hotspots reported by the active chart components.

public enum HotspotType

This is used in the active chart components to hold details of any active regions on the chart. Typically these are associated with hints or tips for the individual data items.

Members

Marker | Chart marker (center, scale). Markers are detected when the cursor falls within 4px of the center, scaled up if the marker itself it scaled.
Bar | Chart bar (bounding box). Bars are detected when the cursor is within the bar, or is hovering up to 4px above the top.
Wedge | Pie sector (center,radius,alpha,beta in degrees). The cursor must be within the wedge for these to be reported.
ScriptTarget | Heading, labels and so on (always rectangular). The cursor must be within the rectangle that encloses the text.
PlotRegion | Rectangle defined by chart axes (bounding box). This is used to convert from physical to user co-ordinates when the cursor is over the chart.
OriginScale | Chart origin (x,y) and scale of xy-Axes relative to points
Gradient | Rectangle defining a gradient fill. Used to create appropriate gradients for pie sectors and other tricky shapes.
XAxisStyle | Indicator that x-axis labels are non-standard. Used to format the cursor tracker in the x-direction.
YAxisStyle | Indicator that y-axis labels are non-standard. Used to format the cursor tracker in the y-direction.

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

PageMap Class – Introduction | FindHotspot Method


SharpPlot 2.51 User Manual: IAxisStyles Enumeration

IAxisStyles Enumeration

Inner-axis style (flags).

[flags]
public enum IAxisStyles

Members

ExactFit | Exact fit (no extra ticks added)
ForceZero | Force zero in axis
GridLines | Draw gridlines parallel to inner axis
NoLabels | No Labels
PlainAxis | Plain axis (no ticks or labels)

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | IAxisStyle Property


SharpPlot 2.51 User Manual: ITickStyles Enumeration

ITickStyles Enumeration

Inner-axis tickmark style (flags).

[flags]
public enum ITickStyles

Members

CrossingTicks | Ticks cross the axis
InsideTicks | Ticks are drawn inside the axis
NoTicks | No ticks are drawn

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | ITickStyle Property


SharpPlot 2.51 User Manual: KeyStyles Enumeration

KeyStyles Enumeration

Key style (flags).

[flags]
public enum KeyStyles

Members

Absolute | Position is interpreted in points
AutofitText | Shrink text to fit within given frame
Baseline | Baselined legend (on first line of text)
BottomAlign | Bottom aligned key frame
Boxed | Boxed key
BoxFrame | Box given frame instead of text
CenterAlign | Center aligned key frame
InlineWithData | Legends are written inline with data
LeftAlign | Left aligned key frame
MiddleAlign | Middle aligned key frame
NoKey | No key (always omit key)
NoWrap | Key text is not wrapped to margin
Percentage | Position is interpreted in percentage of axes
Plain | Plain (no markers) key
Reversed | Reversed order of legend items
RightAlign | Right aligned key frame
Rounded | Rounded key box
Shadowed | Shadowed key box
TopAlign | Top aligned key frame
Vertical | Vertically arranged legend

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | KeyStyle Property


SharpPlot 2.51 User Manual: LabelStyles Enumeration

LabelStyles Enumeration

Label Style (flags).

[flags]
public enum LabelStyles

Members

Center | Centered (on y-axis) labels
FlatText | Flat text is used for 3D labels
LeftAlign | Left-align coltitles on table charts
Middle | Middled (on x-axis) labels
NoWrap | Labels are not wrapped automatically.
Opaque | Opaque background to label text
RightAlign | Right-align coltitles on table charts

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | LabelStyle Property


SharpPlot 2.51 User Manual: LineGraphStyles Enumeration

LineGraphStyles Enumeration

Linegraph Style (flags).

[flags]
public enum LineGraphStyles

Members

AnnotateModel | Annotate model with computed equation
ArrowLines | Draw arrows at ends of lines
CellsCreated | Make cells at each marker for miniature plots
Clipped | Clip axes and all lines and markers at chart edge
CrispEdges | Turns off anti-aliasing on data lines
CroppedAxes | Crops all chart elements at the axis boundary
Curves | Points are joined with smooth curves rather than straight lines
ExplodeAxes | Axes are set back from the plotting area
Filled | Lines are completed back to the start and shaded inside the region created
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
GrowthCurve | Growth curve (exponential) is computed
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Indexed | Data is indexed to the initial value = 100
Markers | Markers are drawn at data points
ModelFit | Compute and show regression line or surface
NoAxes | No axes are drawn on the chart
NoLines | No lines are drawn (turns off default)
OnTopModel | Modelfit is drawn ontop of data
OverlayGrid | Gridlines are drawn ontop of data
Risers | Draw risers to data points from axis or fitted model
SegmentLines | Break lines at missing values rather than drawing across the gap
SkipRepeats | Repeated y-values are eliminated (treated as missing values)
SkipRuns | Runs of identical y-values are eliminated (preserves the first and last of each run)
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
TrendLine | Compute trend line (Gaussian smooth)
ValueTags | Value tags are written for data items
XYPlot | First column gives the X-values for LinePlot

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | LineGraphStyle Property


SharpPlot 2.51 User Manual: MinMaxChartStyles Enumeration

MinMaxChartStyles Enumeration

Min-Max (Hi-Lo plot) Style (flags).

[flags]
public enum MinMaxChartStyles

Members

ArrowLines | Draw arrows at ends of lines
CroppedAxes | Crops all chart elements at the axis boundary
Curves | Points are joined with smooth curves rather than straight lines
DriftMarkers | Mark only the far end of bounds (2nd series)
Envelope | Shade region within bounds
ErrorBars | Show errorbars on ranges
ExplodeAxes | Axes are set back from the plotting area
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Horizontal | Horizontal chart
Indexed | Data is indexed to the initial value = 100
NoAxes | No axes are drawn on the chart
NoLines | No lines are drawn (turns off default)
OverlayGrid | Gridlines are drawn ontop of data
Plain | Plain axes or value tags on piechart
Terminated | Draw current marker on both bounds
ValueTags | Value tags are written for data items
XYPlot | First column gives the X-values for LinePlot

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | MinMaxChartStyle Property


SharpPlot 2.51 User Manual: NoteStyles Enumeration

NoteStyles Enumeration

Note style (flags).

[flags]
public enum NoteStyles

Members

Absolute | Position is interpreted in points
Baseline | Baselined note box (on first line of text)
Bottom | Bottom-aligned note box
Boxed | Boxed notes
CenterAlign | Center aligned note box
Cropped | Eliminates entire note if text will be clipped
Middle | Middle-aligned note box
Opaque | Opaque text for notes
Percentage | Position is interpreted in percentage of axes
RightAlign | Right aligned note box
Rounded | Rounded box
Shadowed | Shadowed box
TopAlign | Top aligned note box

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | NoteStyle Property


SharpPlot 2.51 User Manual: ParityStyles Enumeration

ParityStyles Enumeration

Parity plot style (flags).

[flags]
public enum ParityStyles

Members

Absolute | Tolerances are given as constant values
Percentage | Tolerances are given as percentages
Proportion | Tolerances are given as a proportion of the prediction

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: PdfMode Enumeration

PdfMode Enumeration

Various options to control the way Acrobat Reader first shows the completed PDF document.

public enum PdfMode

Members

FullScreen | Acrobat Reader opens full-screen (suitable for presentations)
ShowOutlines | Acrobat Reader always shows the bookmark tab when opened
UserDefault | Acrobat Reader shows the PDF with your usual default settings

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: PieChartStyles Enumeration

PieChartStyles Enumeration

Piechart Style (flags).

[flags]
public enum PieChartStyles

Members

FarthestFirst | Drawing order allows 3D extrusion
Plain | Plain axes or value tags on piechart
RoseDiagram | Exploded pie sectors are drawn from centre to form a Rose Diagram
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | PieChartStyle Property


SharpPlot 2.51 User Manual: PolarChartStyles Enumeration

PolarChartStyles Enumeration

Polarchart Style (flags).

[flags]
public enum PolarChartStyles

Members

ArrowLines | Draw arrows at ends of lines
ClockFace | Polar chart represents a 24-hour clock
CompassPlot | Treat X-values as degrees in Polar plots
Curves | Points are joined with smooth curves rather than straight lines
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
HollowCenter | Polar gridlines radiate from first tick rather than centre
Indexed | Data is indexed to the initial value = 100
Markers | Markers are drawn at data points
NoAxes | No axes are drawn on the chart
NoLines | No lines are drawn (turns off default)
OriginMarker | Mark centre of polar plot with a bold dot
OverlayGrid | Gridlines are drawn ontop of data
Risers | Draw risers to data points from axis or fitted model
SkipRepeats | Repeated y-values are eliminated (treated as missing values)
SkipRuns | Runs of identical y-values are eliminated (preserves the first and last of each run)
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
ValueTags | Value tags are written for data items
XYPlot | First column gives the X-values for LinePlot

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | PolarChartStyle Property


SharpPlot 2.51 User Manual: ResetOptions Enumeration

ResetOptions Enumeration

Reset options (what persists through a reset)

public enum ResetOptions

Members

CyclesPersist | Cycles persist across reset
KeysPersist | Keys persist across reset

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | ResetOption Property


SharpPlot 2.51 User Manual: ResponsePlotStyles Enumeration

ResponsePlotStyles Enumeration

Response surface Style (flags).

[flags]
public enum ResponsePlotStyles

Members

AltitudeShading | Altitude shading is used with contour plots, bubble charts and response surfaces
Contours | Draw contour lines between data points
Curves | Points are joined with smooth curves rather than straight lines
Fine | Altitude shading interpolated in fine detail
FlatText | Flat labels and captions are used on 3D charts
ForceZero | Force zero (all axes include origin)
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Markers | Markers are drawn at data points
NoAxes | No axes are drawn on the chart
NoLines | No lines are drawn (turns off default)
Risers | Draw risers to data points from axis or fitted model
ScaleBar | Bubble charts and altitude-shaded Contour plots add a nominal Z-Axis
TiledSurface | Tile surfaces on response plots
WallShading | Shade walls on all 3D charts

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | ResponsePlotStyle Property


SharpPlot 2.51 User Manual: ScalebarStyles Enumeration

ScalebarStyles Enumeration

Scale bar style (flags).

[flags]
public enum ScalebarStyles

Members

Bottom | Scalebar is placed horizontally below the chart
Left | Scalebar is drawn in the left margin or at the bottom left
Right | Scalebar is drawn in the right margin or below the chart at the right
Small | Scalebar is drawn in minimalist style

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | ScalebarStyle Property | Scale bar for Bubble and Altitude-shaded plots


SharpPlot 2.51 User Manual: ScatterPlotStyles Enumeration

ScatterPlotStyles Enumeration

Scatterplot Style (flags).

[flags]
public enum ScatterPlotStyles

Members

AnnotateModel | Annotate model with computed equation
ArrowLines | Draw arrows at ends of lines
CellsCreated | Make cells at each marker for miniature plots
Clipped | Clip axes and all lines and markers at chart edge
Contours | Draw contour lines between data points
CroppedAxes | Crops all chart elements at the axis boundary
Curves | Points are joined with smooth curves rather than straight lines
ExplodeAxes | Axes are set back from the plotting area
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
GrowthCurve | Growth curve (exponential) is computed
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Lines | Datapoints are connected with lines
Logarithmic | All chart axes are drawn logarithmically
ModelFit | Compute and show regression line or surface
NoAxes | No axes are drawn on the chart
NoMarkers | No markers are drawn (turns off default)
OnTopModel | Modelfit is drawn ontop of data
OverlayGrid | Gridlines are drawn ontop of data
Parity | Axes are made square and a diagonal is drawn with tolerance lines
Risers | Draw risers to data points from axis or fitted model
TrendLine | Compute trend line (Gaussian smooth)
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | ScatterPlotStyle Property


SharpPlot 2.51 User Manual: ScriptTarget Enumeration

ScriptTarget Enumeration

Chart text elements which may be used as targets for JavaScript handlers or SVG attributes.

public enum ScriptTarget

Members

Axes | X and Y Axes (together)
ClipRect | Clipping rectangle at chart axes
Footnote | Footer
Frame | Entire chart region
GridLines | Grid lines (both x and y)
Heading | Main chart title
Key | Key placeholder and text (array)
None | No target
Notes | Note frame
OriginScale | Coordinate system
PageLabels | Page labels (array)
PlotRegion | Area bounded by chart axes
Subhead | Secondary title
Values | Value tags (array)
XCaption | X-Axis Caption
XLabels | X-Axis Labels (array)
XYZones | XY rectangular zones (array)
XZones | X-axis zones (array)
YCaption | Y-Axis caption
YLabels | y-Axis labels (array)
YZones | Y-axis zones (array)

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: StepChartStyles Enumeration

StepChartStyles Enumeration

Stepchart Style (flags).

[flags]
public enum StepChartStyles

Members

CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Horizontal | Horizontal chart
Indexed | Data is indexed to the initial value = 100
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
Risers | Draw risers to data points from axis or fitted model
SegmentLines | Break lines at missing values rather than drawing across the gap
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | StepChartStyle Property


SharpPlot 2.51 User Manual: SvgMode Enumeration

SvgMode Enumeration

Various options for scaling the completed graphic in the browser.

public enum SvgMode

Members

FixedAspect | The chart will be stretched to fit the smallest dimension, so preserving its shape.
FixedSize | The chart will always appear at the designed size, and will be undecorated
Shadowed | The chart will appear at the designed size, with a border and drop-shadow added
Stretchable | The chart will fit exactly the space available in the browser. This may distort the text if the window shape is very different from that which the chart was designed for!

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members


SharpPlot 2.51 User Manual: TableStyles Enumeration

TableStyles Enumeration

Table-chart Style (flags).

[flags]
public enum TableStyles

Members

Absolute | Position is interpreted in points
Boxed | Chart elements are boxed
Center | Centre-align within chart frame
FitHeight | Tables are sized to fit frame height
FitWidth | Tables are sized to fit frame width
GridLines | Draw gridlines (all axes)
Merged | Matching row-labels are merged
Opaque | Background area is filled with current background style
Right | Right-align within chart frame
Rounded | Boxes are drawn with rounded corners
Shadowed | Boxes are drawn with a drop-shadow
Spanned | Matching column labels are merged
UseHeaders | Tables pick up headers and footers

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | TableStyle Property


SharpPlot 2.51 User Manual: TowerChartStyles Enumeration

TowerChartStyles Enumeration

Towerchart style (flags).

[flags]
public enum TowerChartStyles

Members

FlatText | Flat labels and captions are used on 3D charts
ForceZero | Force zero (all axes include origin)
GridLines | Draw gridlines (all axes)
Indexed | Data is indexed to the initial value = 100
NoAxes | No axes are drawn on the chart
Plain | Plain axes or value tags on piechart
WallShading | Shade walls on all 3D charts

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | TowerChartStyle Property


SharpPlot 2.51 User Manual: TraceChartStyles Enumeration

TraceChartStyles Enumeration

Trace chart style (flags).

[flags]
public enum TraceChartStyles

Members

CrispEdges | Turns off anti-aliasing on data lines
CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
KiteDiagram | Draw Trace chart in Kite-diagram form
NoAxes | No axes are drawn on the chart
SurfaceShading | Surface shading is used on linecharts, down to the axis or a given baseline
XYPlot | First column gives the X-values for LinePlot

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | TraceChartStyle Property


SharpPlot 2.51 User Manual: TreeMapStyles Enumeration

TreeMapStyles Enumeration

Tree map style (flags).

[flags]
public enum TreeMapStyles

Members

AltitudeShading | Altitude shading is used with contour plots, bubble charts and response surfaces
FrameAxes | Axes are completed to frame chart and all data is cropped
Logarithmic | Area of rectangles scales to log of data value in TreeMap
ScaleBar | Bubble charts and altitude-shaded Contour plots add a nominal Z-Axis
SquareRoot | Area of rectangles scales to square root of data value in TreeMap
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | TreeMapStyle Property


SharpPlot 2.51 User Manual: TrellisStyles Enumeration

TrellisStyles Enumeration

Trellis Style (flags).

[flags]
public enum TrellisStyles

Members

Gridlines | Trellis is gridded like a table
PagedMultiples | Paged multiples, rather than trellised
ResetAtEachCell | Reset all properties on completing each cell
SnakingCells | Cells go down, then across the trellis

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | TrellisStyle Property


SharpPlot 2.51 User Manual: TriangleStyles Enumeration

TriangleStyles Enumeration

Triangle chart style (flags).

[flags]
public enum TriangleStyles

Members

Curves | Points are joined with smooth curves rather than straight lines
Filled | Lines are completed back to the start and shaded inside the region created
GridLines | Draw gridlines (all axes)
HaloMarkers | Halo all markers (improves 3D effect on Cloud charts)
Labelled | Triangle plot is drawn with labelled sides
Lines | Datapoints are connected with lines
Markers | Markers are drawn at data points
Percentage | Triangle plots are labelled in the range 0-100
RedrawOutline | Chart outline is redrawn over filled areas
SideCaptions | Triangle captions are moved to the sides
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: ValueTagStyles Enumeration

ValueTagStyles Enumeration

Value-label style (flags).

[flags]
public enum ValueTagStyles

Members

Angled | Angled text is used for values
Center | Values are centered above markers
CumulativeValues | Cumulative values are used on stacked barcharts
Duration | Numeric values are formatted to base-60
Hints | Values are set as status-line hints
InheritColor | Values inherit color from data points
Inside | Values are written inside bars, pie-sectors, markers
Left | Values are written to the left of markers
Middle | Values are vertically centred in each bar
Normal | Values are written as text (default)
Opaque | Value text is drawn with opaque background
Radial | Values are displaced outward along a radius (Polar charts only)
RecolorOutside | Values on bars match the bar colour when forced outside the bar
Right | Values are right-aligned above markers
SectorValues | Sector values are used on stacked barcharts
ShowAllTags | Value tags are drawn even if they have too little space
Tips | Values are set as pop-up tips
Vertical | Vertical text is used for values

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | ValueTagStyle Property


SharpPlot 2.51 User Manual: VectorStyles Enumeration

VectorStyles Enumeration

Vector style (flags).

[flags]
public enum VectorStyles

Members

ArrowLines | Draw arrows at ends of lines
CroppedAxes | Crops all chart elements at the axis boundary
Dissected | Vectors are spaced away from target points
ExplodeAxes | Axes are set back from the plotting area
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Middle | Markers in the middle of vectors
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
Rooted | Markers at the source of vectors
Terminated | Markers on target of vectors
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | VectorStyle Property


SharpPlot 2.51 User Manual: VennDiagramStyles Enumeration

VennDiagramStyles Enumeration

Venn diagram style (flags).

[flags]
public enum VennDiagramStyles

Members

Filled | Lines are completed back to the start and shaded inside the region created
RedrawOutline | Chart outline is redrawn over filled areas
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | VennDiagramStyle Property


SharpPlot 2.51 User Manual: XAxisStyles Enumeration

XAxisStyles Enumeration

X-Axis style (flags).

[flags]
public enum XAxisStyles

Members

AngledLabels | Angled labels are used
AnnualTicks | Annual ticks are used for dates
ArrowedAxis | Axis ends with an arrowhead
AtEndCaption | Caption is drawn at the end of the axis
BalancedAxis | Tickmarks are ranged around zero and the Y-axis is horizontally centred
CenteredCaption | Caption is centered below axis
Clipped | Axis and data is clipped at the first and last tickmarks
Date | X-values are taken as OLE dates
DuplicateAxes | Duplicate X-axes are drawn
Duration | Format X axis labels using base-60 rather than 10
ExactFit | Axis is not rounded up to the next whole tickmark interval
FlatText | Flat text is used for 3D charts
ForceZero | The X-axis always includes zero
GridLines | Grid lines are drawn vertically at major ticks
InsideLabels | Labels are written within the chart area
InvisibleAxis | Axis and ticks are invisible, but labels will be drawn as normal
LogScale | Log scale is used
Longitude | Longitude scale is drawn for GPS data
MaskedLabels | Labels are already masked so must not be thinned further
MiddleLabels | Labels are placed between tickmarks
MonthlyTicks | Monthly ticks are used for dates
NoAxis | No axis is generated
NoLabels | No labels are drawn
OmitLastLabel | Drops off rightmost label to avoid potential collisions
OverlayGrid | Grid lines are drawn over the data
PlainAxis | Plain axis (no ticks or labels)
RightCaption | Right-aligned axis caption (default)
SpannedLabels | Repeated labels are blanked and spanned across the repeated range
StayAtEdge | Labels stay at edge when axis is centrally placed
Time | X-values are taken as OLE date-time numbers
TopAxis | Axis is drawn at the top of the chart

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | XAxisStyle Property


SharpPlot 2.51 User Manual: XBarChartStyles Enumeration

XBarChartStyles Enumeration

Barchart Style (flags).

[flags]
public enum XBarChartStyles

Members

CroppedAxes | Crops all chart elements at the axis boundary
ExplodeAxes | Axes are set back from the plotting area
FloatingBars | Floating bars (lowest bar of stack not drawn)
ForceZero | Force zero (all axes include origin)
FrameAxes | Axes are completed to frame chart and all data is cropped
GridLines | Draw gridlines (all axes)
Horizontal | Horizontal chart
Indexed | Data is indexed to the initial value = 100
Logarithmic | All chart axes are drawn logarithmically
NoAxes | No axes are drawn on the chart
OverlayGrid | Gridlines are drawn ontop of data
StackedBars | Stacked barcharts (data is accumulated)
TicksBetween | Tickmarks are drawn between bars or groups of bars
ValueTags | Value tags are written for data items

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | XBarChartStyle Property


SharpPlot 2.51 User Manual: XTickStyles Enumeration

XTickStyles Enumeration

X-Axis tickmark style (flags).

[flags]
public enum XTickStyles

Members

Absolute | Tick-lengths are in points, not percent of standard
CrossingTicks | Ticks cross the axis
DuplicateTicks | Ticks repeat on the alternate axis
InsideTicks | Ticks are drawn inside the axis
MinorTicks | Minor ticks are added automatically
NoTicks | No ticks are drawn

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | XTickStyle Property


SharpPlot 2.51 User Manual: YAxisStyles Enumeration

YAxisStyles Enumeration

Y-Axis style (flags).

[flags]
public enum YAxisStyles

Members

AboveGrid | Labels are written above gridlines and tickmarks
AngledLabels | Angled labels are used on 3D charts
ArrowedAxis | Axis ends with an arrowhead
AtEndCaption | The caption is written horizontally above the top of the axis
BalancedAxis | Tickmarks are ranged around zero and the X-axis is vertically centred
CenteredCaption | The caption is vertically centred
ClampToAxis | Data is clamped to fit within the axis range
Clipped | Data and axes are clipped at the extreme tick marks
Date | The data is assumed to be OLE dates
DuplicateAxes | Duplicate axes are drawn
Duration | Format Y axis labels using base-60 rather than 10
ExactFit | The axis will not be extended to the nearest whole tick interval
FlatText | Flat text is used for 3D captions and labels
ForceZero | Axis range always includes zero
GridLines | Horizontal gridlines are drawn at major ticks
InsideLabels | Labels are written within the chart area
InvertAxis | The axis is drawn with data values increasing from the top down
InvisibleAxis | No axis or ticks are drawn, but labels are written normally
Latitude | The scale is formatted as latitude values for GPS data
LeftAxis | The axis is drawn and labelled at the left even for secondary axes
LogScale | A logarithmic scale is used
MiddleLabels | Axis labels are written on the middle of the axis
NoAxis | No axis is drawn
NoLabels | No labels are added
OverlayGrid | Gridlines are drawn on top of data
PlainAxis | No labels or ticks are created
RightAxis | The axis is drawn at the right
StayAtEdge | Labels stay at the chart edge when the axis intercept is explicitly set
Synchronised | Secondary axis will match tick positions of primary
Time | The data is assumed to be OLE date/time values

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | YAxisStyle Property


SharpPlot 2.51 User Manual: YTickStyles Enumeration

YTickStyles Enumeration

Y-Axis tickmark style (flags).

[flags]
public enum YTickStyles

Members

Absolute | Tick-lengths are in points, not percent of standard
CrossingTicks | Ticks cross the axis
DuplicateTicks | Ticks repeat on the alternate axis
InsideTicks | Ticks are drawn inside the axis
MinorTicks | Minor ticks are added automatically
NoTicks | No ticks are drawn

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | YTickStyle Property


SharpPlot 2.51 User Manual: ZAxisStyles Enumeration

ZAxisStyles Enumeration

Z-Axis style (flags).

[flags]
public enum ZAxisStyles

Members

AtEndCaption | The caption is written above the top of the axis
ExactFit | The axis is not extended to the nearest whole tickmark
FlatText | Flat text is used for the caption and labels
ForceZero | The axis is forced to include zero
GridLines | Grid lines are drawn around the chart walls
NoLabels | No labels are drawn
PlainAxis | No ticks or labels are drawn

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | ZAxisStyle Property


SharpPlot 2.51 User Manual: ZoneStyles Enumeration

ZoneStyles Enumeration

Zone style (flags).

[flags]
public enum ZoneStyles

Members

Intersect | Zone is painted only at intersections with orthogonal zones
SpanFrame | Zone spans the chart area rather than the axes

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: ZTickStyles Enumeration

ZTickStyles Enumeration

Z-Axis tickmark style (flags).

[flags]
public enum ZTickStyles

Members

NoTicks No ticks are drawn

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

SharpPlot Members | ZTickStyle Property


SharpPlot 2.51 User Manual: Style examples

Style examples

Examples of all the chart and axis styles.

AboveGrid | Above gridlines – Y-label positioning
AltitudeShading | Altitude shading
AngledLabels | Angled labels – label placement
AnnotateModel | Annotate model
ArrowedAxis | Arrowed Axes
ArrowLines | ArrowLines
AtEndCaption | Caption written at the end of the Axis
BalancedAxis | Balanced Axis – force matching range about the zero point.
Boxed | Boxed style
BoxFrame | BoxFrame style
CellsCreated | Cells style
CenteredCaption | CenteredCaption style
ClampToAxis | Clamp lines to chart range
Clipped | Clip to axis range
ClockFace | ClockFace scaling is used on Polar charts
Coarse | Coarse shading
CompassPlot | Compass
Contours | Contours on mesh surfaces
CrispEdges | CrispEdges – cancel anti-aliasing on lines
CroppedAxes | Cropped style
CrossingTicks | Crossing Ticks
Curves | Curves are used to join data points
DecileWhiskers | Decile whiskers on Boxplot
Dissected | Dissected arrows on Vector plot
DriftMarkers | Directional Min-Max
DuplicateAxes | Duplicated Axes
DuplicateTicks | Duplicated Tickmarks
Duration | Duration formatting
Envelope | Shaded envelope is used on MinMax plots
ErrorBars | ErrorBars are added to MinMax plots
ExactFit | Axis range is not taken to the next major tickmark
ExplodeAxes | Exploded Axes
FarthestFirst | Farthest first on piecharts
Filled | Filled lines
Fine | Fine shading
FlatText | Flat text for 3D labelling
FloatingBars | Floating bars
ForceOrigin | Force Modelfit through zero
ForceZero | Forcezero
FrameAxes | Framed axes
GridLines | Gridlines
GrowthCurve | Growth curve
HaloMarkers | Halo markers
HollowCenter | Hollow center on Polar charts
Horizontal | Horizontal
Indexed | Indexed data
InlineWithData | Inline keys
InsideLabels | Inside Labels
InsideTicks | Inside Ticks
InvertAxis | Inverted Y-scale
InvisibleAxis | Invisible axes
KiteDiagram | Kite charts
Lines | Lines are drawn between points
LogAxes | Log Scales on both Axes
LogScale | Logarithmic Scales
Markers | Markers drawn
Merged | Merged row-labels
MiddleLabels | MiddleLabels – labels go between ticks
MinorTicks | Minor Tickmarks
ModelFit | Modelfit
NoAxes | No Axes are drawn
NoAxis | No Axis is drawn
NoLines | No lines are drawn on Linegraphs
NoMarkers | No markers are drawn on Scatterplots
NormalCurve | NormalCurve on Histograms
NoTags | No Tags
NoTicks | No Tickmarks
NoWrap | No wrapping
OmitLastLabel | Omit last X-label
OnTopModel | OnTopModel
OriginMarker | Origin Marker on Polar charts
OverlayGrid | Overlayed gridlines
Parity | Parity plot
Plain | Plain PieChart or Tower
PlainAxis | Plain axes are used (no ticks or labels)
ProjectContours | Project Contours on XY-plane
RadialScaling | Markers are scaled to radius
Relative | Relative data
Risers | Risers from axis or data
Rooted | Rooted vectors
RoseDiagram | Rose diagram
Rounded | Rounded corners
Rows | Data is in rows, not columns
ScaleBar | Scale bar for Bubble and Altitude-shaded plots
SegmentLines | Segmented lines are used at missing values
Shadowed | Shadowed boxes are drawn
SkipRepeats | Repeated values are suppressed
SkipRuns | Runs of values are suppressed
SpanData | Trendline spans data range
SpannedLabels | Spanned labels in tables headers and X-labels
StackedBars | Stacked bars
StayAtEdge | Labels stay where they were
SurfaceShading | Surface fill is drawn
Synchronised | Synchronised gridlines
Terminated | Terminated Min-Max
TicksBetween | TicksBetween – tickmarks between bars
TiledSurface | Tiled surfaces
TopAxis | Top X-Axis
TrendLine | Trend lines are drawn for each series
TrendSurface | Trend surface
ValueTags | Value tags are added to all data points
WallShading | Walls are shaded on 3D charts
WedgeZones | Wedge zones
XYPlot | XY Plot


SharpPlot 2.51 User Manual: Above gridlines - Y-label positioning

Above gridlines – Y-label positioning

Y axis labels are baselined on the gridlines rather than midlined.

sp.YAxisStyle = YAxisStyles.GridLines|YAxisStyles.AboveGrid;
sp.YTickStyle = YTickStyles.NoTicks;

This would generally be used with style ‘Inside’ to have the labels drawn within the chart area as well as baselined on the grid.


SharpPlot 2.51 User Manual: Altitude shading

Altitude shading

Applies graded colour to tiled response surfaces or contour plots.

sp.ResponsePlotStyle = ResponsePlotStyles.AltitudeShading;

This is best used with a computed (and therefore smooth) surface and can work well as a way to show experimental results where the outcome is a function of several variables.

Shading used with Contour plots

This example shows a fitted surface which is typical of height-map data. Temperature or pressure data would also be a good candidate for this style, using one of the accepted styles of false-color banding.

See also ...

SharpPlot | BubbleChartStyle | CloudChartStyle | ContourPlotStyle | ResponsePlotStyle


SharpPlot 2.51 User Manual: Angled labels - label placement

Angled labels – label placement

For simple XY plots you can have the X-axis labels drawn at an angle to the axis, with the angle set as you choose. The default is 34 degrees which looks reasonable for most charts and text.

For 3D charts either X labels or Y labels may be angled. In this case the labels are always drawn midlined along the projection of the corresponding tickmark or gridline.

sp.SetXLabels(new string[]{"Fat","Cat","Sat on mat"});
sp.SetYLabels(new string[]{"Here","we","go","Again"});
sp.XAxisStyle = XAxisStyles.AngledLabels;
sp.YAxisStyle = YAxisStyles.AngledLabels;

You cannot set the angle explicitly here – SharpPlot will choose the alignment for you depending on the perspective and viewpoint used.

See also ...

Perspective Property | SetViewpoint Method


SharpPlot 2.51 User Manual: Annotate model

Annotate model

Adds a note to each regression line giving the details of the model

sp.LineGraphStyle = LineGraphStyles.ModelFit|LineGraphStyles.AnnotateModel;

Intercept and slope are shown for a linear fit, coefficients for a higher-order curve.

See also ...

SharpPlot Members | LineGraphStyle Property | ScatterPlotStyle Property


SharpPlot 2.51 User Manual: Arrowed Axes

Arrowed Axes

Ends either axis with an arrowhead.

sp.XAxisStyle = XAxisStyles.ArrowedAxis;
sp.YAxisStyle = YAxisStyles.ArrowedAxis|YAxisStyles.AtEndCaption;
sp.YCaption = "Up";
sp.DrawLineGraph(col_S4,col_S2);

This style works with all the standard 2D charts. You may need to allow a little extra space for the captions, as the arrows extend the axis line slightly.


SharpPlot 2.51 User Manual: ArrowLines

ArrowLines

Ends each line with an arrowhead.

sp.LineGraphStyle = LineGraphStyles.ArrowLines;

This style works well with a set of separated curves (e.g. pessimistic and optimistic forecasts) and also with in-line keys.

See also ...

SharpPlot | DialChartStyle | LineGraphStyle | MinMaxChartStyle | PolarChartStyle | ScatterPlotStyle | VectorStyle


SharpPlot 2.51 User Manual: Caption written at the end of the Axis

Caption written at the end of the Axis

By default, SharpPlot writes the X-caption below the axis (at the right-hand end) and the Y-axis and Z-axis captions beside the axis aligned to the topmost tickmark. This style may be used to put the caption at the end of the axis instead.

sp.LineGraphStyle = LineGraphStyles.GridLines;
sp.Heading = "Both Axes have Captions at End";
sp.XAxisStyle = XAxisStyles.AtEndCaption;
sp.YAxisStyle = YAxisStyles.AtEndCaption;
sp.YCaption = "Up\nhere";
sp.XCaption = "Over\nthere";
sp.DrawLineGraph(col_S4,col_S2);

This works best with short (or multi-line) captions. The Y-caption will be wrapped into a width equal to twice the left margin.


SharpPlot 2.51 User Manual: Balanced Axis - force matching range about the zero point.

Balanced Axis – force matching range about the zero point.

This style constrains the computed axis range to balance about the zero line (there will be an odd number of tickmarks arranged symmetrically about zero).

sp.LineGraphStyle = LineGraphStyles.GridLines;
sp.Heading = "Vertical Axis is Balanced";

sp.YAxisStyle = YAxisStyles.ArrowedAxis|YAxisStyles.BalancedAxis|YAxisStyles.CenteredCaption;
sp.YCaption = "Variance against estimate";

This style works well with Synchronised tickmarks on a secondary axis.

See also ...

Synchronised gridlines


SharpPlot 2.51 User Manual: Boxed style

Boxed style

Draws a box around the entire chart, notes and keys, with optional background fill.

sp.FrameStyle = FrameStyles.Boxed;
sp.KeyStyle = KeyStyles.Boxed;
sp.NoteStyle = NoteStyles.Boxed;

The box is edged and filled using the current Frame style or Key style.

See also ...

SharpPlot | FrameStyle | KeyStyle | NoteStyle | TableStyle


SharpPlot 2.51 User Manual: BoxFrame style

BoxFrame style

For keys with an explicit frame, the default behavior for a boxed key is to draw the box around the text. This style forces the box to draw around the given frame, regardless of where the text goes.

sp.KeyStyle = KeyStyles.BoxFrame;

This style may be useful in debugging, as a way to check exactly where the frame is positioned.

See also ...

SetKeyFrame Method


SharpPlot 2.51 User Manual: Cells style

Cells style

Creates a collection of rectangles (using the current cellsize) centred around each plotted point. These can then be used by sp.NewCell which will use each cell in turn as the chart frame.

sp.LineGraphStyle = LineGraphStyles.CellsCreated;

This allows you to make a scatter-plot of miniature charts, for example using geographical co-ordinates to show details of samples taken at various locations.

See also ...

SharpPlot Members | LineGraphStyle Property | ScatterPlotStyle Property


SharpPlot 2.51 User Manual: CenteredCaption style

CenteredCaption style

Places the axis caption opposite the middle of either axis.

sp.XAxisStyle = XAxisStyles.CenteredCaption;
sp.YAxisStyle = YAxisStyles.CenteredCaption;

sp.YCaption = "Vertical caption is here";
sp.XCaption = "Horizontal caption is here";

Clearly, this style does not make sense if you set up 2 captions (tab-separated) for the axis.


SharpPlot 2.51 User Manual: Clamp lines to chart range

Clamp lines to chart range

This style may be used in conjunction with ‘clipped’ to remove points outside the span of the axes, and to force any out-of-range lines to follow the edge of the chart.

sp.YAxisStyle = YAxisStyles.ClampToAxis;

It may also be used independently on the x and y-axes if required. If surface-fill is selected, then this style is automatically applied if you choose ‘clipped’ as the surface cannot be completed otherwise.

See also ...

SharpPlot Members | YAxisStyle Property


SharpPlot 2.51 User Manual: Clip to axis range

Clip to axis range

This style may be used on the Linegraph or ScatterPlot to remove points outside the span of the axes, and clip any lines at the edge of the chart. Datum lines are also left undrawn if they fall beyond the axes.

sp.YAxisStyle = YAxisStyles.Clipped;

The style may also be used independently on the x and y-axes if required.

Note that if a marker survives clipping (for example it falls right on the boundary) it will normally be drawn completely, along with its value tags, even though these may fall partly outside the axis range. The only exception to this rule is for Framed axes when clipping is strictly to the frame boundary.

See also ...

SharpPlot | LineGraphStyle | ScatterPlotStyle | XAxisStyle | YAxisStyle


SharpPlot 2.51 User Manual: ClockFace scaling is used on Polar charts

ClockFace scaling is used on Polar charts

This style will force the polar chart to treat all x-values as times from 0:00 to 23:11. This applies to data and to tickmark settings, so that the example can be drawn with an XTick setting of (4,3) here.

sp.PolarChartStyle = PolarChartStyles.ClockFace;

Values above 24 are accepted, and simply wrap around.

See also ...

SharpPlot Members | PolarChartStyle Property


SharpPlot 2.51 User Manual: Coarse shading

Coarse shading

No interpolation is done on the altitude colors, so a simple blocky chart is produced. This is much faster to render, and can be used to explore different model fits quickly.

sp.ContourPlotStyle = ContourPlotStyles.Coarse;

The density setting is used to determine the accuracy of the grid-fit as normal.


SharpPlot 2.51 User Manual: Compass

Compass

This style will force the polar chart to treat all x-values as degrees. This applies to data and to tickmark settings, so that the example can be drawn with an XTick setting of (45,0) here.

sp.PolarChartStyle = PolarChartStyles.CompassPlot;

Values above 360 are accepted, and simply wrap around.

See also ...

SharpPlot Members | PolarChartStyle Property | PolarChartStyle Property


SharpPlot 2.51 User Manual: Contours on mesh surfaces

Contours on mesh surfaces

Draws contour lines at each major tickmark on the Z-axis.

sp.ScatterPlotStyle = ScatterPlotStyles.Contours;

Works with the modelfit and trend styles on the Cloud charts. The contour lines will appear smoother if a highr mesh density is used (the default is to compute the fitted surface at each X and Y major tickmark).

See also ...

SharpPlot | CloudChartStyle | CloudChartStyle | ResponsePlotStyle | ScatterPlotStyle


SharpPlot 2.51 User Manual: CrispEdges - cancel anti-aliasing on lines

CrispEdges – cancel anti-aliasing on lines

Turns off anti-aliasing on data lines.

sp.LineGraphStyle = LineGraphStyles.CrispEdges;

May be beneficial on linegraphs with mostly horizontal or vertical segments or very light lineweights.

See also ...

SharpPlot Members | LineGraphStyle Property | TraceChartStyle Property


SharpPlot 2.51 User Manual: Cropped style

Cropped style

When you clip data to either the X or Y axes, SharpPlot removes data points that lie outside the range and segments any lines at the boundaries. However it does not physically crop the image, as you generally want to see all of a marker that lies right on the edge.

By setting this style, you enforce cropping at the edges, so thick angled lines are trimmed to an oblique end and markers are only partly shown. Value tags may also be partly eliminated.

sp.LineGraphStyle |= LineGraphStyles.CroppedAxes;
sp.SetXRange(10);
sp.SetYRange(100);

sp.XAxisStyle = XAxisStyles.Clipped;
sp.YAxisStyle = YAxisStyles.Clipped;

Note that the cropping is done by the graphics engine used to output the final chart. All engines except VML support cropping very well, so this style will not work as you expect in charts output to VML.

The Framed Axes style always crops, as it assumes that nothing should show outside the frame.


SharpPlot 2.51 User Manual: Crossing Ticks

Crossing Ticks

All axes are drawn with crossing tickmarks.

sp.XTickStyle = XTickStyles.CrossingTicks;
sp.YTickStyle = YTickStyles.CrossingTicks;

This style applies to the tickmarks on individual axes, not the chart as a whole.

See also ...

SharpPlot Members | ITickStyle Property | XTickStyle Property | YTickStyle Property


SharpPlot 2.51 User Manual: Curves are used to join data points

Curves are used to join data points

Joins points using smooth curves, rather than straight lines.

sp.LineGraphStyle = LineGraphStyles.Curves;

Points are joined with computed (cubic) Bezier curves, where the smoothness is determined by the ‘flexibility’ parameter which may vary between zero (which joins the points with straight lines) to approx 12. The default value of 3 will normally give reasonable results. High values may start to draw loops and other artifacts on very noisy data series.

See also ...

SharpPlot | CloudChartStyle | LineGraphStyle | PolarChartStyle | ScatterPlotStyle


SharpPlot 2.51 User Manual: Decile whiskers on Boxplot

Decile whiskers on Boxplot

BoxWhisker indicates deciles with dotted lines.

sp.BoxPlotStyle = BoxPlotStyles.DecileWhiskers;

This may give a clearer picture of where the ‘core’ of the distribution lies.

See also ...

SharpPlot Members | BoxPlotStyle Property


SharpPlot 2.51 User Manual: Dissected arrows on Vector plot

Dissected arrows on Vector plot

Arrows are drawn starting and ending a little way from the nodes

sp.VectorStyle = VectorStyles.Dissected;

This is a good style for a directed graph if the nodes have already been drawn as a scatter plot.

See also ...

SharpPlot Members | VectorStyle Property


SharpPlot 2.51 User Manual: Directional Min-Max

Directional Min-Max

The ‘Drift’ style applies only to the Min-Max chart and restricts any line terminators to the 2nd set of values. This is not necessarily the ‘high’ end of the line, so you can use this option to show movement either upwards or downwards.

sp.MinMaxChartStyle = MinMaxChartStyles.DriftMarkers;

This style applies when the chart has either ‘terminators’, ‘arrowheads’ or ‘errorbars’ at the line ends.

See also ...

SharpPlot Members | MinMaxChartStyle Property


SharpPlot 2.51 User Manual: Duplicated Axes

Duplicated Axes

This style may be used for either the X or Y axes to repeat the axis on the far edge of the chart area. Labels and tickmarks will be redrawn as for the primary axis.

sp.XAxisStyle = XAxisStyles.DuplicateAxes;
sp.YAxisStyle = YAxisStyles.DuplicateAxes;
sp.DrawLineGraph(col_S4);

The style applies to all the rectangular 2D charts.

See also ...

Duplicated Tickmarks


SharpPlot 2.51 User Manual: Duplicated Tickmarks

Duplicated Tickmarks

This style may be used for either the X or Y axes to repeat the tickmarks on the far edge of the chart area. Its main use is for charts with the ‘FramedAxes’ style where it may be useful to have the ticks continued around all four sides.

sp.LineGraphStyle = LineGraphStyles.FrameAxes|LineGraphStyles.GridLines;
sp.XTickStyle = XTickStyles.DuplicateTicks;
sp.YTickStyle = YTickStyles.DuplicateTicks;
sp.DrawLineGraph(col_S4);

The style applies to all the rectangular 2D charts.

See also ...

Duplicated Axes


SharpPlot 2.51 User Manual: Duration formatting

Duration formatting

This style may be used on either the X or Y axis to format elapsed times as hours,mins,sec. Typically the data will be given in seconds or minutes.

sp.YAxisStyle = YAxisStyles.Duration;

The data will be formatted as 00:00 up to 59:59 then as 01:00:00 for all values. This allows this style to be used for seconds or minutes and labelled appropriately. Tickmarks, datumlines etc are given in the units of the data here.


SharpPlot 2.51 User Manual: Shaded envelope is used on MinMax plots

Shaded envelope is used on MinMax plots

Shade region within Hi-Lo bounds on MinMax chart.

sp.MinMaxChartStyle = MinMaxChartStyles.Envelope;

This can be used as a backdrop to a timeseries to show ‘historic’ range.

See also ...

SharpPlot Members | MinMaxChartStyle Property


SharpPlot 2.51 User Manual: ErrorBars are added to MinMax plots

ErrorBars are added to MinMax plots

Adds ‘T-pieces’ to each end of Min-max charts to make traditional-style error-bars – you can restrict the bars to the ‘far’ end of each bar with the ‘drift’ style.

sp.MinMaxChartStyle = MinMaxChartStyles.ErrorBars;
sp.BoxPlotStyle = BoxPlotStyles.ErrorBars;

The bars scale in proportion to the current pen width weight.

The effect is similar when the style is used with the Box-and-Whisker chart.

See also ...

SharpPlot Members | BoxPlotStyle Property | MinMaxChartStyle Property


SharpPlot 2.51 User Manual: Axis range is not taken to the next major tickmark

Axis range is not taken to the next major tickmark

By default SharpPlot rounds the scale to a major tickmark interval in both directions. If these ticks are well spaced out (for example annual data with 11 minor ticks at the month boundaries) it is often better just to span the range of the data.

sp.SetXTickMarks(20,3);
sp.Heading = "X-Axis Fits the Data Range Exactly";
sp.XAxisStyle = XAxisStyles.ForceZero|XAxisStyles.ExactFit;
sp.DrawLineGraph(col_S1,col_S2);

This style is currently only available on the X-axis. It is often coupled with ForceZero (as here) to make the lower value round back nicely.


SharpPlot 2.51 User Manual: Exploded Axes

Exploded Axes

This style moves the axes back from the plotting area by one major tick-mark length. It is commonly used on scatterplots where many points fall close to the axis.

sp.LineGraphStyle = LineGraphStyles.ExplodeAxes;

The style applies to all the rectangular 2D charts, and may be used on Multiples to separate the axes on the individual charts within the trellis.

See also ...

SharpPlot | BarChartStyle | BoxPlotStyle | GanttChartStyle | HistogramStyle | LineGraphStyle | MinMaxChartStyle | ScatterPlotStyle | StepChartStyle | TraceChartStyle | XBarChartStyle


SharpPlot 2.51 User Manual: Farthest first on piecharts

Farthest first on piecharts

Drawing order allows 3D extrusion.

sp.PieChartStyle = PieChartStyles.FarthestFirst;

Useful only for charts rendered as VML.

See also ...

SharpPlot Members | PieChartStyles Enumeration


SharpPlot 2.51 User Manual: Filled lines

Filled lines

Completes each line back to its starting point and fills the area in between.

sp.LineGraphStyle = LineGraphStyles.Filled;

You may need to construct the lines quite carefully to get the required effect.

See also ...

SharpPlot Members | LineGraphStyle Property | VennDiagramStyle Property


SharpPlot 2.51 User Manual: Fine shading

Fine shading

Very detailed is done on the altitude colors, giving an illusion of smoothly graded color. This may be very slow to render in vector formats such as SVG.

sp.ContourPlotStyle = ContourPlotStyles.Fine;
sp.CloudChartStyle = CloudChartStyles.Fine;

The density setting is used to determine the accuracy of the grid-fit as normal, then each tile is divided assuming that the surface is locally linear.


SharpPlot 2.51 User Manual: Flat text for 3D labelling

Flat text for 3D labelling

Forces all labels and captions on 3D charts to be drawn horizontally.

sp.CloudChartStyle = CloudChartStyles.FlatText;
sp.CaptionStyle = CaptionStyles.FlatText;
sp.LabelStyle = LabelStyles.FlatText;
sp.CloudChartStyle = CloudChartStyles.FlatText;

This is recommended for VML charts which handle rotated text very badly. It may be applied individually to labels or captions.

See also ...

SharpPlot | CaptionStyle | CloudChartStyle | LabelStyle | ResponsePlotStyle | TowerChartStyle | XAxisStyle


SharpPlot 2.51 User Manual: Floating bars

Floating bars

Stacked barcharts are drawn omitting the first bar to give a floating effect.

sp.BarChartStyle = BarChartStyles.FloatingBars;

For horizontal floating charts it may be easier to use the Gantt chart here.

See also ...

SharpPlot Members | BarChartStyle Property | XBarChartStyle Property


SharpPlot 2.51 User Manual: Force Modelfit through zero

Force Modelfit through zero

The fitted model is forced to have zero intercept on both axes.

sp.SetOrderOfFit(2,2);
sp.EquationStyle = EquationStyles.Middle|EquationStyles.Below|EquationStyles.ForceOrigin;
sp.EquationFormat = "y = C0 + C1x + C2x²";

If the order of fit is 1, this corresponds to the LNT (Linear No Threshold) model which is used by default when there is insufficient information to support a more realistic scenario.

Note that the zeroth term in the equation formatter is eliminated for you..

See also ...

EquationFormat Property | SetOrderOfFit Method


SharpPlot 2.51 User Manual: Forcezero

Forcezero

All axes are forced to include the origin (for scatterplots and cloud charts).

sp.ScatterPlotStyle = ScatterPlotStyles.ForceZero;
sp.XAxisStyle = XAxisStyles.ForceZero;

This style also can be applied individually to each axis.

See also ...

SharpPlot | BarChartStyle | BoxPlotStyle | IAxisStyle | PolarChartStyle | ResponsePlotStyle | ScatterPlotStyle | TowerChartStyle | XAxisStyle | XBarChartStyle | YAxisStyle | ZAxisStyle


SharpPlot 2.51 User Manual: Framed axes

Framed axes

The axes are completed to form a frame around the chart. This style is supported by all the conventional 2D charts.

sp.LineGraphStyle = LineGraphStyles.FrameAxes;

This also prevents the axes from extending beyond the final tickmarks. This style is often combined with inward-pointing tickmarks. All chart elements (lines, markers etc) are clipped at the frame boundary regardless of whether Clipping is explicitly requested on any axes.

Note that the cropping is done by the graphics engine used to output the final chart. All engines except VML support cropping very well, so this style will not work as you expect in charts output to VML if any data points are outside the frame.

See also ...

SharpPlot | BarChartStyle | BoxPlotStyle | GanttChartStyle | HistogramStyle | LineGraphStyle | MinMaxChartStyle | ScatterPlotStyle | StepChartStyle | TraceChartStyle | XBarChartStyle


SharpPlot 2.51 User Manual: Gridlines

Gridlines

Gridlines are drawn from major tickmarks on all axes. This style is supported by all the conventional charts.

sp.LineGraphStyle = LineGraphStyles.GridLines;
sp.XAxisStyle = XAxisStyles.GridLines;

This style can also be set individually by axis.

See also ...

SharpPlot | BarChartStyle | BoxPlotStyle | CloudChartStyle | GanttChartStyle | LineGraphStyle | MinMaxChartStyle | PolarChartStyle | ResponsePlotStyle | ScatterPlotStyle | StepChartStyle | TableStyle | TowerChartStyle | TraceChartStyle | XAxisStyle | XBarChartStyle | YAxisStyle | ZAxisStyle


SharpPlot 2.51 User Manual: Growth curve

Growth curve

An exponential growth curve is fitted through the data (scatterplots and linegraphs).

sp.LineGraphStyle = LineGraphStyles.GrowthCurve;

The line may be annotated with the computed growth rate.

See also ...

SharpPlot Members | LineGraphStyle Property | ScatterPlotStyle Property | Annotate model


SharpPlot 2.51 User Manual: Halo markers

Halo markers

Markers have a halo drawn beneath them in the chart background colour.

sp.LineGraphStyle = LineGraphStyles.HaloMarkers;

This generally improves visibility, but can result in obscured markers in a very crowded scatterplot.

See also ...

SharpPlot | CloudChartStyle | LineGraphStyle | PolarChartStyle | ResponsePlotStyle | ScatterPlotStyle


SharpPlot 2.51 User Manual: Hollow center on Polar charts

Hollow center on Polar charts

Polar gridlines radiate from the first tick.

sp.PolarChartStyle = PolarChartStyles.HollowCenter;

For charts with a very ‘busy’ radial grid, this reduces the dartboard effect.

See also ...

SharpPlot Members | PolarChartStyle Property


SharpPlot 2.51 User Manual: Horizontal

Horizontal

Barcharts, Boxplots, Stepcharts and Min-max charts may be drawn horizontally.

sp.BarChartStyle = BarChartStyles.Horizontal;

This does NOT change the meaning of the X and Y axes, so to label the bars, you must use Y-labels here. The same applies to other chart types which support this style, for example a population pyramid may be contructed with a horizontal stepchart:

sp.StepChartStyle = StepChartStyles.Horizontal|StepChartStyles.ValueTags|StepChartStyles.SurfaceShading;
sp.ValueTagFormat = "##9.9%";
sp.YAxisStyle = YAxisStyles.MiddleLabels;

Value tags are always drawn horizontally with this chart style.

See also ...

SharpPlot | BarChartStyle | BoxPlotStyle | MinMaxChartStyle | XBarChartStyle


SharpPlot 2.51 User Manual: Indexed data

Indexed data

Data is indexed to the initial value = 100.

sp.LineGraphStyle = LineGraphStyles.Indexed;

This is often used to compare series such as currencies or share prices.

See also ...

SharpPlot | BarChartStyle | CloudChartStyle | LineGraphStyle | MinMaxChartStyle | PolarChartStyle | StepChartStyle | TowerChartStyle | XBarChartStyle


SharpPlot 2.51 User Manual: Inline keys

Inline keys

The legend text is written at the right-hand end of each series.

sp.KeyStyle = KeyStyles.InlineWithData;

This style works well with arrowed lines. Note that you will need to allow sufficient space in the right margin for the legend text, and that this style should only be used if you are sure that the series are well separated vertically.

See also ...

ArrowLines


SharpPlot 2.51 User Manual: Inside Labels

Inside Labels

Either X or Y axis labels may be written inside the chart area

sp.YAxisStyle = YAxisStyles.GridLines|YAxisStyles.RightAxis|YAxisStyles.InsideLabels|YAxisStyles.AboveGrid;
sp.YTickStyle = YTickStyles.NoTicks;

This style would normally be combined with ‘AboveGrid’ in the Y-Axis case or with ‘Middle’ in the X-Axis case to avoid the labels colliding with gridlines.


SharpPlot 2.51 User Manual: Inside Ticks

Inside Ticks

Axis is drawn with positive (inward-pointing) ticks. This is typically used with duplicate X or Y axes or a framed chart.

sp.XTickStyle = XTickStyles.InsideTicks;

This style is always applied to the tickmarks on individual axes, rather than the chart as a whole.

See also ...

SharpPlot Members | ITickStyle Property | XTickStyle Property | YTickStyle Property


SharpPlot 2.51 User Manual: Inverted Y-scale

Inverted Y-scale

The Y-scale is drawn down from the top.

sp.Heading = "Top X-Axis with Inverted Y-Axis";
sp.XAxisStyle = XAxisStyles.ArrowedAxis|XAxisStyles.AtEndCaption|XAxisStyles.TopAxis;
sp.YAxisStyle = YAxisStyles.ArrowedAxis|YAxisStyles.InvertAxis|YAxisStyles.AtEndCaption;
sp.YCaption = "Depth (m)";
sp.XCaption = "Distance from Shore (m)";

This style would always be used with XAxisStyle set to TopAxis – typically to plot depth below ground or sample age. Pollen diagrams are typical.


SharpPlot 2.51 User Manual: Invisible axes

Invisible axes

All axes are made invisible, but tickmarks, gridlines and labels are still drawn as usual.

sp.XAxisStyle = XAxisStyles.InvisibleAxis;

This style should be applied to individual axes rather than the entire chart. For Polar charts it only applies to the Y (radial) axis.

See also ...

SharpPlot Members | XAxisStyle Property | YAxisStyle Property


SharpPlot 2.51 User Manual: Kite charts

Kite charts

Trace charts are mirrored and filled to make a ‘kite’ chart presentation.

sp.TraceChartStyle = TraceChartStyles.KiteDiagram;

This is commonly used to plot vegetation coverage or the results of pollen analysis.

See also ...

SharpPlot Members | TraceChartStyle Property


SharpPlot 2.51 User Manual: Lines are drawn between points

Lines are drawn between points

Lines are drawn between data-points on linegraphs and scatterplots. This is the default for linegraphs, so style ‘NoLines’ must be used to remove them.

sp.ScatterPlotStyle = ScatterPlotStyles.Lines;

Points are connected by straight lines unless the ‘Curves’ style is used. Use the ‘trend’ style to draw an approximate smooth curve through the data without visiting all the points.

See also ...

SharpPlot | BarChartStyle | BoxPlotStyle | CloudChartStyle | DialChartStyle | GanttChartStyle | LineGraphStyle | MinMaxChartStyle | PolarChartStyle | ResponsePlotStyle | ScatterPlotStyle | StepChartStyle | TableStyle | TowerChartStyle | TraceChartStyle | VennDiagramStyle | XAxisStyle | XBarChartStyle | YAxisStyle | ZAxisStyle | SetXDatumLines | SetYDatumLines | Curves | Trend


SharpPlot 2.51 User Manual: Log Scales on both Axes

Log Scales on both Axes

This scatterplot style is a quick way to get engineering graph paper.

sp.ScatterPlotStyle = ScatterPlotStyles.GridLines|
                 ScatterPlotStyles.ModelFit|
                 ScatterPlotStyles.AnnotateModel;
sp.EquationStyle = EquationStyles.Middle;
sp.EquationFormat = "Exponent = C1";

This example shows how the daily movements of stock prices typically follow a power-law, rather than being distributed in a well-behaved ‘bell curve’ distribution.


SharpPlot 2.51 User Manual: Logarithmic Scales

Logarithmic Scales

The base-10 log of the data is plotted and tickmarks are adjusted appropriately.

sp.LineGraphStyle = LineGraphStyles.GridLines;
sp.Heading = "Y-Axis uses a Logarithmic Scale";
sp.YAxisStyle = YAxisStyles.ForceZero|YAxisStyles.LogScale;
sp.XAxisStyle = XAxisStyles.ForceZero;
sp.DrawLineGraph(col_S1,col_S2);

If ForceZero is used on a logarithmic axis, the scale is actually forced to 1 as zero is meaningless here.


SharpPlot 2.51 User Manual: Markers drawn

Markers drawn

Markers are drawn at datapoints on linegraphs. This is the default for ScatterPlots and CloudCharts – use style ‘NoLines’ to cancel it.

sp.LineGraphStyle = LineGraphStyles.Markers;

You can use the BubbleChart to scale individual markers to add an extra ‘dimension’ to the data.

See also ...

SharpPlot | CloudChartStyle | LineGraphStyle | MinMaxChartStyle | PolarChartStyle | ResponsePlotStyle | ScatterPlotStyle | SetMarkers | Halo


SharpPlot 2.51 User Manual: Merged row-labels

Merged row-labels

Similar row-labels are merged.

sp.TableStyle = TableStyles.Merged;

This currently applies only to the Y-labels (row-stubs) on tables.

See also ...

SharpPlot Members | TableStyle Property | Spanned labels in tables headers and X-labels


SharpPlot 2.51 User Manual: MiddleLabels - labels go between ticks

MiddleLabels – labels go between ticks

X or Y-axis labels are place between major tickmarks..

sp.XAxisStyle = XAxisStyles.MiddleLabels;
sp.BarChartStyle = BarChartStyles.TicksBetween;

This would generally be used with the ‘TicksBetween’ style on barcharts.

See also ...

SharpPlot Members | XAxisStyle Property | YAxisStyle Property | TicksBetween – tickmarks between bars


SharpPlot 2.51 User Manual: Minor Tickmarks

Minor Tickmarks

This style may be used for either the X or Y axes to insert minor ticks automatically.

sp.SetYTickMarks(50);
sp.XTickStyle = XTickStyles.MinorTicks;
sp.YTickStyle = YTickStyles.MinorTicks;
sp.DrawLineGraph(col_S4);

The style applies to all the rectangular 2D charts. For more exact control, set the second element of X/Y Tickmarks to the required number of minor ticks between each major.

See also ...

SetXTickMarks Method | SetYTickMarks Method


SharpPlot 2.51 User Manual: Modelfit

Modelfit

A simple regression model is fitted to the data.

sp.LineGraphStyle = LineGraphStyles.ModelFit;

The default is a linear ‘straight-line’ fit but you can use the Order of Fit setting to fit models up to quartics. The line may be annotated with the regression coefficients. The ‘zeroth’ coefficient is the intercept value, and there will be as many further coefficients as the order of fit.

Fitting 3D data

If the modelfit style is used with the cloud chart, the fit is made against both X and Y axes, and the order of fit may be set independently for either.

Here, the model is quadratic in both X and Y. Contour lines are shown, and risers have been used to show the residual values in the Z-direction.

See also ...

SharpPlot | CloudChartStyle | LineGraphStyle | ScatterPlotStyle | SetModelSpan


SharpPlot 2.51 User Manual: No Axes are drawn

No Axes are drawn

No axes are drawn. This is often appropriate on 3D plots, or if the chart is simply illustrating the shape of some function.

sp.LineGraphStyle = LineGraphStyles.NoAxes;

This style may be applied to individual axes if required.

See also ...

SharpPlot | BarChartStyle | BoxPlotStyle | CloudChartStyle | GanttChartStyle | LineGraphStyle | MinMaxChartStyle | PolarChartStyle | ResponsePlotStyle | ScatterPlotStyle | StepChartStyle | TowerChartStyle | TraceChartStyle | XBarChartStyle


SharpPlot 2.51 User Manual: No Axis is drawn

No Axis is drawn

The appropriate axis is not drawn. This may be used with either X or Y axes, or may be applied to the chart as a whole.

sp.YAxisStyle = YAxisStyles.NoAxis;
sp.XTickStyle = XTickStyles.NoTicks;
sp.Heading = "Y-Axis is not Required Here";
sp.SetValueFont("Arial",14,FontStyle.Bold,Color.Green);
sp.SetLabelFont("Arial",10,FontStyle.Bold,Color.Navy);
sp.DrawBarChart(new int[] {10,26,31,42});

This style is generally used where the value tags provide sufficient information on the data.


SharpPlot 2.51 User Manual: No lines are drawn on Linegraphs

No lines are drawn on Linegraphs

No lines are drawn (this turns off the default behavior) on LineGraphs and MinMax charts.

sp.LineGraphStyle = LineGraphStyles.NoLines;

This would generally be used with one of the complementary styles such as Risers or Markers. It could also be used if you only wanted to display the trendline or modelfit.

See also ...

SharpPlot | LineGraphStyle | MinMaxChartStyle | PolarChartStyle | ResponsePlotStyle


SharpPlot 2.51 User Manual: No markers are drawn on Scatterplots

No markers are drawn on Scatterplots

No markers are drawn (turns off the default behavior) on ScatterPlots and CloudCharts.

sp.ScatterPlotStyle = ScatterPlotStyles.NoMarkers;

This would generally be used with one of the complementary styles such as Risers. It could also be used if you only wanted to display the trendline or modelfit.

See also ...

SharpPlot Members | CloudChartStyle Property | ScatterPlotStyle Property


SharpPlot 2.51 User Manual: NormalCurve on Histograms

NormalCurve on Histograms

Histogram shows a fitted Normal Distribution.

sp.HistogramStyle = HistogramStyles.NormalCurve;

This can be used to check for a distribution which is statistically tractable.

See also ...

SharpPlot Members | HistogramStyle Property


SharpPlot 2.51 User Manual: No Tags

No Tags

Contour lines are drawn without tags giving the altitude value of each line

sp.ContourPlotStyle = ContourPlotStyles.NoTags;

This style may be appropriate for altitude-shaded charts.


SharpPlot 2.51 User Manual: No Tickmarks

No Tickmarks

No tickmarks are drawn, but labels and gridlines appear as normal at the major tick interval.

sp.XTickStyle = XTickStyles.NoTicks;
sp.YTickStyle = YTickStyles.NoTicks;

This style may be applied to individual axes if required.

See also ...

SharpPlot | ITickStyle | XTickStyle | YTickStyle | ZTickStyle


SharpPlot 2.51 User Manual: No wrapping

No wrapping

Applies to most text items – wrapping to the ‘natural’ margins is turned off.

// Turn off wrapping on heading and legend
 sp.Heading = "This text would normally be wrapped at the paper edge";
 sp.Subheading = "This text would normally be wrapped at the chart margins";
 sp.HeadingStyle = HeadingStyles.NoWrap;

 sp.SetKeyText(new string[] {"Data points are here","Fitted trend is here too"});
 sp.KeyStyle = KeyStyles.Vertical|KeyStyles.NoWrap;

Depending on the output medium chosen, this may result in text being clipped at either edge of the chart.


SharpPlot 2.51 User Manual: Omit last X-label

Omit last X-label

The rightmost X-axis label is not drawn

sp.XAxisStyle = XAxisStyles.OmitLastLabel;

This can be used to avoid text collisions which SharpPlot is not aware of.


SharpPlot 2.51 User Manual: OnTopModel

OnTopModel

Fitted models and trendlines are drawn after the data is plotted, and so appear on top.

sp.LineGraphStyle = LineGraphStyles.OnTopModel;

The default is to drawn the fitted curve first so that it does not hide the datapoints. This style would be used if the model was more important than the data it had been derived from.

See also ...

SharpPlot Members | LineGraphStyle Property


SharpPlot 2.51 User Manual: Origin Marker on Polar charts

Origin Marker on Polar charts

Marks the centre of polar charts with a dot.

sp.PolarChartStyle = PolarChartStyles.OriginMarker;

Useful when the chart has a filled surface which can make it hard to read the values.

See also ...

SharpPlot Members | PolarChartStyle Property


SharpPlot 2.51 User Manual: Overlayed gridlines

Overlayed gridlines

Draws the gridlines ontop of the data. May be set as ‘style’, ‘xstyle’ or ‘ystyle’ to control the axis grids independently.

sp.BarChartStyle = BarChartStyles.OverlayGrid;
sp.YAxisStyle = YAxisStyles.OverlayGrid;

The example shows a typical barchart from Tufte’s book, using white gridlines to achieve the ‘dissected’ effect he recommends.

See also ...

SharpPlot | BarChartStyle | BoxPlotStyle | GanttChartStyle | LineGraphStyle | PolarChartStyle | ScatterPlotStyle | StepChartStyle | XAxisStyle | XBarChartStyle | YAxisStyle


SharpPlot 2.51 User Manual: Parity plot

Parity plot

Forces a ScatterPlot to be drawn with identical x and y axes, and adds a leading diagonal axis with optional tolerance guidelines.

sp.SetMarkers(Marker.Bullet);
sp.ScatterPlotStyle = ScatterPlotStyles.Parity;
sp.Heading = "Parity Plot of Data vs Fit";
sp.ParityTolerance = 10;
sp.ParityStyle = ParityStyles.Absolute;

This chart is generally used to compare a theoretical behaviour with actual data, and to look out for values which exceed some preset tolerance. The limits may be drawn at fixed values (as here) or as percentage or ratio values.


SharpPlot 2.51 User Manual: Plain PieChart or Tower

Plain PieChart or Tower

Pie labels are drawn without spider tags, and tower charts have all three axes drawn with the PlainAxis style.

sp.PieChartStyle = PieChartStyles.ValueTags|PieChartStyles.Plain;
sp.SetXLabels(new string[] {"Fred","Joe","Harry"});
sp.ValueTagStyle = ValueTagStyles.Inside;
sp.SetValueFont("Arial",16,FontStyle.Bold,Color.Yellow);
sp.SetLabelFont("Arial",18,Color.Black);

sp.DrawPieChart(new int[] {7,5,3});


SharpPlot 2.51 User Manual: Plain axes are used (no ticks or labels)

Plain axes are used (no ticks or labels)

Axes are drawn without tickmarks or labels. Gridlines will be drawn if this style is set. It is often used with X/Y styles ‘Arrowed’ when illustrating a simple curve.

sp.XAxisStyle = XAxisStyles.PlainAxis;

This style may be applied to individual axes if required.

See also ...

SharpPlot Members | KeyStyle Property | TowerChartStyle Property


SharpPlot 2.51 User Manual: Project Contours on XY-plane

Project Contours on XY-plane

Contour lines on fitted surfaces are drawn on the xy-plane, rather than around the ‘hills’.

sp.CloudChartStyle = CloudChartStyles.ProjectContours;

You can also use contour lines on the standard 2D scatter plot to get a more detailed surface map.

See also ...

SharpPlot Members | CloudChartStyle Property


SharpPlot 2.51 User Manual: Markers are scaled to radius

Markers are scaled to radius

Bubblecharts normally scale so that the marker area is proportional to the data values. This style sets the marker radius in proportion to the data.

sp.BubbleChartStyle = BubbleChartStyles.RadialScaling;

This style would be correct for unfilled markers such as Lozenge or Ring.

See also ...

DrawBubbleChart Method


SharpPlot 2.51 User Manual: Relative data

Relative data

Data is assumed to be relative, so the series values are accumulated as each series is plotted.

sp.DataStyle = DataStyles.Relative;

This is the default style for stacked or floating barcharts but must be set explicitly for shaded surfaces on LineGraphs. It may be used in any other chart to have the series summed.

See also ...

SharpPlot Members | DataStyles Enumeration


SharpPlot 2.51 User Manual: Risers from axis or data

Risers from axis or data

Risers are drawn from the X-axis (or XY-plane in 3D charts) to each datapoint. If a baseline is defined, this is used as the target for the risers, rather than the axis.

sp.LineGraphStyle = LineGraphStyles.Risers;

For polar charts the risers are drawn as radial lines from the centre.

Using risers to show residuals

When a modelfit or trend surface has been used in a Scatter plot or Cloud chart (3D scatter) the risers are drawn from the regression line or fitted surface to each datapoint, rather than from the X-axis or XY-plane.

This provides a quick visual check of the residuals, and may help to locate the datapoints relative to the fitted surface in the projection of the 3D chart.

See also ...

SharpPlot | CloudChartStyle | HistogramStyle | LineGraphStyle | PolarChartStyle | ResponsePlotStyle | ScatterPlotStyle | StepChartStyle


SharpPlot 2.51 User Manual: Rooted vectors

Rooted vectors

The start point of each vector is marked with the current marker.

sp.VectorStyle = VectorStyles.Rooted;

This could be used (along with Terminated) to draw all the nodes on a directed graph.

See also ...

VectorStyle Property


SharpPlot 2.51 User Manual: Rose diagram

Rose diagram

The Rose diagram is often used to show discrete data collected around a compass – for example orientation of pebbles in a streambed to give a feel for the direction of current flow.

sp.PieChartStyle = PieChartStyles.RoseDiagram;

It may be necessary to scale the data to fit the diagram nicely on the page.

See also ...

SharpPlot Members | PieChartStyles Enumeration


SharpPlot 2.51 User Manual: Rounded corners

Rounded corners

You can round off the corners of the chart frame, the key box and any boxed notes.

sp.KeyStyle = KeyStyles.Boxed|KeyStyles.Rounded;
sp.NoteStyle = NoteStyles.Boxed|NoteStyles.Rounded;

You may need to increase the chart margins if you use a rounded frame.

See also ...

SharpPlot | FrameStyle | KeyStyle | NoteStyle | TableStyle


SharpPlot 2.51 User Manual: Data is in rows, not columns

Data is in rows, not columns

Generally, a nested structure such as double[][] is taken to imply one series per element of the outer structure. If your data is more naturally organised the other way around, you can pass the same structure, but have the inner elements taken as the series values, effectively transposing the data matrix.

sp.DataStyle = DataStyles.Rows;

This is particularly useful when a simple vector of values represents one element from a set of different series. Because SharpPlot applies the color cycles to each series, this gives you a simple way to color the bars of a barchart individually, or have a different marker for each data value. Legend placeholders will be also created, one per item.

See also ...

SharpPlot Members | DataStyles Enumeration


SharpPlot 2.51 User Manual: Scale bar for Bubble and Altitude-shaded plots

Scale bar for Bubble and Altitude-shaded plots

Contour plots and 3D fitted surfaces may be ‘altitude shaded’ with a smooth gradient between given colors. This style adds a calibration bar in the right margin to allow you to read the data value from the color.

sp.ContourPlotStyle = ContourPlotStyles.ScaleBar;
sp.CloudChartStyle = CloudChartStyles.ScaleBar;

The labels on the bar are written with the current Key font setting, and the Z-axis caption is used to write the caption above it. Lines are drawn across the bar at the z-tickmark intervals, and the lines are drawn with the current contour style.

The style works for Cloud Chart, Contour Plot, Response Surface and Bubble Chart with AltitudeShading.

The style also works for Bubble Charts with no altitude shading, in which case the scale bar show bubble sizes.

See also ...

SharpPlot | BubbleChartStyle | CloudChartStyle | ContourPlotStyle | ResponsePlotStyle | Altitude


SharpPlot 2.51 User Manual: Segmented lines are used at missing values

Segmented lines are used at missing values

Normally, lines are continued across missing values, joining the points on each side. This style forces the line to break either side of missing data. Applies to LineGraphs and StepCharts when these are not surface shaded.

sp.LineGraphStyle = LineGraphStyles.SegmentLines;

Note that no line will be drawn unless there are at least 2 points between any run of missing values.

See also ...

SharpPlot Members | LineGraphStyle Property | StepChartStyle Property


SharpPlot 2.51 User Manual: Shadowed boxes are drawn

Shadowed boxes are drawn

Adds a drop shadow to the box around the chart frame, notes, and keys.

sp.NoteStyle = NoteStyles.Shadowed;

The shadow offset will be increased in proportion to the line-weight of the box.

See also ...

SharpPlot | FrameStyle | KeyStyle | NoteStyle | TableStyle | SvgMode


SharpPlot 2.51 User Manual: Repeated values are suppressed

Repeated values are suppressed

Multiple occurences of the same Y-value are treated as missing values.

sp.LineGraphStyle = LineGraphStyles.GridLines|LineGraphStyles.SkipRepeats|LineGraphStyles.Markers|LineGraphStyles.NoLines
sp.Heading = "Repeated Y-values are Treated as Missing";
sp.DrawLineGraph(col_SR,col_S2);

This style could be used to eliminate long runs of identical values, typical of many data-logging devices.


SharpPlot 2.51 User Manual: Runs of values are suppressed

Runs of values are suppressed

Multiple occurences of the same Y-value are treated as missing values, but the first and last of each run are retained.

sp.LineGraphStyle = LineGraphStyles.GridLines|LineGraphStyles.SkipRuns|LineGraphStyles.Markers;
sp.Heading = "Runs of Identical Y-values are Unmarked";
sp.DrawLineGraph(col_SR,col_S2);

This style could be used to eliminate long runs of identical values, typical of many data-logging devices.


SharpPlot 2.51 User Manual: Trendline spans data range

Trendline spans data range

The fitted line is not extended beyond the extreme points on the x-axis

// Set equation under the chart and span the reqression line
 sp.EquationStyle = EquationStyles.Middle|EquationStyles.Below|EquationStyles.SpanData;
 sp.EquationFormat = "y = C0 + C1x";

This may be a useful setting if several regressions are made through subsets of the data.


SharpPlot 2.51 User Manual: Spanned labels in tables headers and X-labels

Spanned labels in tables headers and X-labels

Column headers on table charts are spanned across empty or identical cells. Where a column is spanned, the vertical grid is omitted from between the merged cells. Multi-line X-axis labels are spanned across several tickmarks to show hierarchical time periods (e.g. months, quarters, years)

sp.TableStyle = TableStyles.Spanned;
sp.XAxisStyle = XAxisStyles.SpannedLabels;

Titles will span across as many empty cells as are available. This style also applies to the horizontal axis labels.

sp.SetXLabels(col_Subsect);
sp.BarChartStyle = BarChartStyles.ForceZero|BarChartStyles.TicksBetween;
sp.SetAxisStyle(Color.Black,LineStyle.Solid,1);
sp.XAxisStyle = XAxisStyles.MiddleLabels|XAxisStyles.SpannedLabels;
sp.SetXTickLengths(new int[] {100,0,180,0,0,180});
sp.XDatumThreshold = 200;
sp.LabelLineSpacing = 1.4;

Note the use of simple HTML tags to format the lower row of labels in bold text.

See also ...

SharpPlot Members | ScatterPlotStyle Property | TableStyle Property


SharpPlot 2.51 User Manual: Stacked bars

Stacked bars

Barcharts will accumulate and stack multiple data series.

sp.BarChartStyle = BarChartStyles.StackedBars;

To have the first bar not drawn, use the ‘floating’ style here.

See also ...

SharpPlot Members | BarChartStyle Property | XBarChartStyle Property | Floating bars


SharpPlot 2.51 User Manual: Labels stay where they were

Labels stay where they were

When axes are placed explicitly in the chart area, it is often better to have labels and captions remain where they were.

sp.Heading = "The Y-caption & Labels Stay out of the Chart";
sp.LineGraphStyle = LineGraphStyles.GridLines;
sp.XIntercept = 40;
sp.YIntercept = 100;
sp.YAxisStyle = YAxisStyles.AtEndCaption|YAxisStyles.StayAtEdge;
sp.XAxisStyle = XAxisStyles.StayAtEdge;

This style applies to both X and Y axes.


SharpPlot 2.51 User Manual: Surface fill is drawn

Surface fill is drawn

Line, Step and Polar charts are shaded down to the X-axis or in to the centre.

sp.LineGraphStyle = LineGraphStyles.SurfaceShading;

If a chart baseline is set, this is used as the target for the surface fill rather than the X-axis. Surface fills look good with markers turned off and maybe with risers (as here).

See also ...

SharpPlot | CloudChartStyle | HistogramStyle | LineGraphStyle | PolarChartStyle | StepChartStyle | TraceChartStyle


SharpPlot 2.51 User Manual: Synchronised gridlines

Synchronised gridlines

Applies only to a secondary Y-axis.The tickmarks are constrained to line up with the ticks on the primary axis and the gridlines are not drawn.

sp.XAxisStyle = XAxisStyles.OmitLastLabel;
sp.YAxisStyle = YAxisStyles.BalancedAxis|YAxisStyles.CenteredCaption;

sp.YCaption = "Variance against estimate";
sp.DrawLineGraph(arr_1,col_S2);

sp.NewYAxis();
sp.YAxisStyle = YAxisStyles.Synchronised|YAxisStyles.BalancedAxis;
sp.DrawLineGraph(arr_2);

This style is often used in conjunction with balanced y-axes to get a matched zero-line down the middle of the chart.

See also ...

NewYAxis Method


SharpPlot 2.51 User Manual: Terminated Min-Max

Terminated Min-Max

The ‘terminated’ style will apply the current markers to each end of the Min-Max chart as an alternative to ‘Errorbars’ or ‘Arrowheads’. Solid markers such as the lozenge or various sizes of circle work best here.

sp.MinMaxChartStyle = MinMaxChartStyles.Terminated;

You can additionally use the ‘drift’ style to have the markers only placed at the ‘far’ end of each line.

See also ...

SharpPlot Members | MinMaxChartStyle Property | Directional Min-Max


SharpPlot 2.51 User Manual: TicksBetween - tickmarks between bars

TicksBetween – tickmarks between bars

Tickmarks are place in the gaps between the bars, rather than on the bars themselves.

sp.BarChartStyle = BarChartStyles.TicksBetween;

This style works well with the middle style of axis labels.

See also ...

SharpPlot | BarChartStyle | BoxPlotStyle | XBarChartStyle | MiddleLabels


SharpPlot 2.51 User Manual: Tiled surfaces

Tiled surfaces

Response surfaces are tiled, rather than being drawn as an open mesh.

sp.ResponsePlotStyle = ResponsePlotStyles.TiledSurface;

This works well when used to plot a computed function of 2 variables.

See also ...

SharpPlot Members | CloudChartStyle Property | ResponsePlotStyle Property | Altitude shading


SharpPlot 2.51 User Manual: Top X-Axis

Top X-Axis

The X-axis is drawn at the top.

sp.Heading = "Top X-Axis with Inverted Y-Axis";
sp.XAxisStyle = XAxisStyles.ArrowedAxis|XAxisStyles.AtEndCaption|XAxisStyles.TopAxis;
sp.YAxisStyle = YAxisStyles.ArrowedAxis|YAxisStyles.InvertAxis|YAxisStyles.AtEndCaption;
sp.YCaption = "Depth (m)";
sp.XCaption = "Distance from Shore (m)";

This style would generally be used with YAxisStyle set to InvertAxis – typically to plot depth below ground or sample age. Pollen diagrams are typical.


SharpPlot 2.51 User Manual: Trend lines are drawn for each series

Trend lines are drawn for each series

An exponentially-weighted smooth line is drawn through the data.

sp.LineGraphStyle = LineGraphStyles.TrendLine;

The degree of smoothing may be adjusted with the Flexibility setting.

See also ...

SharpPlot Members | CloudChartStyle Property | LineGraphStyle Property | ScatterPlotStyle Property


SharpPlot 2.51 User Manual: Trend surface

Trend surface

You can use the gaussian fitting process with 3D data to put a trend surface through a set of spot-height values.

This can be a useful way to visualise a landscape given a series of discrete altitude values. Contours are drawn at the Z-tickmarks if style ‘contour’ is set, and if style ‘riser’ is selected, the risers are drawn from the surface rather than from the XY-plane.


SharpPlot 2.51 User Manual: Value tags are added to all data points

Value tags are added to all data points

Data values are written next to each marker, or on top (or inside) each bar.

sp.LineGraphStyle = LineGraphStyles.ValueTags;

The detailed placement may be adjusted with the Value style setting which also allows the tags to be drawn opaque (as shown on the bars) or transparent.

See also ...

SharpPlot | BarChartStyle | GanttChartStyle | HistogramStyle | LineGraphStyle | MinMaxChartStyle | PieChartStyle | ScatterPlotStyle | StepChartStyle | VennDiagramStyle | XBarChartStyle | SetValueTags


SharpPlot 2.51 User Manual: Walls are shaded on 3D charts

Walls are shaded on 3D charts

The XZ, YZ and XY planes of 3D charts are shaded to form walls and a floor.

sp.TowerChartStyle = TowerChartStyles.WallShading;

This usually improves the readability of 3D charts as it gives a better sense of perspective.

See also ...

SharpPlot | CloudChartStyle | ResponsePlotStyle | TowerChartStyle | SetTowerFillStyles


SharpPlot 2.51 User Manual: Wedge zones

Wedge zones

Dialchart warning zones are drawn as a complete wedge from the centre, rather than an annular segment.

sp.DialChartStyle = DialChartStyles.WedgeZones;

The example also shows the ‘arrowed’ style of pointer.

See also ...

SharpPlot Members | DialChartStyle Property | PolarChartStyle Property


SharpPlot 2.51 User Manual: XY Plot

XY Plot

Example

sp.LineGraphStyle = LineGraphStyles.XYPlot;

Linegraphs

The first item of the data array is taken as the X-values. This has the same effect as passing one less column and setting the X-values with the second argument. The default is to assume that all columns of data represent sets of Y-values to be plotted against (1..n) as separate timeseries.

arr_X = new int[] {1,83,14,48,9,67};
arr_Y = new int[] {5,9,13,27,41,47};
data = new int[][]{arr_X,arr_Y};
sp.LineGraphStyle = LineGraphStyles.XYPlot;
sp.DrawLineGraph(data);

Cloud charts (3D scatter)

In this case, the first 2 items are taken as the X and Y values. Columns from 3 onwards are taken as independent data series, giving Z values. This allows you to call Cloud charts passing a single 3-element array of arrays rather that using the xValues and yValues arguments to set the values on the X and Y axes.

See also ...

SharpPlot | CloudChartStyle | LineGraphStyle | MinMaxChartStyle | PolarChartStyle


SharpPlot 2.51 User Manual: Active Charts

Active Charts

The PageMap class allows the programmer to explore hotspot data contained in any chart to reproduce the typical behaviour of a VML graphic deployed by a web-server.

public class PageMap

This utility class is designed to permit an application to convert mouse-tracking information into references back to the original data from which the chart was created.

This may be used (for example) to eliminate outliers from a regression analysis or to implement data editing by allowing the user to drag markers or bars. The examples all refer to this simple chart, which has 2 data series (one with bars and one with markers) and also has a tip on the heading text.

The hotspot detail is always returned in a HotspotInfo structure which tells you all you need to know to implement a graphical enquiry or editing application.

See PageMap Introduction for a fuller description and a simple worked example.

PageMap Members

Width Property
The width (in points) of the paper used to draw the chart
Height Property
The height (in points) of the paper used to draw the chart
PointsToAxes Method
Convert between co-ordinate systems based on given chart, or topmost chart at this location.
AxesToPoints Method
Do conversion from chart axis units to points based on given chart, or last chart drawn if omitted.
EnumerateCharts Method
List all charts found on this page.
FindChart Method
Report the name of the chart at these (x,y) co-ordinates.
FindHint Method
Recover hint text given hotspot handle. This gets the value of any hint text set for a data value by sp.AddHints when the chart is created.
FindHotspot Method
Find the details of any data points on this page at given (x,y) location.
FindHyperlink Method
Recover link text given hotspot handle. This gets the value of any hyperlink set for a data value by sp.AddHyperlinks when the chart is created.
FindInfo Method
Find the details of any standard chart object(s) given the chart id and any ScriptTarget.
FindPoints Method
Locate all data points whose centres lie within given bounding box.
FindScriptValue Method
Recovers the value of any attribute set for a data value by sp.AddAttributes when the chart is created.
FindTip Method
Recover tip text given hotspot handle. This gets the value of any tip set for a data value by sp.AddTips when the chart is created.
GetHotspotInfo Method
Recover hotspot details given hotspot handle.
GetTracker Method
Convert points to status message giving x and y in user-space.

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: PageMap Class – Introduction

PageMap Class – Introduction

Creating Active Charts in a Gui Application

It is relatively easy to make simple interactive graphics on the internet, using a combination of JavaScript (attached to data series) and the SharpPlot Addxxx methods to associate Hints, Tips, Actions and Hyperlinks with elements of a data series. Typically you could allow a user to ‘drill down’ on summary data by clicking on the bars of a barchart, and linking to a detailed display of the underlying figures. The chart below is used for all the worked examples in this section.

The methods in this class allow an application to implement similar capabilities, by converting raw co-ordinates into hotspot information, and using this to extract the hints, tips and links associated with the data. An obvious application would be to show any hints in a status field as the mouse passes over the corresponding items of the data series.

Example

// Typical PageMap calls on data series and heading
 pm = sp.RenderPageMap();
 System.Console.WriteLine("Pagemap has " + pm.ToString());

 int hix = pm.FindHotspot(200,120);        // Middle bar
 HotspotInfo hi = pm.GetHotspotInfo(hix);  // Full details so we can see it
 System.Console.WriteLine("Series detail is " + hi.ToString());

 tip = pm.FindTip(hi);
 System.Console.WriteLine("Tip for this element is " + tip);

All co-ordinates are required as (x,y) in points, with the origin at the lower-left corner of the chart. If your application allows the user to resize the form containing the chart, you will need to scale any mouse-move values back to match the paper-size that SharpPlot was called with when the chart was created. The output from the sample is:

Pagemap has Series/targets=12, Hints=2, Tips=10, Links=0, Scripts=4
Series detail is Chart=Bar1, Series=Hats, Item=2, Type=Bar, Locator=186 .9 52 216 193.3 0
Tip for this data item is Hat 5

The locator is stored to full precision, but is rounded off to the nearest 10th pt for display here.

See also ...

HotspotInfo Struct | HotspotType Enumeration | PageMap Members


SharpPlot 2.51 User Manual: Width Property

PageMap.Width Property

The width (in points) of the paper used to draw the chart

public double {get; }

Example

pagewidth = pm.Width;

See also ...

PageMap Class – Introduction | PageMap Members


SharpPlot 2.51 User Manual: Height Property

PageMap.Height Property

The height (in points) of the paper used to draw the chart

public double {get; }

Example

pageht = pm.Height;

See also ...

PageMap Class – Introduction | PageMap Members


SharpPlot 2.51 User Manual: PointsToAxes Method

PageMap.PointsToAxes Method

Convert between co-ordinate systems based on given chart, or topmost chart at this location.

Example

PointF xya = pm.PointsToAxes("Bar1",100,100);
System.Console.WriteLine("Axis conversion based on left scale - (100,100)=" + xya;

This gives the output

Axis conversion based on left scale - (100,100)={X=0.9864865, Y=1.699115}
Axis conversion based on right scale - (100,100)={X=0.9864865, Y=127.4336}
Axis conversion based on topmost scale - (100,100)={X=0.9864865, Y=127.4336}

Overloads

  • public PointF PointsToAxes(double x,double y);
  • public PointF PointsToAxes(string chartid,double x,double y);

Description

This could be used to show the current mouse co-ordinates in terms of the chart axes in a status field if the formatted value provided by GetTracker is unsuitable.

See also ...

PageMap Class – Introduction | GetTracker Method | PageMap Members


SharpPlot 2.51 User Manual: PointsToAxes Method (Double,Double)

PageMap.PointsToAxes Method (Double,Double)

Convert based on topmost chart at this location.

public PointF PointsToAxes(
    double x,
    double y
);
x
X co-ordinate in points.
y
Y co-ordinate in points.
return value
XY co-ords based on chart axes (empty array if not over a region bounded by rectangular axes).

See also ...

PointsToAxes Method | PageMap Members


SharpPlot 2.51 User Manual: PointsToAxes Method (String,Double,Double)

PageMap.PointsToAxes Method (String,Double,Double)

Convert points to axis co-ordinates for given chart.

public PointF PointsToAxes(
    string chartid,
    double x,
    double y
);
chartid
Name of chart to be used for conversion.
x
X co-ordinate in points.
y
Y co-ordinate in points.
return value
XY co-ords based on chart axes (empty array if not over a region bounded by rectangular axes).

See also ...

PointsToAxes Method | PageMap Members


SharpPlot 2.51 User Manual: AxesToPoints Method

PageMap.AxesToPoints Method

Do conversion from chart axis units to points based on given chart, or last chart drawn if omitted.

Example

PointF xy = pm.AxesToPoints("Bar1",2,5);
System.Console.WriteLine("Points conversion based on left scale - (2,5)=" + xy);

Possible output would be

Points conversion based on left scale - (2,5)={X=225, Y=193.25}
Points conversion based on right scale - (2,500)={X=225, Y=240.3333}
Points conversion based on topmost scale - (2,600)={X=225, Y=278}

Overloads

  • public PointF AxesToPoints(double xa,double ya);
  • public PointF AxesToPoints(string chartid,double xa,double ya);

Description

This could be used to overdraw the chart with arbitrary graphics, for example to allow the user to click on points to have them circled on the display, and temporarily eliminated from some analysis.

See also ...

PageMap Class – Introduction | PageMap Members


SharpPlot 2.51 User Manual: AxesToPoints Method (Double,Double)

PageMap.AxesToPoints Method (Double,Double)

Do conversion based on last available chart on the page.

public PointF AxesToPoints(
    double xa,
    double ya
);
xa
Y co-ords in points.
ya
Y co-ords in points.
return value
XY coordinates in chart axis units.

See also ...

AxesToPoints Method | PageMap Members


SharpPlot 2.51 User Manual: AxesToPoints Method (String,Double,Double)

PageMap.AxesToPoints Method (String,Double,Double)

Convert axis co-ordinates to points for a given chartid.

public PointF AxesToPoints(
    string chartid,
    double xa,
    double ya
);
chartid
Chart to use for coordinate conversion (last chart drawn if omitted).
xa
Y co-ords in points.
ya
Y co-ords in points.
return value
XY coordinates in chart axis units.

See also ...

AxesToPoints Method | PageMap Members


SharpPlot 2.51 User Manual: EnumerateCharts Method

PageMap.EnumerateCharts Method

List all charts found on this page.

public string[] EnumerateCharts();

This returns the (unique) list of chart names (possibly set by the programmer with SetChartName) which are available on the page. It may be used to determine the auto-generated names created by SharpPlot if you don’t want to enforce your own naming.

See also ...

PageMap Class – Introduction | PageMap Members


SharpPlot 2.51 User Manual: FindChart Method

PageMap.FindChart Method

Report the name of the chart at these (x,y) co-ordinates.

public string FindChart(
    double x,
    double y
);

Example

pm = sp.RenderPageMap();
cht = pm.FindChart(100,100);
x
Cursor-x in points.
y
Cursor-y in points.
return value
Chart name at this location (null string if none).

This can be used to check that the cursor is over a valid chart region (bounded bt rectangular axes) before attempting to convert points to axis values.

See also ...

PageMap Class – Introduction | PointsToAxes Method | PageMap Members


SharpPlot 2.51 User Manual: FindHint Method

PageMap.FindHint Method

Recover hint text given hotspot handle. This gets the value of any hint text set for a data value by sp.AddHints when the chart is created.

public string FindHint(
    int hotspot
);

Example

int hix = pm.FindHotspot(200,120);
hint = pm.FindHint(hix);

An application might use this to display hints in a status field as the mouse is tracked over the chart.

See also ...

AddHints Method | PageMap Class – Introduction | PageMap Members


SharpPlot 2.51 User Manual: FindHotspot Method

PageMap.FindHotspot Method

Find the details of any data points on this page at given (x,y) location.

public int FindHotspot(
    double x,
    double y
);
x
Cursor-x in points.
y
Cursor-y in points.
return value
Integer handle to hotspot or 0 if none matched.

This returns a unique integer id for the topmost hotspot under the cursor. The id may be used to recover any hints or tips that have been associated with the data item, or to get full details of the hotspot for graphical editing purposes.

See also ...

PageMap Class – Introduction | GetHotspotInfo Method | PageMap Members


SharpPlot 2.51 User Manual: FindHyperlink Method

PageMap.FindHyperlink Method

Recover link text given hotspot handle. This gets the value of any hyperlink set for a data value by sp.AddHyperlinks when the chart is created.

public string FindHyperlink(
    int hotspot
);

This will report the hyperlink (if any) which has been added to this data item. An application could use this information to emulate standard web behaviour by switching the display to a ‘child’ chart showing details of the data the composed a summary.

Alternatively, you may like to display the link in a status field to give the user appropriate feedback.

See also ...

AddHyperlinks Method | PageMap Class – Introduction | PageMap Members


SharpPlot 2.51 User Manual: FindInfo Method

PageMap.FindInfo Method

Find the details of any standard chart object(s) given the chart id and any ScriptTarget.

public HotspotInfo[] FindInfo(
    string chartid,
    ScriptTarget objid
);

Example

HotspotInfo[] ylabs = pm.FindInfo("Bar1",ScriptTarget.YLabels);
foreach (HotspotInfo spot in ylabs)
   System.Console.WriteLine(spot.ToString());
chartid
Chart name.
objid
Object id.
return value
Hotspot info array.

A typical result would be

Chart=Bar1, Series=YLabels, Item=1, Type=ScriptTarget, Locator=29.5 45.6 33.5 59.2
Chart=Bar1, Series=YLabels, Item=2, Type=ScriptTarget, Locator=29.5 73.8 33.5 87.4
Chart=Bar1, Series=YLabels, Item=3, Type=ScriptTarget, Locator= ....

which might be echoed to the console for debugging use. You could use this array to implement your own hotspot searching, for example to highlight drop-targets in a ‘slice-and-dice’ application which allowed the user to re-position the datacube by dropping placeholders on the chart axis labels.

See also ...

HotspotInfo Struct | PageMap Class – Introduction | PageMap Members


SharpPlot 2.51 User Manual: FindPoints Method

PageMap.FindPoints Method

Locate all data points whose centres lie within given bounding box.

public int[] FindPoints(
    double[] xyxy
);
xyxy
Region to check for data markers (left,bottom,right,top) in points.
return value
Array of selected hotspot ids.

This could be used by an application to allow a user to drag-select one or more markers. It only reports type-1 hotspots (markers) and includes only those whose centres fall within the given rectangle.

See also ...

PageMap Class – Introduction | PageMap Members


SharpPlot 2.51 User Manual: FindScriptValue Method

PageMap.FindScriptValue Method

Recovers the value of any attribute set for a data value by sp.AddAttributes when the chart is created.

Example

int hix = pm.FindHotspot(225,209);
string pval = pm.FindScriptValue(hix,"Fluffyness")

System.Console.WriteLine("Fluffyness value = " + pval));

Overloads

  • public string FindScriptValue(int hotspot);
  • public string FindScriptValue(int hotspot,string pname);

Description

Typically, this would be some kind of unique key (such as a product code) which could be used by the application to drill down to a more detailed analysis of that product.

See also ...

PageMap Class – Introduction | PageMap Members


SharpPlot 2.51 User Manual: FindScriptValue Method (Int32)

PageMap.FindScriptValue Method (Int32)

Returns first available property value for this hotspot.

public string FindScriptValue(
    int hotspot
);
hotspot
Handle to hotspot.
return value
Property value (as text).

See also ...

SharpPlot Members | FindScriptValue Method


SharpPlot 2.51 User Manual: FindScriptValue Method (Int32,String)

PageMap.FindScriptValue Method (Int32,String)

Recover saved script value given hotspot details and property name.

public string FindScriptValue(
    int hotspot,
    string pname
);
hotspot
Handle to hotspot.
pname
Name of saved script item.
return value
Property value (as text).

See also ...

SharpPlot Members | FindScriptValue Method


SharpPlot 2.51 User Manual: FindTip Method

PageMap.FindTip Method

Recover tip text given hotspot handle. This gets the value of any tip set for a data value by sp.AddTips when the chart is created.

public string FindTip(
    int hotspot
);

Example

int hix = pm.FindHotspot(200,120);
tip = pm.FindTip(hix);

An application might use this to popup tips for each data-point as the mouse is tracked over the chart.

See also ...

AddTips Method | PageMap Class – Introduction | PageMap Members


SharpPlot 2.51 User Manual: GetHotspotInfo Method

PageMap.GetHotspotInfo Method

Recover hotspot details given hotspot handle.

public HotspotInfo GetHotspotInfo(
    int hotspot
);

Example

int hix = pm.FindHotspot(250,300);   // Main heading
HotspotInfo hi = pm.GetHotspotInfo(hix);

System.Console.WriteLine("Heading is found at " + hi.ToString());

This might be required if the application wanted to ‘illuminate targets’ as the mouse was tracked over a chart. For example you could circle a data-point if the mouse was over its hotzone, or draw a bright edge over the potentially-selected bar on a barchart.

See also ...

HotspotInfo Struct | PageMap Class – Introduction | FindPoints Method | PageMap Members


SharpPlot 2.51 User Manual: GetTracker Method

PageMap.GetTracker Method

Convert points to status message giving x and y in user-space.

public string GetTracker(
    double x,
    double y
);
x
Cursor-x in points.
y
Cursor-y in points.
return value
Co-ordinates formatted in user-space.

Description

This takes note of the axis type, so will (for example) correctly represent the cursor position as a date for timeseries charts. A typical result for a scatterplot would be “x:234 y:12.7” where the mouse position is translated to axis values, rounded off to 3 significant figures. Dates are shown in the standard ‘short-date’ style unless you give your own format string.

See also ...

XTrackFormat Property | YTrackFormat Property | PageMap Class – Introduction | PageMap Members


SharpPlot 2.51 User Manual: VectorMath Class

VectorMath Class

This class provides a convenient library of static methods for transforming array data.

public class VectorMath

VectorMath Methods

Difference | Compute the first difference of an integer vector
Divide | Divide two integer vectors
Drop | Create an integer vector by removing count items from an existing integer vector
ExponentialSmooth | Simple exponential smooth of existing vector with given smoothing constant
Max | The largest item in an integer vector
Min | The smallest item in an integer vector
MovingAverage | Moving average of an integer vector given period and pad value
MovingTotal | Moving total of an integer vector given period and pad value
Multiply | Multiply two integer vectors
Negate | The negative values of an integer vector
Pow | Power two double vectors
Range | Generate indices from start up to end
Reciprocal | The inverse values of an integer vector
RunningMax | Running maximum of an integer vector
RunningMin | Running minimum of an integer vector
RunningTotal | Running total of an integer vector
Sqrt | Square root of an integer vector
Subtract | Subtract two integer vectors
Sum | Add two integer vectors
Tail | Create an integer vector from the last elements of existing integer vector and new element count
Take | Create an integer vector from an existing integer vector and new element count
Total | Total of an integer vector

Example

Typically you may want to combine several variables in a Scatterplot, or draw a timeseries with a moving average.

BP = new int[] {427,428,427,429,424,418,420,424,416,410,406,409,403,395,389,380,374,369,
  356,362,383,383,382,393,386,398,382,379,380,394,385,381,388,396,404,393,400,413,417,
  414,402,400,400,408,408,406,405,395,392,395,371,392,400,415,413,414,417,428,416,422,
  429,416,414,401,416,406,407,416,421,411,412,406,405,408,414,407,408,414,412,406,395,
  403,400,397,395,405,411,414,408};

pad = sp.MissingValue;
mav12 = VectorMath.MovingAverage(BP,12,pad);
mav20 = VectorMath.MovingAverage(BP,20,pad);

sp.LineGraphStyle = LineGraphStyles.Markers|LineGraphStyles.NoLines;
sp.SetMarkers(Marker.Dot);

sp.DrawLineGraph(BP);

sp.SetLineStyles(LineStyle.Solid);

sp.LineGraphStyle = 0;
sp.DrawLineGraph(new double[][]{mav12,mav20});

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: Difference Method

Difference Method

Compute the first difference of any vector. The initial value is always zero.

Example

difference = VectorMath.Difference(series1);

Overloads

  • public static int[] Difference(int[] vector);
  • public static double[] Difference(double[] vector);


SharpPlot 2.51 User Manual: Difference Method (Int32[])

Difference Method (Int32[])

Compute the first difference of an integer vector.

public static int[] Difference(
    int[] vector
);

See also ...

Difference Method


SharpPlot 2.51 User Manual: Difference Method (Double[])

Difference Method (Double[])

Compute the first difference a double vector.

public static double[] Difference(
    double[] vector
);

See also ...

Difference Method


SharpPlot 2.51 User Manual: Divide Method

Divide Method

Divide a vector by another vector (or scalar).

Example

series2 = VectorMath.Divide(series1,1000);
series3 = VectorMath.Divide(series1,series2);

Overloads

  • public static double[] Divide(int[] v1,int[] v2);
  • public static double[] Divide(double[] v1,double v2);
  • public static double[] Divide(double v1,double[] v2);
  • public static double[] Divide(int[] v1,int v2);
  • public static double[] Divide(int v1,int[] v2);
  • public static double[] Divide(int[] v1,double v2);
  • public static double[] Divide(double v1,int[] v2);
  • public static double[] Divide(double[] v1,double[] v2);


SharpPlot 2.51 User Manual: Divide Method (Int32[],Int32[])

Divide Method (Int32[],Int32[])

Divide two integer vectors.

public static double[] Divide(
    int[] v1,
    int[] v2
);

See also ...

Divide Method


SharpPlot 2.51 User Manual: Divide Method (Double[],Double)

Divide Method (Double[],Double)

Divide a double vector by a double scalar.

public static double[] Divide(
    double[] v1,
    double v2
);

See also ...

Divide Method


SharpPlot 2.51 User Manual: Divide Method (Double,Double[])

Divide Method (Double,Double[])

Divide a double scalar by a double vector.

public static double[] Divide(
    double v1,
    double[] v2
);

See also ...

Divide Method


SharpPlot 2.51 User Manual: Divide Method (Int32[],Int32)

Divide Method (Int32[],Int32)

Divide an integer vector by an integer scalar.

public static double[] Divide(
    int[] v1,
    int v2
);

See also ...

Divide Method


SharpPlot 2.51 User Manual: Divide Method (Int32,Int32[])

Divide Method (Int32,Int32[])

Divide an integer scalar by an integer vector.

public static double[] Divide(
    int v1,
    int[] v2
);

See also ...

Divide Method


SharpPlot 2.51 User Manual: Divide Method (Int32[],Double)

Divide Method (Int32[],Double)

Divide a double scalar by an integer vector.

public static double[] Divide(
    int[] v1,
    double v2
);

See also ...

Divide Method


SharpPlot 2.51 User Manual: Divide Method (Double,Int32[])

Divide Method (Double,Int32[])

Divide an integer vector by a double scalar.

public static double[] Divide(
    double v1,
    int[] v2
);


SharpPlot 2.51 User Manual: Divide Method (Double[],Double[])

Divide Method (Double[],Double[])

Divide two double vectors.

public static double[] Divide(
    double[] v1,
    double[] v2
);

See also ...

Divide Method


SharpPlot 2.51 User Manual: Drop Method

Drop Method

Create a vector by removing count elements from an existing vector.

Example

series2 = VectorMath.Drop(series1,12);

Overloads

  • public static int[] Drop(int[] existing,int count);
  • public static double[] Drop(double[] existing,int count);


SharpPlot 2.51 User Manual: Drop Method (Int32[],Int32)

Drop Method (Int32[],Int32)

Create an integer vector by removing count items from an existing integer vector.

public static int[] Drop(
    int[] existing,
    int count
);

See also ...

Drop Method


SharpPlot 2.51 User Manual: Drop Method (Double[],Int32)

Drop Method (Double[],Int32)

Create a double vector by removing count items from a given double vector.

public static double[] Drop(
    double[] existing,
    int count
);

See also ...

Drop Method


SharpPlot 2.51 User Manual: ExponentialSmooth Method

ExponentialSmooth Method

Brown’s exponential smoothing with optional smoothing constant (default=0.7).

Example

series2 = VectorMath.ExponentialSmooth(series1);
series2 = VectorMath.ExponentialSmooth(series1,0.5);

Overloads

  • public static double[] ExponentialSmooth(double[] vector,double alpha);
  • public static double[] ExponentialSmooth(double[] vector);
  • public static double[] ExponentialSmooth(int[] vector);
  • public static double[] ExponentialSmooth(int[] vector,double alpha);


SharpPlot 2.51 User Manual: ExponentialSmooth Method (Double[],Double)

ExponentialSmooth Method (Double[],Double)

Simple exponential smooth of existing vector with given smoothing constant.

public static double[] ExponentialSmooth(
    double[] vector,
    double alpha
);

See also ...

ExponentialSmooth Method


SharpPlot 2.51 User Manual: ExponentialSmooth Method (Double[])

ExponentialSmooth Method (Double[])

Exponential smooth of double vector with alpha=0.7.

public static double[] ExponentialSmooth(
    double[] vector
);

See also ...

ExponentialSmooth Method


SharpPlot 2.51 User Manual: ExponentialSmooth Method (Int32[])

ExponentialSmooth Method (Int32[])

Exponential smooth of integer vector with alpha=0.7.

public static double[] ExponentialSmooth(
    int[] vector
);

See also ...

ExponentialSmooth Method


SharpPlot 2.51 User Manual: ExponentialSmooth Method (Int32[],Double)

ExponentialSmooth Method (Int32[],Double)

Exponential smooth of integer vector with given smoothing constant.

public static double[] ExponentialSmooth(
    int[] vector,
    double alpha
);

See also ...

ExponentialSmooth Method


SharpPlot 2.51 User Manual: Max Method

Max Method

Find the largest item in the content of any vector.

Example

biggest = VectorMath.Max(series1);
series2 = VectorMath.RunningMax(series1);

Overloads

  • public static int Max(int[] vector);
  • public static double Max(double[] vector);


SharpPlot 2.51 User Manual: Max Method (Int32[])

Max Method (Int32[])

The largest item in an integer vector.

public static int Max(
    int[] vector
);

See also ...

Max Method


SharpPlot 2.51 User Manual: Max Method (Double[])

Max Method (Double[])

The largest item in a double vector.

public static double Max(
    double[] vector
);

See also ...

Max Method


SharpPlot 2.51 User Manual: Min Method

Min Method

Find the smallest item in the content of any vector.

Example

smallest = VectorMath.Min(series1);
series2 = VectorMath.RunningMin(series1);

Overloads

  • public static int Min(int[] vector);
  • public static double Min(double[] vector);


SharpPlot 2.51 User Manual: Min Method (Int32[])

Min Method (Int32[])

The smallest item in an integer vector.

public static int Min(
    int[] vector
);

See also ...

Min Method


SharpPlot 2.51 User Manual: Min Method (Double[])

Min Method (Double[])

The smallest item in a double vector.

public static double Min(
    double[] vector
);

See also ...

Min Method


SharpPlot 2.51 User Manual: MovingAverage Method

MovingAverage Method

Scan the content of any vector to give a moving average with given window and optional padding.

Example

series3 = VectorMath.MovingAverage(series1,12);
series3 = VectorMath.MovingAverage(series1,12,-32768);

Overloads

  • public static double[] MovingAverage(int[] vector,int window,double padding);
  • public static double[] MovingAverage(int[] vector,int window);
  • public static double[] MovingAverage(double[] vector,int window);
  • public static double[] MovingAverage(double[] vector,int window,double padding);


SharpPlot 2.51 User Manual: MovingAverage Method (Int32[],Int32,Double)

MovingAverage Method (Int32[],Int32,Double)

Moving average of an integer vector given period and pad value.

public static double[] MovingAverage(
    int[] vector,
    int window,
    double padding
);

See also ...

MovingAverage Method


SharpPlot 2.51 User Manual: MovingAverage Method (Int32[],Int32)

MovingAverage Method (Int32[],Int32)

Moving average of an integer vector with a given window.

public static double[] MovingAverage(
    int[] vector,
    int window
);

See also ...

MovingAverage Method


SharpPlot 2.51 User Manual: MovingAverage Method (Double[],Int32)

MovingAverage Method (Double[],Int32)

Moving average of a double vector with a given window.

public static double[] MovingAverage(
    double[] vector,
    int window
);

See also ...

MovingAverage Method


SharpPlot 2.51 User Manual: MovingAverage Method (Double[],Int32,Double)

MovingAverage Method (Double[],Int32,Double)

Moving average of a double vector with a given window and pad value.

public static double[] MovingAverage(
    double[] vector,
    int window,
    double padding
);

See also ...

MovingAverage Method


SharpPlot 2.51 User Manual: MovingTotal Method

MovingTotal Method

Sum the content of any vector to give a moving total with given window and optional padding.

Example

series3 = VectorMath.MovingTotal(series1,12);
series3 = VectorMath.MovingTotal(series1,12,-1);

Overloads

  • public static int[] MovingTotal(int[] vector,int window,int padding);
  • public static int[] MovingTotal(int[] vector,int window);
  • public static double[] MovingTotal(double[] vector,int window);
  • public static double[] MovingTotal(double[] vector,int window,int padding);


SharpPlot 2.51 User Manual: MovingTotal Method (Int32[],Int32,Int32)

MovingTotal Method (Int32[],Int32,Int32)

Moving total of an integer vector given period and pad value.

public static int[] MovingTotal(
    int[] vector,
    int window,
    int padding
);

See also ...

MovingTotal Method


SharpPlot 2.51 User Manual: MovingTotal Method (Int32[],Int32)

MovingTotal Method (Int32[],Int32)

Moving total of an integer vector with a given window.

public static int[] MovingTotal(
    int[] vector,
    int window
);

See also ...

MovingTotal Method


SharpPlot 2.51 User Manual: MovingTotal Method (Double[],Int32)

MovingTotal Method (Double[],Int32)

Moving total of a double vector with a given window.

public static double[] MovingTotal(
    double[] vector,
    int window
);

See also ...

MovingTotal Method


SharpPlot 2.51 User Manual: MovingTotal Method (Double[],Int32,Int32)

MovingTotal Method (Double[],Int32,Int32)

Moving total of a double vector with a given window and pad value.

public static double[] MovingTotal(
    double[] vector,
    int window,
    int padding
);

See also ...

MovingTotal Method


SharpPlot 2.51 User Manual: Multiply Method

Multiply Method

Multiply a vector by another vector (or scalar).

Example

series2 = VectorMath.Multiply(series1,10);
series3 = VectorMath.Multiply(series1,series2);

Overloads

  • public static int[] Multiply(int[] v1,int[] v2);
  • public static double[] Multiply(double[] v1,double v2);
  • public static double[] Multiply(double v1,double[] v2);
  • public static int[] Multiply(int[] v1,int v2);
  • public static int[] Multiply(int v1,int[] v2);
  • public static double[] Multiply(int[] v1,double v2);
  • public static double[] Multiply(double[] v1,double[] v2);


SharpPlot 2.51 User Manual: Multiply Method (Int32[],Int32[])

Multiply Method (Int32[],Int32[])

Multiply two integer vectors.

public static int[] Multiply(
    int[] v1,
    int[] v2
);

See also ...

Multiply Method


SharpPlot 2.51 User Manual: Multiply Method (Double[],Double)

Multiply Method (Double[],Double)

Multiply a double vector by a double scalar.

public static double[] Multiply(
    double[] v1,
    double v2
);

See also ...

Multiply Method


SharpPlot 2.51 User Manual: Multiply Method (Double,Double[])

Multiply Method (Double,Double[])

Multiply a double scalar by a double vector.

public static double[] Multiply(
    double v1,
    double[] v2
);

See also ...

Multiply Method


SharpPlot 2.51 User Manual: Multiply Method (Int32[],Int32)

Multiply Method (Int32[],Int32)

Multiply an integer vector by an integer scalar.

public static int[] Multiply(
    int[] v1,
    int v2
);

See also ...

Multiply Method


SharpPlot 2.51 User Manual: Multiply Method (Int32,Int32[])

Multiply Method (Int32,Int32[])

Multiply an integer scalar by an integer vector.

public static int[] Multiply(
    int v1,
    int[] v2
);

See also ...

Multiply Method


SharpPlot 2.51 User Manual: Multiply Method (Int32[],Double)

Multiply Method (Int32[],Double)

Multiply an integer vector by a double scalar.

public static double[] Multiply(
    int[] v1,
    double v2
);

See also ...

Multiply Method


SharpPlot 2.51 User Manual: Multiply Method (Double,Int32[])

Multiply Method (Double,Int32[])

Multiply a double scalar by an integer vector.

public static double[] Multiply(
    double v1,
    int32[] v2
);


SharpPlot 2.51 User Manual: Multiply Method (Double[],Double[])

Multiply Method (Double[],Double[])

Multiply two double vectors.

public static double[] Multiply(
    double[] v1,
    double[] v2
);

See also ...

Multiply Method


SharpPlot 2.51 User Manual: Negate Method

Negate Method

Compute the negative of any vector.

Example

negative = VectorMath.Negate(series3);

Overloads

  • public static int[] Negate(int[] vector);
  • public static double[] Negate(double[] vector);


SharpPlot 2.51 User Manual: Negate Method (Int32[])

Negate Method (Int32[])

Compute the negative of an integer vector.

public static int[] Negate(
    int[] vector
);


SharpPlot 2.51 User Manual: Negate Method (Double[])

Negate Method (Double[])

Compute the negative a double vector.

public static double[] Negate(
    double[] vector
);


SharpPlot 2.51 User Manual: Pow Method

Pow Method

Raise a vector to a given power.

Example

series2 = VectorMath.Pow(series1,2);

Overloads

  • public static double[] Pow(int[] vector,double power);
  • public static double[] Pow(double[] vector,double power);


SharpPlot 2.51 User Manual: Pow Method (Int32[],Double)

Pow Method (Int32[],Double)

Raise an integer vector to a given power.

public static double[] Pow(
    int[] vector,
    double power
);

See also ...

Pow Method


SharpPlot 2.51 User Manual: Pow Method (Double[],Double)

Pow Method (Double[],Double)

Raise a double vector to a given power.

public static double[] Pow(
    double[] vector,
    double power
);

See also ...

Pow Method


SharpPlot 2.51 User Manual: Range Method

Range Method

Generate indices from start up to end.

public static int[] Range(
    int from,
    int to
);


SharpPlot 2.51 User Manual: Reciprocal Method

Reciprocal Method

Compute the inverse of any vector.

Example

inverse = VectorMath.Reciprocal(series3);

Overloads

  • public static int[] Reciprocal(int[] vector);
  • public static double[] Reciprocal(double[] vector);


SharpPlot 2.51 User Manual: Reciprocal Method (Int32[])

Reciprocal Method (Int32[])

Compute the inverse of an integer vector.

public static double[] Reciprocal(
    int[] vector
);


SharpPlot 2.51 User Manual: Reciprocal Method (Double[])

Reciprocal Method (Double[])

Compute the inverse of a double vector.

public static double[] Reciprocal(
    double[] vector
);


SharpPlot 2.51 User Manual: RunningMax Method

RunningMax Method

Scan the content of any vector to give a running maximum.

Example

series2 = VectorMath.RunningMax(series1);

Overloads

  • public static int[] RunningMax(int[] vector);
  • public static double[] RunningMax(double[] vector);


SharpPlot 2.51 User Manual: RunningMax Method (Int32[])

RunningMax Method (Int32[])

Running maximum of an integer vector.

public static int[] RunningMax(
    int[] vector
);

See also ...

RunningMax Method


SharpPlot 2.51 User Manual: RunningMax Method (Double[])

RunningMax Method (Double[])

Running maximum of a double vector.

public static double[] RunningMax(
    double[] vector
);

See also ...

RunningMax Method


SharpPlot 2.51 User Manual: RunningMin Method

RunningMin Method

Scan the content of any vector to give a running minimum.

Example

series2 = VectorMath.RunningMin(series1);

Overloads

  • public static int[] RunningMin(int[] vector);
  • public static double[] RunningMin(double[] vector);


SharpPlot 2.51 User Manual: RunningMin Method (Int32[])

RunningMin Method (Int32[])

Running minimum of an integer vector.

public static int[] RunningMin(
    int[] vector
);

See also ...

RunningMin Method


SharpPlot 2.51 User Manual: RunningMin Method (Double[])

RunningMin Method (Double[])

Running minimum of a double vector.

public static double[] RunningMin(
    double[] vector
);

See also ...

RunningMin Method


SharpPlot 2.51 User Manual: RunningTotal Method

RunningTotal Method

Sum the content of any vector to give a running total.

Example

series2 = VectorMath.RunningTotal(series1);

Overloads

  • public static int[] RunningTotal(int[] vector);
  • public static double[] RunningTotal(double[] vector);


SharpPlot 2.51 User Manual: RunningTotal Method (Int32[])

RunningTotal Method (Int32[])

Running total of an integer vector.

public static int[] RunningTotal(
    int[] vector
);

See also ...

RunningTotal Method


SharpPlot 2.51 User Manual: RunningTotal Method (Double[])

RunningTotal Method (Double[])

Running total of a double vector.

public static double[] RunningTotal(
    double[] vector
);

See also ...

RunningTotal Method


SharpPlot 2.51 User Manual: Sqrt Method

Sqrt Method

Compute the square root of any vector.

Example

series2 = VectorMath.Sqrt(series1);

Overloads

  • public static double[] Sqrt(int[] vector);
  • public static double[] Sqrt(double[] vector);


SharpPlot 2.51 User Manual: Sqrt Method (Int32[])

Sqrt Method (Int32[])

Square root of an integer vector.

public static double[] Sqrt(
    int[] vector
);

See also ...

Sqrt Method


SharpPlot 2.51 User Manual: Sqrt Method (Double[])

Sqrt Method (Double[])

Square root of a double vector.

public static double[] Sqrt(
    double[] vector
);

See also ...

Sqrt Method


SharpPlot 2.51 User Manual: Subtract Method

Subtract Method

Subtract a vector from another vector (or scalar).

Example

series2 = VectorMath.Subtract(series1,10);
series3 = VectorMath.Subtract(series1,series2);

Overloads

  • public static int[] Subtract(int[] v1,int[] v2);
  • public static double[] Subtract(double v1,double[] v2);
  • public static double[] Subtract(double[] v1,double v2);
  • public static int[] Subtract(int v1,int[] v2);
  • public static int[] Subtract(int[] v1,int v2);
  • public static double[] Subtract(int[] v1,double v2);
  • public static double[] Subtract(double[] v1,double[] v2);


SharpPlot 2.51 User Manual: Subtract Method (Int32[],Int32[])

Subtract Method (Int32[],Int32[])

Subtract two integer vectors.

public static int[] Subtract(
    int[] v1,
    int[] v2
);

See also ...

Subtract Method


SharpPlot 2.51 User Manual: Subtract Method (Double,Double[])

Subtract Method (Double,Double[])

Subtract a double scalar from a double vector.

public static double[] Subtract(
    double v1,
    double[] v2
);

See also ...

Subtract Method


SharpPlot 2.51 User Manual: Subtract Method (Double[],Double)

Subtract Method (Double[],Double)

Subtract a double vector from a double scalar.

public static double[] Subtract(
    double[] v1,
    double v2
);

See also ...

Subtract Method


SharpPlot 2.51 User Manual: Subtract Method (Int32,Int32[])

Subtract Method (Int32,Int32[])

Subtract an integer scalar from an integer vector.

public static int[] Subtract(
    int v1,
    int[] v2
);

See also ...

Subtract Method


SharpPlot 2.51 User Manual: Subtract Method (Int32[],Int32)

Subtract Method (Int32[],Int32)

Subtract an integer vector from an integer scalar.

public static int[] Subtract(
    int[] v1,
    int v2
);

See also ...

Subtract Method


SharpPlot 2.51 User Manual: Subtract Method (Int32[],Double)

Subtract Method (Int32[],Double)

Subtract a double scalar from an integer vector.

public static double[] Subtract(
    int[] v1,
    double v2
);

See also ...

Subtract Method


SharpPlot 2.51 User Manual: Subtract Method (Double,Int32[])

Subtract Method (Double,Int32[])

Subtract an integer vector from a double scalar.

public static double[] Subtract(
    double v1,
    int[] v2
);


SharpPlot 2.51 User Manual: Subtract Method (Double[],Double[])

Subtract Method (Double[],Double[])

Subtract two double vectors.

public static double[] Subtract(
    double[] v1,
    double[] v2
);

See also ...

Subtract Method


SharpPlot 2.51 User Manual: Sum Method

Sum Method

Add a vector to another vector (or scalar).

Example

series2 = VectorMath.Sum(series1,100);
series3 = VectorMath.Sum(series1,series2);

Overloads

  • public static int[] Sum(int[] v1,int[] v2);
  • public static double[] Sum(double v1,double[] v2);
  • public static double[] Sum(double[] v1,double v2);
  • public static int[] Sum(int v1,int[] v2);
  • public static int[] Sum(int[] v1,int v2);
  • public static double[] Sum(int[] v1,double v2);
  • public static double[] Sum(double v1,int[] v2);
  • public static double[] Sum(double[] v1,double[] v2);


SharpPlot 2.51 User Manual: Sum Method (Int32[],Int32[])

Sum Method (Int32[],Int32[])

Add two integer vectors.

public static int[] Sum(
    int[] v1,
    int[] v2
);

See also ...

Sum Method


SharpPlot 2.51 User Manual: Sum Method (Double,Double[])

Sum Method (Double,Double[])

Add a double scalar to a double vector.

public static double[] Sum(
    double v1,
    double[] v2
);

See also ...

Sum Method


SharpPlot 2.51 User Manual: Sum Method (Double[],Double)

Sum Method (Double[],Double)

Add a double vector to a double scalar.

public static double[] Sum(
    double[] v1,
    double v2
);

See also ...

Sum Method


SharpPlot 2.51 User Manual: Sum Method (Int32,Int32[])

Sum Method (Int32,Int32[])

Add an integer scalar to an integer vector.

public static int[] Sum(
    int v1,
    int[] v2
);

See also ...

Sum Method


SharpPlot 2.51 User Manual: Sum Method (Int32[],Int32)

Sum Method (Int32[],Int32)

Add an integer vector to an integer scalar.

public static int[] Sum(
    int[] v1,
    int v2
);

See also ...

Sum Method


SharpPlot 2.51 User Manual: Sum Method (Int32[],Double)

Sum Method (Int32[],Double)

Add a an integer vector to a double scalar.

public static double[] Sum(
    int[] v1,
    double v2
);

See also ...

Sum Method


SharpPlot 2.51 User Manual: Sum Method (Double,Int32[])

Sum Method (Double,Int32[])

Add a double scalar to an integer vector.

public static double[] Sum(
    double v1,
    int[] v2
);

See also ...

Sum Method


SharpPlot 2.51 User Manual: Sum Method (Double[],Double[])

Sum Method (Double[],Double[])

Add two double vectors.

public static double[] Sum(
    double[] v1,
    double[] v2
);

See also ...

Sum Method


SharpPlot 2.51 User Manual: Tail Method

Tail Method

Create a vector from the last count elements of an existing vector.

Example

series2 = VectorMath.Tail(series1,100);

Overloads

  • public static int[] Tail(int[] existing,int count);
  • public static double[] Tail(double[] existing,int count);


SharpPlot 2.51 User Manual: Tail Method (Int32[],Int32)

Tail Method (Int32[],Int32)

Create an integer vector from the last elements of existing integer vector and new element count.

public static int[] Tail(
    int[] existing,
    int count
);

See also ...

Tail Method


SharpPlot 2.51 User Manual: Tail Method (Double[],Int32)

Tail Method (Double[],Int32)

Create a double vector from the last count items of a double vector.

public static double[] Tail(
    double[] existing,
    int count
);

See also ...

Tail Method


SharpPlot 2.51 User Manual: Take Method

Take Method

Create a vector given existing content and new length, padding with zero if required.

Example

series2 = VectorMath.Take(series1,100);

Overloads

  • public static int[] Take(int[] existing,int count);
  • public static double[] Take(double[] existing,int count);


SharpPlot 2.51 User Manual: Take Method (Int32[],Int32)

Take Method (Int32[],Int32)

Create an integer vector from an existing integer vector and new element count.

public static int[] Take(
    int[] existing,
    int count
);

See also ...

Take Method


SharpPlot 2.51 User Manual: Take Method (Double[],Int32)

Take Method (Double[],Int32)

Create a double vector from double vector and count.

public static double[] Take(
    double[] existing,
    int count
);

See also ...

Take Method


SharpPlot 2.51 User Manual: Total Method

Total Method

Sum the content of any vector.

Example

series3 = VectorMath.MovingTotal(series1,12);
series3 = VectorMath.MovingTotal(series1,12,-1);
series2 = VectorMath.RunningTotal(series1);
total = VectorMath.Total(series1);

Overloads

  • public static int Total(int[] vector);
  • public static double Total(double[] vector);


SharpPlot 2.51 User Manual: Total Method (Int32[])

Total Method (Int32[])

Total of an integer vector.

public static int[] MovingTotal(
    int[] vector,
    int window,
    int padding
);

See also ...

Total Method


SharpPlot 2.51 User Manual: Total Method (Double[])

Total Method (Double[])

Total of a double vector.

public static int[] MovingTotal(
    int[] vector,
    int window
);


SharpPlot 2.51 User Manual: DBUtil Class

DBUtil Class

This class provides a small set of static methods for extracting array data from database tables. See DbUtil Members for the full list of static methods, and the tutorial on aggregating data for some worked examples.

public class DbUtil

DbUtil Methods

GetIntegers
GetDoubles
GetStrings

Example

 sp.Reset(240,160);
 sp.SetMargins(24,18,24,4);
 filler = (int)sp.MissingValue;

 mytable = new DataTable(); // Get some real data here!;
 myselection = mytable.Select("year>2006 AND symb='BP'");
 int[] BP = DbUtil.GetIntegers(myselection,filler,"SharePrice");

 sp.Heading = "BP";
 sp.HeadingStyle = HeadingStyles.Right;
 sp.DrawLineGraph(BP);

This example simply retrieves one complete column from the current selection, using SharpPlot’s missing value setting to replace any DBNull values in the data.

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)


SharpPlot 2.51 User Manual: Working with Databases

Working with Databases

Intro to DBUtils todo

Members

GetDoubles | GetDoubles Method
GetIntegers | GetIntegers Method
GetStrings | GetStrings Method

See also ...

Grouping and Splitting Database Data


SharpPlot 2.51 User Manual: GetDoubles Method

GetDoubles Method

Get one or more Double columns from a Selection, with optional missing value filler.

Example

 sp.Reset(240,160);
 sp.SetMargins(24,18,24,4);
 filler = sp.MissingValue;

 mytable = new DataTable(); // Get some real data here!;
 myselection = mytable.Select("year>2006 AND symb='BP'");
 DbUtil.GetDoubles(myselection,filler,"SharePrice");

 sp.Heading = "BP";
 sp.HeadingStyle = HeadingStyles.Right;
 sp.DrawLineGraph(BP);

Overloads

  • public static double[][] GetDoubles(DataRow[] sel,double nullFiller,string[] cols);
  • public static double[][] GetDoubles(DataRow[] sel,string[] cols);
  • public static double[] GetDoubles(DataRow[] sel,double nullFiller,string cols);
  • public static double[] GetDoubles(DataRow[] sel,string cols);

Description

This example retrieves a single column of data as a simple array of doubles, with any missing data (DBNull values) replaced with the current SharpPlot missing value property. You can also retrieve multiple columns in a single call which is ideal as a way of plotting several parallel series.

See also ...

Working with Databases


SharpPlot 2.51 User Manual: GetDoubles Method (DataRow[],Double,String[])

GetDoubles Method (DataRow[],Double,String[])

Get several columns from a Selection as a Double array of arrays with supplied missing value filler.

 public static double[][] GetDoubles(
    DataRow[] sel,
    double nullFiller,
    string[] cols
);

See also ...

Working with Databases | GetDoubles Method


SharpPlot 2.51 User Manual: GetDoubles Method (DataRow[],String[][])

GetDoubles Method (DataRow[],String[][])

Get several columns from a Selection as a Double array of arrays with missing values replaced with zero.

public static double[][] GetDoubles(
    DataRow[] sel,
    string[] cols
);

See also ...

Working with Databases | GetDoubles Method


SharpPlot 2.51 User Manual: GetDoubles Method (DataRow[],Double,String)

GetDoubles Method (DataRow[],Double,String)

Get one column from a Selection as a Double array with supplied missing value filler.

 public static double[] GetDoubles(
    DataRow[] sel,
    double nullFiller,
    string cols
);

See also ...

Working with Databases | GetDoubles Method


SharpPlot 2.51 User Manual: GetDoubles Method (DataRow[],String)

GetDoubles Method (DataRow[],String)

Get one column from a Selection as a Double array with missing values replaced by zero.

 public static double[] GetDoubles(
    DataRow[] sel,
    string cols
);

See also ...

Working with Databases | GetDoubles Method


SharpPlot 2.51 User Manual: GetIntegers Method

GetIntegers Method

Get one or more Integer columns from a Selection, with optional missing value filler.

Example

 sp.Reset(240,160);
 sp.SetMargins(24,18,24,4);

 mytable = new DataTable(); // Get some real data here!;
 myselection = mytable.Select("year>2006 AND symb='BP'");
 DbUtil.GetIntegers(myselection,"SharePrice");

 sp.Heading = "BP";
 sp.HeadingStyle = HeadingStyles.Right;
 sp.DrawLineGraph(BP);

Overloads

  • public static int[][] GetIntegers(DataRow[] sel,int nullFiller,string[] cols);
  • public static int[][] GetIntegers(DataRow[] sel,string[] cols);
  • public static int[] GetIntegers(DataRow[] sel,int nullFiller,string cols);
  • public static int[] GetIntegers(DataRow[] sel,string cols);

Description

This example retrieves a single column of data as a simple array of integers, with any missing data (DBNull values) replaced with zero. You can also retrieve multiple columns in a single call which is ideal as a way of plotting several parallel series. Floating point data is rounded to the nearest integer.

See also ...

Working with Databases


SharpPlot 2.51 User Manual: GetIntegers Method (DataRow[],Int32,String[])

GetIntegers Method (DataRow[],Int32,String[])

Get several columns from a Selection as an Integer array of arrays with supplied missing value filler.

 public static int[][] GetIntegers(
    DataRow[] sel,
    int nullFiller,
    string[] cols
);

See also ...

Working with Databases | GetIntegers Method


SharpPlot 2.51 User Manual: GetIntegers Method (DataRow[],String[][])

GetIntegers Method (DataRow[],String[][])

Get several columns from a Selection as an Integer array of arrays with missing values replaced with zero.

public static int[][] GetIntegers(
    DataRow[] sel,
    string[] cols
);

See also ...

Working with Databases | GetIntegers Method


SharpPlot 2.51 User Manual: GetIntegers Method (DataRow[],Int32,String)

GetIntegers Method (DataRow[],Int32,String)

Get one column from a Selection as an Integer array with supplied missing value filler.

 public static int[] GetIntegers(
    DataRow[] sel,
    int nullFiller,
    string cols
);

See also ...

Working with Databases | GetIntegers Method


SharpPlot 2.51 User Manual: GetIntegers Method (DataRow[],String)

GetIntegers Method (DataRow[],String)

Get one column from a Selection as an Integer array with missing values replaced by zero.

 public static int[] GetIntegers(
    DataRow[] sel,
    string cols
);

See also ...

Working with Databases | GetIntegers Method


SharpPlot 2.51 User Manual: GetStrings Method

GetStrings Method

Get one or more String columns from a Selection, with optional missing value filler. By default, the empty string is used to replace any DBNull values in the chosen column.

Example

 sp.Reset(240,160);
 sp.SetMargins(24,18,24,4);
 filler = (int)sp.MissingValue;

 mytable = new DataTable(); // Get some real data here!;
 myselection = mytable.Select("symb='BP'");

 string[] xlabs = DbUtil.GetStrings(myselection,"Year");

 sp.SetXLabels(xlabs);
 sp.DrawBarChart(BPAnnualEarnings);

Overloads

  • public static string[][] GetStrings(DataRow[] sel,string nullFiller,params string[] cols);
  • public static string[][] GetStrings(DataRow[] sel,params string[] cols);
  • public static string[] GetStrings(DataRow[] sel,string nullFiller,string cols);
  • public static string[] GetStrings(DataRow[] sel,string cols);

Description

Retrieves data from a data table selection in a form suitable for creating axis labels (single or multiple lines). The array of arrays of strings is ideal for use with spanned X-labels, for example:

string[][] labs = DbUtil.GetStrings(myselection,"Months","Quarters","Years");

If only one column is requested, the data is returned as a simple array of labels. It a numeric column is requested, it is returned as strings by running its default ToString method.

See also ...

Spanned labels in tables headers and X-labels | Working with Databases


SharpPlot 2.51 User Manual: GetStrings Method (DataRow[],String,String[])

GetStrings Method (DataRow[],String,String[])

Get several columns from a Selection as a String array of arrays with supplied missing value filler.

 public static string[][] GetStrings(
    DataRow[] sel,
    string nullFiller,
    string[] cols
);

See also ...

Working with Databases | GetStrings Method


SharpPlot 2.51 User Manual: GetStrings Method (DataRow[],String[][])

GetStrings Method (DataRow[],String[][])

Get several columns from a Selection as a String array of arrays with missing values replaced with blank.

public static string[][] GetStrings(
    DataRow[] sel,
    string[] cols
);

See also ...

Working with Databases | GetStrings Method


SharpPlot 2.51 User Manual: GetStrings Method (DataRow[],String,String)

GetStrings Method (DataRow[],String,String)

Get one column from a Selection as a String array with supplied missing value filler.

 public static string[] GetStrings(
    DataRow[] sel,
    string nullFiller,
    string cols
);

See also ...

Working with Databases | GetStrings Method


SharpPlot 2.51 User Manual: GetStrings Method (DataRow[],String)

GetStrings Method (DataRow[],String)

Get one column from a Selection as a String array with missing values replaced by blank.

 public static string[] GetStrings(
    DataRow[] sel,
    string cols
);

See also ...

Working with Databases | GetStrings Method


SharpPlot 2.51 User Manual: Licensing

Licensing

Dyalog Ltd. acquired Causeway Graphical Systems and their suite of products in 2007.

SharpPlot is used by a significant number of important clients, and will continue to be supported and enhanced by Dyalog for the foreseeable future.

Pricing

A single developer licence costs £600.

Contact

For further information, please contact sales@dyalog.com or call our UK office on +44 (0)1256 830030.

Dyalog Ltd,
Minchens Court,
Minchens Lane,
Bramley,
Hampshire
RG26 5BH,
United Kingdom.


SharpPlot 2.51 User Manual: PageMap Members

PageMap Members

  • Width Property
  • Height Property
  • PointsToAxes Method
  • AxesToPoints Method
  • EnumerateCharts Method
  • FindChart Method
  • FindHint Method
  • FindHotspot Method
  • FindHyperlink Method
  • FindInfo Method
  • FindPoints Method
  • FindScriptValue Method
  • FindTip Method
  • GetHotspotInfo Method
  • GetTracker Method