Namespace: GlobFX.SwiffChartGenerator
Assembly: GlobFX.SwiffChartGenerator (in GlobFX.SwiffChartGenerator.dll)

Specifies the data (i.e. title, series values & captions, categories, etc) directly from the query string (i.e. the url arguments of the page)

Visual Basic

    Public Sub SetDataFromQuery

C#

    public void SetDataFromQuery();

#### Remarks

The chart objet actually parses the query string and interpretes each keys defined in the table below according to their respective definition. No key order is required in the query string.

Key | Definition
--- | ---
title | A string that specifies the title of the chart
series1 series2 series3 ... | A character-delimited string that specifies a new series to be added to the chart. The string contains the values of the new series.
seriesxy1 seriesxy2 seriesxy3 ... | A character-delimited string that specifies a new XY series to be added to the chart. The string contains the set of value pairs of the new XY series formatted as follows: x1 y1 x2 y2 ... xn yn Note: This key is to be used when manipulating XY data series required for displaying XY-Curves and XY-Scatter.
captions | A character-delimited string that specifies the captions of the series in the chart.
categories | A character-delimited string that specifies the categories of the chart.
animate | A boolean value that specifies whether the chart is animated or not. Can be true/1/yes or false/0/no.
width | An integer value that specifies the width in pixels of the chart.
height | An integer value that specifies the height in pixels of the chart.
fps | An integer value that specifies the frame rate in frames per second of the generated Flash movie.

The string arguments categories, captions, series1, series2, ..., seriesxy1, seriesxy2, ... are parsed by the chart object according to the separator characters specified to the chart object (see the SetSeparators method for specifying separator characters and rules).

The ";" character is the default separator character.

Note: If you are using the seriesxy1, seriesxy2... keys, the categories key is ignored.

#### Query Samples

Here are some samples of a valid query string to be passed as url arguments of a page.

Sample 1 (with ";" as separator)

    title=My Chart&categories=Categ1;Categ2&captions=My First Series;My Second Series&series1=1;2&series2=10;20

The previous query leads to a chart with the following caracteristics:

- The chart title is "My Chart".
- The chart has 2 categories.
- The 2 categories names are "Categ1" and "Categ2".
- The chart has 2 series.
- The 2 series captions are "My First Series" and "My Second Series".

Sample 2 (with "|" as separator)

    animate=false&title=My Chart&series1=10|20

The previous query leads to a chart with the following caracteristics:

- The chart title is "My Chart".
- The chart has a single series with 2 values.
- The single series has no caption.
- The chart is not animated and will be displayed as a static image (Flash movie with a single frame).

Sample 3 (for XY-Scatter and XY-Curves, with "|" as separator)

    title=My Chart&seriesxy1=5|10|13|20

The previous query leads to a chart with the following caracteristics:

- The chart title is "My Chart".
- The chart has a single series with 2 XY Points (5,10) and (13,20) for being displayed as XY-Scatter or XY-Curves.
- The single series has no caption.

#### Sample Code

This example illustrates how to encode the following table in a query string to be passed as url arguments of a chart object in a page.

| North America | South America | Europe
--- | --- | --- | ---
Year 2006 | 12 | 7.5 | 11.3
Year 2007 | 33 | 25.5 | 29.3

    http://localhost/myChart.aspx?title=My%20Chart&categories=North%20America;South%20America;Europe&series1=12;7.5;11.3&series2=33;25.5;29.3&animate=true&captions=Year%202006;Year%202007

The myChart.aspx page could include the following C# code to display the generated Flash movie corresponding to this url.

Visual Basic

    chart.LoadStyle( "C:\\myStyle.scs" )

    ' The query string is equal to "title=My Chart&categories=North America;South America;Europe&
    ' series1=12;7.5;11.3&series2=33;25.5;29.3&captions=Year 2006;Year 2007&animate=true"
    chart.SetDataFromQuery

C#

    chart.LoadStyle( "C:\\myStyle.scs" );

    // The query string is equal to "title=My Chart&categories=North America;South America;Europe&
    // series1=12;7.5;11.3&series2=33;25.5;29.3&captions=Year 2006;Year 2007&animate=true"
    chart.SetDataFromQuery();

#### See Also

SetSeriesValuesFromString Method | SetSeriesValuesFromArray Method | SetCategoriesFromString Method | SetCategoriesFromArray Method | Title Property | AnimateChart Method

Applies To: Chart Object