Difference between revisions of "CreateDiagram"

From Catglobe Wiki
Jump to: navigation, search
Line 1: Line 1:
[[Category:Diagram/report generating CGScript functions]]
+
{{HelpFiles}}  
{{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'''  
  
''string diagramSpecification1 = ''
+
''number alone = 120; ''  
  
'' "<?xml version=\"1.0\" encoding=\"utf-8\" ?>"+''
+
''number married = 29;''  
  
'' "<diagram>"+''
+
''number haveBoyfriend = 72;''  
  
'' "<chart chart-type=\"chart-diagram\" stylesheetid=\"78\">"+''
+
''number haveGirlfriend = 36;''  
  
'' "<title>CRM Readiness Profile</title>"+''
+
''number separated = 59;''  
  
'' "<axis-label>Strukturorientering</axis-label>"+''
+
''number widow = 12;''  
  
'' "<axis-label>Kundeorientering</axis-label>"+''
+
''string diagramSpecification1 = ''  
  
'' "<axis-label>Forandringsparathed</axis-label>"+''
+
''"<?xml version=\"1.0\" encoding=\"utf-8\" ?>"+''  
  
'' "<axis-label>Forretningsorientering</axis-label>"+''
+
''"<diagram>"+''  
  
'' "<axis-label>Average score</axis-label>"+''
+
''"<chart chart-type=\"chart-diagram\" stylesheetid=\"559\">"+''  
  
'' "<series series-legend=\""+Stamdata[0]+"\" series-type=\"bar\">"+''
+
''"<title>Marital Status</title>"+''  
  
'' "<item>"+strukturorientering+"</item>"+''
+
''"<axis-label>I'm alone</axis-label>"+''  
  
'' "<item>"+kundeorientering+"</item>"+''
+
''"<axis-label>I'm married</axis-label>"+''  
  
'' "<item>"+forandringsparathed+"</item>"+''
+
''"<axis-label>I have a boyfriend who I live with</axis-label>"+''  
  
'' "<item>"+forretningsorientering+"</item>"+''
+
''"<axis-label>I have a girlfriend that I do not live with</axis-label>"+''  
  
'' "<item>"+samletScore+"</item>"+''
+
''"<axis-label>I have separated or divorced</axis-label>"+''  
  
'' "</series>"+"</chart>"+"</diagram>";''
+
''"<axis-label>I am a widow/widower</axis-label>"+''  
  
''string diagramNavn1= "CRM_RPQ" + getRPQId() + "_1.png";''
+
''"<series series-legend=\"Marital Status\" series-type=\"bar\">"+''  
  
''createDiagram(diagramSpecification1, diagramNavn1);''
+
''"<item>"+alone+"</item>"+''  
  
'''Availability'''
+
''"<item>"+married+"</item>"+''  
  
All
+
''"<item>"+haveBoyfriend+"</item>"+''
__NOTOC__
+
 
<!-- imported from file: 657.htm-->
+
''"&lt;item&gt;"+haveGirlfriend+"&lt;/item&gt;"+''
 +
 
 +
''"&lt;item&gt;"+separated+"&lt;/item&gt;"+''
 +
 
 +
''"&lt;item&gt;"+widow+"&lt;/item&gt;"+''
 +
 
 +
''"&lt;/series&gt;"+"&lt;/chart&gt;"+"&lt;/diagram&gt;";''
 +
 
 +
''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://abc.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]]

Revision as of 08:27, 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 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