Namespace: GlobFX.SwiffChartGenerator
Assembly: GlobFX.SwiffChartGenerator (in GlobFX.SwiffChartGenerator.dll)
Specifies the characters to be treated as separators in the string arguments of the SetSeriesValuesFromString, SetCategoriesFromString and SetDataFromTxtFile methods.
Public Sub SetSeparators( separators As String, ignore_mult_separators As Boolean )
public void SetSeparators( string separators, bool ignore_mult_separators );
By default, SetSeriesValuesFromString, SetCategoriesFromString and SetDataFromTxtFile methods treat the character ";" as the unique separator and two consecutive ";" characters in a string delimit a blank value.
The following code illustrates use of the SetSeparators method.
' Let's set the categories of a chart object with a ";"-delimited string Dim sep As String = ";" Dim ignore_mult_separators As Boolean = True ' Before setting the categories, we must specify the separators chart.SetSeparators(sep, ignore_mult_separators) Dim myString As String = "North America" + sep + "South America" + sep + "Europe" + sep + "Middle East" + sep + "Asia" ' Fill the chart with the categories stored in the myString variable chart.SetCategoriesFromString(myString)
// Let's set the categories of a chart object with a ";"-delimited string string sep= ";"; bool ignore_mult_separators= true; // Before setting the categories, we must specify the separators chart.SetSeparators(sep, ignore_mult_separators); string myString= "North America" + sep + "South America" + sep + "Europe" + sep + "Middle East" + sep + "Asia"; // Fill the chart with the categories stored in the myString variable chart.SetCategoriesFromString(myString);
You can also specify whether the chart object should ignore multiple separators or not (i.e. the boolean argument ignore_mult_separators) while processing the strings or text file passed as arguments of the SetSeriesValuesFromString, SetCategoriesFromString or SetDataFromTxtFile methods. The following example shows how it can affect the way data are stored in the chart object.
// Let's set the categories with ";"-delimited string sep= ";"; // The myString variable has two consecutive separators myString= "North America" + sep + sep + "South America" + sep + "Europe" + sep + "Middle East" + sep + "Asia";
chart.SetSeparators(sep, true); chart.SetCategoriesFromString(myString);
...leads the following categories stored in the chart object:
Categories = | North America | South America | Europe | Middle East | Asia |
---|
chart.SetSeparators(sep, false); chart.SetCategoriesFromString(myString);
...leads to the following categories stored in the chart object (Notice the blank value):
Categories = | North America | South America | Europe | Middle East | Asia |
---|
GetSeparators Method | SetSeriesValuesFromString Method | SetCategoriesFromString Method | SetDataFromTxtFile Method
Applies To: Chart Object