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.

Visual Basic
Public Sub SetSeparators( separators As String, ignore_mult_separators As Boolean )
C#
public void SetSeparators( string separators, bool ignore_mult_separators );

Arguments

separators
A string that specifies the characters treated as separators.
ignore_mult_separators
A boolean value.
True : consecutive separators are treated as a single separator.
False : two consecutive separators delimit a blank value.

Remarks

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.

Sample Code

The following code illustrates use of the SetSeparators method.

Visual Basic
' 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)
C#
// 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);

About multiple separators

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";

  1. Ignoring multiple separators and calling the method SetCategoriesFromString...
    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

  2. However, treating multiple separators as blank values and calling the method SetCategoriesFromString...
    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

See Also

GetSeparators Method | SetSeriesValuesFromString Method | SetCategoriesFromString Method | SetDataFromTxtFile Method

Applies To: Chart Object