| Contents > SharpPlot > Methods | Index |
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.
