Difference between revisions of "CreateDiagram"
(jrfconvert import) |
|||
(3 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{HelpFiles}} | |
− | |||
− | ====createDiagram==== | + | ==== createDiagram ==== |
− | From input structure creates an image. | + | From input structure creates an image. |
− | '''Syntax''' | + | '''Syntax''' |
− | createDiagram(''diagramSpecification, imageName'') | + | createDiagram(''diagramSpecification, imageName'') |
− | '''Arguments''' | + | '''Arguments''' |
− | ''diagramSpecification:'' Is a string expression. | + | ''diagramSpecification:'' Is a string expression. |
− | ''imageName:'' Is a string expression. | + | ''imageName:'' Is a string expression. |
− | '''Return type''' | + | '''Return type''' |
− | empty | + | empty |
− | '''Examples''' | + | '''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>"+'' |
− | All | + | ''"<item>"+haveBoyfriend+"</item>"+'' |
− | __NOTOC__ | + | |
− | <!-- imported from file: 657.htm--> | + | ''"<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}}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: "http://[sitename].catglobe.com/Public/GetImage.aspx?tempfile=Chart/Test_Create_Diagram.png"). | ||
+ | |||
+ | '''Availability''' | ||
+ | |||
+ | All __NOTOC__ <!-- imported from file: 657.htm--> | ||
+ | |||
+ | [[Category:Diagram/report_generating_CGScript_functions]] |
Latest revision as of 08:31, 28 December 2011
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: 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: "http://[sitename].catglobe.com/Public/GetImage.aspx?tempfile=Chart/Test_Create_Diagram.png").
Availability
All