Specifies the data (i.e.: title, series values & captions, categories, etc) directly from the query string (i.e.: the argument of an ASP page)

object.SetDataFromQuery( ) 

Arguments

object
Required. A Chart object.

Remarks

The chart objet actually parses the query string and interpretes each keys defined in the table below according to their respecive 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 generated Flash movie.
height An integer value that specifies the height in pixels of the generated Flash movie.
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 argument of an ASP 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:


Sample 2 (with "|" as separator)

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

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


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:


JScript Sample Code

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

  North America South America Europe
Year 1998 12 7.5 11.3
Year 2001 33 25.5 29.3
http://localhost/myChart.asp?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%201998;Year%202001

The myChart.asp page could include the following JScript code to display the generated Flash movie corresponding to this url.

<% @Language=JScript %>
<%
var chart;
chart= Server.CreateObject("SwiffChartObject.ChartObj.1");

//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 1998;Year 2001&animate=true"
chart.SetSeparators( ";", true );
chart.LoadStyle( "C:\myStyle.scs" );
chart.SetDataFromQuery();
chart.ExportAsResponse();

Response.End();
%>

See Also

SetSeriesValuesFromString Method | SetSeriesValuesFromArray Method | SetCategoriesFromString Method | SetCategoriesFromArray Method | SetTitle Method | AnimateChart Method

Applies To: Chart Object