SharpPlot Reference > SharpPlot Methods > 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

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 | SharpPlot.KeyStyle Property | SharpPlot.ModelFitKey Property | SharpPlot.TrendLineKey Property


Send comments on this topic
© Dyalog Ltd 2021