CreateDiagram

From Catglobe Wiki
Revision as of 08:27, 28 December 2011 by Cg van (talk | contribs)
Jump to: navigation, search


createDiagram

From input structure creates an image.

Syntax

createDiagram(diagramSpecification, imageName)

Arguments

diagramSpecification: Is a string expression.

imageName: Is a string expression.

Return type

empty

Examples

number alone = 120;

number married = 29;

number haveBoyfriend = 72;

number haveGirlfriend = 36;

number separated = 59;

number widow = 12;

string diagramSpecification1 =

"<?xml version=\"1.0\" encoding=\"utf-8\" ?>"+

"<diagram>"+

"<chart chart-type=\"chart-diagram\" stylesheetid=\"559\">"+

"<title>Marital Status</title>"+

"<axis-label>I'm alone</axis-label>"+

"<axis-label>I'm married</axis-label>"+

"<axis-label>I have a boyfriend who I live with</axis-label>"+

"<axis-label>I have a girlfriend that I do not live with</axis-label>"+

"<axis-label>I have separated or divorced</axis-label>"+

"<axis-label>I am a widow/widower</axis-label>"+

"<series series-legend=\"Marital Status\" series-type=\"bar\">"+

"<item>"+alone+"</item>"+

"<item>"+married+"</item>"+

"<item>"+haveBoyfriend+"</item>"+

"<item>"+haveGirlfriend+"</item>"+

"<item>"+separated+"</item>"+

"<item>"+widow+"</item>"+

"</series>"+"</chart>"+"</diagram>";

string diagramName= "Test_Create_Diagram.png";

createDiagram(diagramSpecification1, diagramName);

//Result: Public/GetImage.aspx?tempfile=Chart/Test_Create_Diagram.png

Note Note: You have to change style sheet Id to style sheet Id on your working site and add your site name before image path (e.g: Test_Create_Diagram.png)

Availability

All