Each of the graph object types has its own root object. For example: bar graph properties are contained by <cit:bar-graph>, pie charts are contained by <cit:pie-graph>, etc. There can be any number of graph objects in an Image Template file. Each has its own name, data, and formatting options.
Graph objects support the following methods:
|
method |
|
addHoverText |
|
|---|---|---|---|
|
Syntax |
|
graph.addHoverText(Category, Series, Text [; Category, Series, Text]*) |
|
|
Description
|
|
Adds hover text to any data items that are in the specified categories and series. Hover text refers to a manually-created box of text that appears as a user mouses over a specific data item. For more information, see Hover Text in the Corda Builder™ User Guide. Each graph.addHoverText method can specify any number of hover textboxes. The parameters for each different hover text item should be separated from the parameters for other hover text items by a semi-colon(;) or the item delimiter (specified in main.itemDelimiter). Note: When loading data via the graph.loadFile command, call addHoverText after calling graph.loadFile. Otherwise, Corda Server™ is unable to associate the hover text with the correct data item. |
|
|
Parameters |
|
graph.addHoverText accepts the following parameters: |
|
|
|
|
Category |
{ int | int-int | Category Name } |
|
|
|
Specifies the category or categories of the data items that hover text appears for. This value can be an integer, a range of integers, or the name of a category that has been specified in a graph.setCategories method. If the value of this parameter is an integer, it refers to the nth category listed in the graph.setCategories method, where n is the integer specified. So, for example, if Fred is the second category name listed in the graph.setCategories method, and 2 is passed as the value of the categories parameter, 2 refers to the Fred category. If you want to access a category number that is the same as another category's name, use the pound sign (#) before the category number. This lets Corda Server know that you are referring to a category number instead of a category name. For example, if category number 5 is named 3, then the statement graph.addHoverText(3,1,Hello) adds hover text to category number 5 and not 3 because it assumes you are referring to the category name. However, if you include a pound sign (#) before the number 3—for example, graph.addHoverText(#3,1,Hello)—then Corda Server overrides the category name and instead adds hover text to category number 3. Denote a range of categories with an integer followed by a hyphen (-) and another integer. The first integer represents the first category that displays hover text, and the last integer indicates the last category that displays hover text. All data items in categories between these two also display hover text. Line 5 of Example 1 below illustrates how to do this. If you choose 0 as the category number, hover text is added to the appropriate series names in the legend. Because X-Y and Time graphs do not use categories, the value of this parameter for those graphs is the number of the data item in the specified data series that you want to add hover text to. Example 2 below illustrates this difference. Important: In graphs where data is sorted (Pareto, X-Y, and Time graphs where Properties > Graph Properties > General > Sort Data has been checked), the category number refers to the category that the item has been sorted into, as opposed to the category under which it was originally listed. Disable this behavior in X-Y and Time graphs by unchecking the Sort Data option. |
|
|
|
|
Series |
{ int | int-int | Series Name } |
|
|
|
Specifies the series of the data items that hover text appears for. This value can be an integer, a range of integers, or the name of a series that has been specified in a graph.setSeries method. If the value of this parameter is an integer, it refers to the nth series listed in the graph.setSeries method(s), where n is the integer specified. For example, if Fruit is the name of the series described in the second graph.setSeries method, and 2 is passed as the value of the series parameter, 2 refers to the Fruit series. To access a series number that is the same as another series' name, use the pound sign (#) before the series number. This lets Corda Server know that you are referring to a series number instead of a series name. For example, if series number 5 is named 3, then the statement graph.addHoverText(1,3,Hello) adds hover text to series number 5 and not 3 because it assumes you are referring to the series name. However, if you include a pound sign (#) before the number 3—for example, graph.addHoverText(1,#3,Hello)—then Corda Server overrides the series name and instead adds hover text to series number 3. A range of series is denoted by an integer followed by a hyphen (-) and another integer. The first integer represents the first series that displays hover text, and the last integer indicates the last series that displays hover text. All data items in series between these two also display hover text. This works similarly to the range of categories shown in Line 5 of Example 1 below. |
|
|
|
|
Text |
String |
|
|
|
The text that appears as the user mouses over the specified data item(s). Force a new line in the hover text by inserting a backslash and the letter n (\n). In Javascript*, however, \n is interpreted as an escape code; therefore, use \\n in Javascript to specify a new line. Important: When sending PCScript in an HTTP Request (i.e., not Corda® Embedder), URL-encode this command, especially if the hover text string contains spaces or other irregular characters. For more information about URL encoding issues, see Encoding Issues with Extended Characters. |
|
|
Examples |
|
graph.setCategories(Barney; Wilma; Fred; Pebbles) graph.setSeries(English;90;85;94;78) graph.setSeries(Math;87;96;53;94) graph.setSeries(Science;59;42;51;75) graph.addHoverText(Fred, Math, Fred is failing Math) graph.addHoverText(3, 2, Fred is failing Math) graph.addHoverText(1-3, Science, Barney and Wilma and Fred are failing Science) graph.addHoverText(Fred, 1, Fred has the best English score; 2, Math, Wilma has the best Math score)
Lines 5 and 6 in Example 1 above are the same command. The first uses category and series names, while the second uses numbers. In both cases, the text Fred is failing Math appears as the user mouses over the data item in the Fred category in the Math series. Line 7 shows how to incorporate a range of data items. Data items that are in both the Science series and categories 1-3 display the hover text Barney and Wilma and Fred are failing Science. Line 8 shows how more than one hover textbox can be added with just one graph.addHoverText command. Example 2: Adding Hover Text for an X-Y Line Graph graph.setSeries(Blue; 7,10; 30,0; 23,30) graph.setSeries(Red; 0,10; 5,0; 10,7) graph.addHoverText(2, 2, Second Red Plot Point) Example 2 above shows how graph.addHoverText differs for X-Y and Time graphs. In this case, the hover text Second Red Plot Point appears as the user mouses over the data point (5,0). |
|
|
method |
|
addITXML |
|
|---|---|---|---|
|
Syntax |
|
graph.addITXML(itxml) |
|
|
Description
|
|
Inserts the specified ITXML properties into this graph object. If a property has already been defined (e.g., in the Image Template file), this statement overrides it. If no Image Template file is currently open, this command creates a new Image Template file and inserts the specified object into the empty Image Template file. The ITXML in this file is appended to the ITXML from the Image Template file and from any previous addITXML commands. Adding an image object that has the same name as an existing image object in the Image Template file replaces the existing image object with the new image object. The graph.addITXML command is useful for accessing Corda Server features not available through the PCScript API. It allows you to add to or modify this object's definition within the actual Image Template file. For example, to change the value scale so that it is logarithmic and on the right side of the graph, use graph.addITXML to change the ITXML that defines the scale. Example 1 below illustrates how to do this. Examples 2 and 3 show how this statement affects the graph object's definition in the Image Template file. Note that this applies only to properties of the root graph element (e.g., <cit:bar-graph>). To modify attributes of the root graph element (e.g., common=”top:20;”), use the graph.setITXMLAttributes method. |
|
|
Parameters |
|
graph.addITXML accepts the following parameters: |
|
|
|
|
itxml |
String |
|
|
|
A string of ITXML. This ITXML should contain valid properties of the root graph element. For more information about ITXML, see ITXML. |
|
|
Examples |
|
Example 1: graph.addITXML Method Call graph.addITXML(<cit:value-scale position="right"/>) Example 2: Graph Definition before Calling addITXML in Example 1 <cit:bar-graph name="graph"> <cit:value-scale position="left"> </cit:value-scale> ... </cit:bar-graph> Example 3: Graph Definition after Calling addITXML in Example 1 <cit:bar-graph name="graph"> <cit:value-scale position="right"> </cit:value-scale> ... </cit:bar-graph> |
|
|
method |
|
addNote |
|
|---|---|---|---|
|
Syntax |
|
graph.addNote(Category, Series, Text, [Textbox_name]; [Category, Series, Text, [Textbox_name]]*) |
|
|
Description
|
|
Adds a note to any data items that are in the specified categories and series. Notes are a combination of textboxes and hover text. In fact, another name for a note is a sticky hover. Like hover text, notes are attached to a specific data item; however, like textboxes, they are always visible. Notes "call out" from the data item—there is a leader line from the data item to the note box. Change the format for dynamically generated notes in Corda Builder using Object Properties. You can change the positioning, font, color, and other settings of dynamic notes. Using an optional fourth parameter in graph.addNote attaches a note to Textbox objects. This gives you more control over the formatting of a note. Each graph.addNote method can specify any number of Note boxes. The parameters for each note box should be separated from the parameters of other note boxes by a semi-colon (;) or the item delimiter (specified in main.itemDelimiter). Important: When loading data via the graph.loadFile command, call addNote after calling graph.loadFile. Otherwise, Corda Server is unable to associate the note with the correct data item. |
|
|
Parameters |
|
graph.addNote accepts the following parameters: |
|
|
|
|
Category |
{ int | int-int | Category Name } |
|
|
|
Specifies the category or categories of the data items for which a note appears. This value can be an integer, a range of integers, or the name of a category that has been specified in a graph.setCategories method. If the value of this parameter is an integer, it refers to the nth category listed in the graph.setCategories method, where n is the integer specified. So, for example, if Fred is the second category name listed in the graph.setCategories method, and 2 is passed as the value of the categories parameter, 2 refers to the Fred category. If you want to access a category number that is the same as another category's name, use the pound sign (#) before the category number. This lets Corda Server know that you are referring to a category number instead of a category name. For example, if category number 5 is named 3, then the statement graph.addNote(3,1,Hello) adds a note to category number 5 and not 3 because it assumes you are referring to the category name. However, if you include a pound sign (#) before the number 3—for example, graph.addNote(#3,1,Hello)—then Corda Server overrides the category name and instead adds a note to category number 3. Denote a range of categories with an integer followed by a hyphen (-) and another integer. The first integer represents the first category that displays the note, and the last integer indicates the last category that displays the note. All data items in categories between these two also display the note. Line 5 of Example 1 below illustrates how to do this. Because X-Y and Time graphs do not use categories, the value of this parameter for those graphs is the number of the data item in the specified data series that you want to add a note to. Example 2 below illustrates this difference. Important: In graphs where data is sorted (Pareto, X-Y, and Time graphs where Properties > Graph Properties > General > Sort Data has been checked), the category number refers to the category that the item has been sorted into, as opposed to the category under which it was originally listed. Disable this behavior in X-Y and Time graphs by unchecking the Sort Data option. |
|
|
|
|
Series |
{ int | int-int | Series Name } |
|
|
|
Specifies the series of the data items for which a note appears. This value can be an integer, a range of integers, or the name of a series that has been specified in a graph.setSeries method. If the value of this parameter is an integer, it refers to the nth series listed in the graph.setSeries method(s), where n is the integer specified. For example, if Fruit is the name of the series described in the second graph.setSeries method, and 2 is passed as the value of the series parameter, 2 refers to the Fruit series. To access a series number that is the same as another series' name, use the pound sign (#) before the series number. This lets Corda Server know that you are referring to a series number instead of a series name. For example, if series number 5 is named 3, then the statement graph.addNote(1,3,Hello) adds hover text to series number 5 and not 3 because it assumes you are referring to the series name. However, if you include a pound sign (#) before the number—3graph.addNote(1,#3,Hello)—then Corda Server overrides the series name and instead adds a note to series number 3. A range of series is denoted by an integer followed by a hyphen (-) and another integer. The first integer represents the first series that displays a note, and the last integer indicates the last series that displays a note. All data items in series between these two also display a note. This works similarly to the range of categories shown in Line 5 of Example 1. |
|
|
|
|
Text |
String |
|
|
|
The text that appears in the note box. Force a new line in the hover text by inserting a backslash and the letter n (\n). In Javascript, however, \n is interpreted as an escape code; therefore, use \\n in Javascript to specify a new line. |
|
|
|
|
Textbox |
textbox object |
|
|
|
(Optional) This parameter allows you to specify the name of a textbox object that the note is attached to. For example, attach a note to a textbox or note box called notebox1 with the following code: graph.addNote(Wilma, Math, Wilma’s math score was the highest score of all!, textbox1) Important: When sending PCScript in an HTTP Request (i.e., not Corda Embedder), URL-encode this command, especially if the hover text string contains spaces or other irregular characters. For more information about URL encoding issues, see Encoding Issues with Extended Characters. |
|
|
Examples |
|
graph.setCategories(Barney; Wilma; Fred; Pebbles) graph.setSeries(English;90;85;94;78) graph.setSeries(Math;87;96;53;94) graph.setSeries(Science;59;42;51;75) graph.addNote(Fred, Math, Fred is failing Math) graph.addNote(3, 2, Fred is failing Math) graph.addNote(1-3, Science, Barney and Wilma and Fred are failing Science) graph.addNote(Fred, 1, Fred has the best English score; 2, Math, Wilma has the best Math score) graph.addNote(Wilma, Math, Wilma's math score was the highest score of all!, notebox1) Lines 5 and 6 in Example 1 are the same command. The first uses category and series names, while the second uses numbers. In both cases, the text Fred is failing Math appears in a note connected to the Fred category in the Math series. Line 7 shows how to incorporate a range of data items. Data items that are in both the Science series and categories 1-3 display the hover text Barney and Wilma and Fred are failing Science. Line 8 shows how more than one note can be added with just one graph.addNote command. Example 2: Adding Notes for X-Y and Time Graphs graph.setSeries(Blue; 7,10; 30,0; 23,30) graph.setSeries(Red; 0,10; 5,0; 10,7) graph.addNote(1, 2, Second Red Plot Point) Example 2 shows how graph.addNote differs for X-Y and time graphs. In this case, the text Second Red Plot Point appears as a note connected to the data point (5,0). Remember, because X-Y and time graphs do not use categories, the first parameter is the number of the data item in the specified data series to which you want to add the note. |
|
|
method |
|
addScaleMarker |
|
|---|---|---|---|
|
Syntax |
|
graph.addScaleMarker(scale, type, low/width, high/position, color) |
|
|
Description
|
|
Places a line over, or a highlighted range behind, the graph at the specified scale index on the graph. This is helpful when you want to emphasize data items that are above or below a certain level or when you want to emphasize data items that are in a certain range. There are two types of scale markers: range and line. The line scale marker draws a line over the graph at a certain scale index, and the range scale marker highlights the area between two scale indices. Highlighting appears behind the graph. The example below illustrates the difference between line and range scale markers. Pie graphs and gauges are the only graphs that do not have scale markers. |
|
|
Parameters |
|
graph.addScaleMarker uses the following parameters: |
|
|
|
|
scale |
{ x | y | value | svalue | time } |
|
|
|
The scale that you want to put the value on. For most graphs, set this to value (value scale). However, the following graph types support alternative values:
|
|
|
|
|
type |
{ range | line } |
|
|
|
Sets the type of the scale marker, line or range. |
|
|
|
|
low/width |
int |
|
|
|
For line scale markers, this parameter sets the width of the line. For range scale markers, this sets the value along the specified scale at which to begin highlighting. |
|
|
|
|
high/position |
int |
|
|
|
For line scale markers, this value is the position of the line along the scale specified with the scale parameter. For range scale markers, this represents the value along the specified scale at which to end highlighting. This value must be higher than the value passed to the low/width parameter. |
|
|
|
|
color |
color |
|
|
|
The color of the graph, using the standard six-digit hexadecimal representation (RRGGBB). There should not be a pound sign (#) before the color code. |
|
|
|
|
legend text |
String |
|
|
|
Specifies the text that appears in the legend for the scale marker. |
|
|
Example |
|
In the example below, the first two commands create range scale markers, which display as green and red areas behind the graph. The last command creates a line scale marker which appears as a red line in front of the graph.
|
|
|
method |
|
appendByRow |
|---|---|---|
|
Syntax |
|
graph.appendByRow(true|false) |
|
Description
|
|
Instructs Corda Server how to append data to the graph. This applies only to data appended by using the append switch on the graph.loadFile command. If the value is true, Corda Server appends the data as new rows (series) in the graph. If the value is false, Corda Server appends the data as new columns (categories) in the graph. The default value is true. You must use this command before the graph.loadFile command you want to affect. This command can be called multiple times in the same PCScript command string. Warning: Calling any graph.setSeries commands after setting this value to false can produce very unpredictable results. |
|
method |
|
dateInputFormat |
||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Syntax |
|
graph.dateInputFormat(DateFormatString) |
||||||||||||||||||
|
Description
|
|
Sets the date input format for time plot graphs and graphs that use a time category scale. The default input format for time plot graphs and time category scales is %m/%d/%Y (month/day/year; for example, 5/23/2000). This method overrides the format only for the specified graph object. The base date for Corda Server is the current date. For example, assume that today is Jan/15/2003 and the date input format is %H:%M. If you provide a date of 5:34, then Corda Server treats the full date and time as Jan/15/2003 05h:34m. The date input format can also be set in Corda Builder by entering it in the Image Template file using Properties > Graph Properties > General > Date Input Format for time plot graphs or Properties > Bottom Scale Properties > General > Date Input Format for time category scales. |
||||||||||||||||||
|
Parameters |
|
graph.dateInputFormat accepts the following parameters: |
||||||||||||||||||
|
|
|
DateFormatString |
String | |||||||||||||||||
|
|
|
Sets the date input format. The string passed to this parameter can consist of text and any combination of macros listed in the following table. Date Formatting Macros
|
||||||||||||||||||
|
Example |
|
Setting the Date Input Format graph.dateInputFormat(%Y-%m-%d %H.%M) |
||||||||||||||||||
|
method |
|
ddEnable |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Syntax |
|
graph.ddEnable(Category, Series, URL, Target [; Categories, Series, URL, [Target]]*) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Description
|
|
Adds drilldown effects to any data items that are in the specified categories and series. Drilldown effects include linking to a different Web page or executing a Javascript function. The drilldown effect occurs whenever a user clicks a specific data item. More information about drilldown effects is available in Building Drilldown. Use any combination of static text and data macros to create unique drilldown effects for every data items in the graph. For example, suppose that when a user clicks a graph, you want the graph to drill down to a Web page generated by a Web application server at http://Webapp.mycompany.com/drilldown. However, you also want to be able to tell the Web application what data item the user just clicked. One way of doing this would be to pass the following macro to the graph.ddEnable method: http://Webapp.mycompany.com/drilldown?category = %_CATEGORY_NAME &series = %_SERIES_NAME So when a user clicks a data item in the South category and Summer series, the user drills down to the URL http://Webapp.mycompany.com/drilldown?category=South&series=Summer. Example 3 below illustrates how to make use of macros in a graph.ddEnable statement. See the paragraph that follows it to learn what the example does. Each graph.ddEnable method can specify any number of drilldown effects. The parameters for each drilldown effect should be separated by a semi-colon (;) or the item delimiter (specified in main.itemDelimiter). Note: When loading data via the graph.loadFile command, call graph.ddEnable after calling graph.loadFile. Otherwise, Corda Server is unable to associate the drilldown effect with the correct data item. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Parameters |
|
graph.ddEnable accepts the following parameters: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Category |
{ int | int-int | Category Name } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Specifies the category or categories of the data item(s) that drilldown effects are enabled for. This value can be an integer, a range of integers, or the name of a category that has been specified in a graph.appendByRow method. If the value of this parameter is an integer, it refers to the nth category listed in the graph.setCategories method, where n is the integer specified. So, for example, if Fred is the second category name listed in the graph.setCategories method, and we pass 2 as the value of the categories parameter, we are referring to the Fred category. To access a category number that is the same as another category's name, use the pound (#) sign before the category number. This lets Corda Server know that you are referring to a category number instead of a category name. For example, if category number 5 is named 3, then the statement graph.ddEnable(3,1,index.html) adds a drilldown effect to category number 5 and not 3 because it assumes you are referring to the category name. However, if you include a pound sign (#) before the number 3for example, graph.ddEnable(#3,1,Hello)then Corda Server overrides the category name and instead adds the drilldown effect to category number 3. A range of categories is denoted by an integer followed by a hyphen (-) and another integer. The first integer represents the first category that has this drilldown effect, and the last integer indicates the last category that has the drilldown effect. All categories in between also have the drilldown effect. Line 5 of Example 1 below shows a range of categories. Because X-Y and time graphs do not use categories, the value of this parameter for those graphs is the number of the data point in the specified data series to which you want to add a drilldown effect. Example 2 below illustrates this difference. Important: In graphs where data is sorted (Pareto, X-Y, and Time graphs where Properties > Graph Properties > General > Sort Data has been checked), the category number refers to the category that the item has been sorted into, as opposed to the category under which it was originally listed. Disable this behavior in X-Y and Time graphs by unchecking the Sort Data option. If you set 0 as the category number, the drilldown effect is added to the appropriate series name(s) in the legend. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Series |
{ int | int-int | Series Name } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Specifies the series of the data item(s) for which drilldown effects are enabled. This value can be an integer, a range of integers, or the name of a series that has been specified in a graph.setSeries method. If the value of this parameter is an integer, it refers to the nth series listed in the graph.setSeries method(s), where n is the integer specified. For example, if Fruit is the name of the series described in the second graph.setSeries method, and we pass 2 as the value of the series parameter, we are referring to the Fruit series. To access a series number that is the same as another series' name, use the pound sign (#) before the series number. This lets Corda Server know that you are referring to a series number instead of a series name. For example, if series number 5 is named 3, then the statement graph.ddEnable(1,3,index.html) adds a drilldown effect to series number 5 and not 3 because it assumes you are referring to the series name. However, if you include a pound sign (#) before the number 3for example, graph.ddEnable(1,#3,index.html)then Corda Server overrides the series name and instead adds the drilldown effect to series number 3. A range of series is denoted by an integer followed by a hyphen (-) and another integer. The first integer represents the first series that has this drilldown effect, and the last integer indicates the last series that has the drilldown effect. All data series in between also have the drilldown effect. A range of series looks exactly like the range of categories specified in Line 5 of Example 1 below. If you set 0 as the series number, the drilldown effect is added to the appropriate category label on the graph. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
URL |
{ URL | Javascript function } | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
The Web page or Javascript function that the data items drill down to. If the URL parameter is a Web page, the link is relative to the location of the Web page that contains the Corda image. Iinclude the URL prefix http:// to specify the absolute path to a Web page. If the URL parameter is a Javascript function, it must be prefixed with Javascript:. The function must also be declared within the Web page that contains the Corda image. For more information, see Drilldown to Javascript Functions. The URL can also contain macros that represent data item-specific values that create a global drilldown destination for the graph (see Example 3 below) The following table lists the available drilldown macros.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Target |
String | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
The target window or frame that the data items drill down to. This parameter is optional and should not be used when drilling down to a Javascript function. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Examples |
|
Example 1: Adding Drilldown Effects graph.setCategories(Produce; Poultry; Pastries) graph.setSeries(March;190;161;96) graph.setSeries(April;295;150;113) graph.setSeries(May;374;142;117) graph.ddEnable(Pastries, May, pastry.html) graph.ddEnable(3, 3, pastry.html) graph.ddEnable(2-3, March, http://www.foodsales.com/march.html) graph.ddEnable(Poultry, 3, Javascript:alert("Poultry sales are falling!"); 2, 1, poultry.html, march) Lines 5 and 6 in Example 1 above are the same command. The first uses category and series names, and the second uses numbers. In both cases, the data item in the Pastries category and the May series drills down to the Web page pastry.html when a user clicks it. Line 7 shows how to incorporate a range of data items. Data items in the March series and in categories 2-3 (Poultry and Pastries drill down to the Web site http://www.foodsales.com/march.html. Line 8 illustrates several drilldown features. First, it shows how more than one drilldown effect can be added with just one graph.ddEnable command. Second, it shows how a Javascript function may be used in place of a URL. In this case, the data item in the Poultry category and the May series execute the function alert('Poultry sales are falling!') when the user clicks it. Finally, the second drilldown effect shows how a target can be specified. In this case, the data item in the Poultry category and March series drills down to the target march in the Web page poultry.html. Example 2: Drilldown Effects for an X-Y Line Graph graph.Series(Blue; 7,10; 30,0; 23,30) graph.setSeries(Red; 0,10; 5,0; 10,7) graph.ddEnable(3, Blue, http://www.blue.com) Example 2 shows how graph.ddEnable differs for X-Y and time graphs. In this case, the third data point in the Blue series (23,30) drills down to the Web site http://www.blue.com. Example 3: Adding a Global Drilldown Destination graph.ddEnable(1-99,1-99,http://www.myappserver.com/newscript?Series=%_SERIES_NUMBER&Category=%_CATEGORY_NUMBER) Example 3 shows how to use graph.ddEnable to create a global drilldown destination. If you aren't sure how many series or categories are in a graph, simply set the range from 1 to 99, assuming that there are no more than 99 series or categories. Set this range higher if you are dealing with a larger data set. The example also illustrates the use of macros in a graph.ddEnable statement. Macros are textual keywords that represent data item-specific values. Macros begin with a percentage sign and underscore (%_). The macros in this statement, %_CATEGORY_NUMBER and %_SERIES_NUMBER, refer to the data item's category and series number, respectively. So if a bar is in series 2 and category 9, the drilldown URL for the bar is http://www.myappserver.com/newscript?Series=2&Category=9. For a complete list of macros, see the Drilldown Macros table above. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
method |
|
ddPrefix |
|
|---|---|---|---|
|
Syntax |
|
graph.ddPrefix(URL) |
|
|
Description
|
|
Specifies a drilldown string for all data items in the graph. This function can also be used to specify a prefix for all URL addresses or Javascript functions passed to any subsequent graph.ddEnable methods. If all of the Web pages that you drilldown to share a common URL prefix, this method helps shorten the PCScript command string. Use this method only if all of the URLs have a common prefix, including the Javascript functions. Otherwise, this prefix is placed in front of links or functions that shouldn't have this prefix, rendering them invalid. Note that this method affects only subsequent graph.ddEnable method calls, meaning that any graph.ddEnable method calls that appear before the graph.ddPrefix method call ignore the prefix. When using more than one graph.ddPrefix, the most recent prefix overrides any previous prefixes. This lets you break up the graph.ddEnable method calls according to prefix, as demonstrated in Example 2 below. |
|
|
Parameters |
|
graph.ddPrefix accepts the following parameters: |
|
|
|
|
URL |
String |
|
|
|
The drilldown string or the prefix that Corda Server should prepend to any URL addresses or Javascript functions in subsequent graph.ddEnable method calls. |
|
|
Examples |
|
Example 1: Creating a Drilldown Prefix graph.ddPrefix(http://Webapp.mycompany.com/drilldown?) Example 2: Using ddPrefix Multiple Time in the Same Graph graph.ddPrefix(http://www.myserver.com/newgraphs/) graph.ddEnable(8, 13, profits.html) graph.ddPrefix(Javascript:) graph.ddEnable(1, 1-20, hoverwindow(net); 2, 1-20, calculate(2,54,gross))
Example 2 shows two graph.ddPrefix and graph.ddEnable method calls. The effect of the first graph.ddPrefix method call is that the first graph.ddEnable drills down to http://www.myserver.com/newgraphs/profits.html (not profits.html, as it would if there were no graph.ddPrefix command). The effect of the second graph.ddPrefix method call is that all drilldown URLs in the second graph.ddEnable method call are preceded by Javascript:, making them Javascript functions. |
|
|
method |
|
description |
|
|---|---|---|---|
|
Syntax |
|
graph.description(description) |
|
|
Description |
|
Specifies a description for this graph. This description is displayed at the beginning of this graph's section in the image's descriptive text. For more information, see Descriptive Text in the Corda Builder User Guide. |
|
|
Parameters |
|
graph.description accepts the following parameters: |
|
|
|
|
description |
String |
|
|
|
The description of this graph. |
|
|
method |
|
enableCategory |
|---|---|---|
|
Syntax |
|
graph.enableCategory(true|false, CategoryNumber, [CategoryNumber]*) |
|
Description
|
|
This enables or disables a category of data. By default, all categories of data are enabled, so use this command only to filter data categories. Important: This command works only for graphs that use the Standard Data Class. This command can be used to filter any number of categories. Each category should be separated by a comma (,). It can also filter ranges of categories, as illustrated in the example below. A range of categories is denoted by a hyphen (-) between the low and high value in the range. Perhaps the main difference between this command and graph.enableColumn command is that it is a post-processing command. It occurs after data from a spreadsheet is converted to series and categories. This means that graph.transposed applies to this command, and it doesn't apply to graph.enableColumn. The usefulness of this method is illustrated with an example where you are importing data for a bar graph. When a user clicks a certain category of bars, you want to drill down to a line graph of that category. By filtering out all of the other categories, you are able to use the exact same data as you used from the bar graph, saving you from having to make another data query. For example, if a user drills down on the second column of data, you add the following PCScript command to filter out all of the other series: |
|
Example |
|
Hiding Data Categories graph.EnableCategories(false, 1, 3-6) |
|
method |
|
enableColumn |
|---|---|---|
|
Syntax |
|
graph.enableColumn(true|false, ColumnNumber, [ColumnNumber]*) |
|
Description
|
|
This enables or disables a column of data. By default, all columns of data are enabled, so use this command only to filter data columns. Important: This command works only for graphs that use the Standard Data Class. This command is especially useful when importing HTML tables or data files that you have no control over, as these data sources might have extraneous columns of information. This command filters the specified column(s) of data if the first parameter is set to false. Otherwise, it unfilters it. This command can filter any number of columns. Each column is separated by a comma (,). It can also filter ranges of columns, as illustrated in the example below. A range of columns is denoted by a hyphen (-) between the low and high values in the range. |
|
Example |
|
Filtering Columns of Data graph.enableColumn(false, 1, 6-99) |
|
method |
|
enableRow |
|---|---|---|
|
Syntax |
|
graph.enableRow(true|false, RowNumber, [RowNumber]*) |
|
Description
|
|
Enables or disables a row of data. By default, all rows of data are enabled, so use this command only to filter data rows. Important: This command works only for graphs that use the Standard Data Class. This command is especially useful when importing HTML tables or data files that you have no control over, as these data sources might have extraneous rows of information. This command filters the specified row(s) of data if the first parameter is set to false. Otherwise, it unfilters it. This command can filter any number of rows. Each row is separated by a comma (,). It can also filter ranges of rows, as illustrated in the example below. A range of rows is denoted by a hyphen (-) between the low and high values in the range. |
|
Example |
|
Filtering Rows of Data graph.enableRow(false, 1, 3, 8-10) |
|
method |
|
enableSeries |
|---|---|---|
|
Syntax |
|
graph.enableSeries(true|false, SeriesNumber, [SeriesNumber]*) |
|
Description
|
|
This enables or disables a series of data. By default, all series of data are enabled, so use this command only to filter data series. Important: This command works only for graphs that use the Standard Data Class. This command can filter any number of series. Each series is separated by a comma (,). It can also filter ranges of series, as illustrated in the example below. A range of series is denoted by a hyphen (-) between the low and high values in the range. Perhaps the main difference between this command and graph.enableRow is that it is a post-processing command. It occurs after data from a spreadsheet is converted to series and categories. This means that graph.transposed applies to this command, and it doesn't apply to graph.enableRow. The usefulness of this method can be illustrated with an example where you are importing data for a bar graph. When a user clicks a certain series of bars, you want to drill down to a Pareto graph, which uses only one series of data. By filtering out all of the other series, you are able to use the exact same data as you used from the bar graph, saving you from having to make another data query. For example, if a user drills down on the fifth series of data, you add the following PCScript command to filter out all of the other series: |
|
Example |
|
Hiding Data Series graph.enableSeries(false, 1-4, 6) |
|
method |
|
explodePieWedge |
|
|---|---|---|---|
|
Syntax |
|
graph.explodePieWedge(seriesnumber, gapwidth) |
|
|
Description |
|
Specifies which wedge of the pie to explode. This command applies only to pie graphs. For more information about exploding pie wedges, see Exploded Pie Wedge in the Corda Builder User Guide. |
|
|
Parameters |
|
graph.explodePieWedge accepts the following parameters: |
|
|
|
|
seriesnumber |
int | String |
|
|
|
The number or series name of the pie wedge that you want to explode. |
|
|
|
|
gapwidth |
int |
|
|
|
The width of the gap between the exploded wedge and the rest of the pie. This command is optional. If no value is specified, a value of 2 is assumed. |
|
|
method |
|
hide |
|---|---|---|
|
Syntax |
|
graph.hide() |
|
Description
|
|
Hides the graph object. Use the graph.show command to make the object visible again after using graph.hide. |
|
method |
|
loadFile |
|
|---|---|---|---|
|
Syntax |
|
graph.loadFile(FileName, method, HTMLTable, encoding) |
|
|
Description
|
|
Instructs Corda Server to import data from a tab-delimited data file, comma-separated value file, XML database file, or table in an HTML file. This file or Web page must be accessible to the machine running Corda Server. By default, this command replaces all existing data in the graph. Use the append parameter to append the data from the file to the existing graph data. Corda Server automatically detects the format of the file that you load. For more information on these data formats, see Connecting to Data Files. For example, suppose you've saved the data file prices.csv in the data folder of the Corda Server document root. Load data from that file into a graph object named graph using the following PCScript method call: graph.loadFile(data/prices.csv) Similarly, to replace the data in a graph object named graph2 with data from a table named data2 on the Web page http://www.myserver.com/stats.html, you send the following PCScript to Corda Server : graph2.loadFile(http://www.myserver.com/stats.html,replace,data2) Note: You must add hover text, notes, or drilldown effects to the graph after you use this command, otherwise Corda Server is unable to associate the special effect with the corresponding data item. Important: The path.xml file must grant Corda Server permission to read files from the specified location, or it is unable to load the data. For more information, see Setting Path Permissions in the Corda 7 Install and Administration manual. Note: This command provides the same functionality as the loadData Corda Embedder method. |
|
|
Parameters |
|
graph.loadFile accepts the following parameters: |
|
|
|
|
FileName |
String |
|
|
|
Specifies the path and file name (relative to <document_root>) of the file or Web page that the data is retrieved from. Specify the path using either path or URL notation. Make sure that path.xml permits Corda Server to read from this path (see Setting Path Permissions in the Corda 7 Install and Administration manual). |
|
|
|
|
method |
append | replace |
|
|
|
Indicates the method for importing data. If method is set to replace, all data currently in the graph is replaced. If it is set to append, the imported data is appended to any data already in the graph, including data from the Image Template file. If this parameter is not set, it is assumed to be replace. It must always be set when importing data from HTML tables. |
|
|
|
|
HTMLTable |
{ int | title } |
|
|
|
The title or number of the table that is loaded from the Web page. If this parameter is a title, be sure that the title corresponds to the value of the title attribute of the <table> tag. If it is a number, Corda Server imports data from the n th table in the Web page, where n is the number you specify. The Example 2 below illustrates how this parameter is used. The first line of code imports data from the table titled pricing on the Web page stats.html. The second line of code imports data from the 11th table on the Web page morestats.html. This parameter must always be set when you import data from HTML tables. |
|
|
|
|
encoding |
String |
|
|
|
(Optional) Specifies the character encoding of the file you are loading. Valid character sets include euc-jp, utf-8, shift_jis, and unicode. If you have no idea what character encoding is, you most likely can ignore this parameter. For information about using international and double-byte characters, see International Fonts and Character Support in the Corda 7 Install and Administration manual. |
|
|
Examples |
|
Example 1: Loading a Comma-Separated Value File graph.loadFile(data/020115.csv) Example 2: Loading an HTML Table from a Web Page graph.loadFile(http://www.myserver.com/stats.html,replace,pricing) graph.loadFile(\\database\morestats.html,append,11) |
|
|
method |
|
numberOfLines |
|---|---|---|
|
Syntax |
|
graph.numberOfLines(numberOfLines) |
|
Description
|
|
Specifies the number of lines in line bar combo graphs. For example, if you set this value to 2, the first two data series are displayed as lines. All remaining data series are displayed as bars. By default the line bar combo graph has an equal number of lines and bars, and the line/stacked bar combo graph has one line. To override the default setting, specify a new value using this command. |
|
method |
|
reverseDataOrder |
|---|---|---|
|
Syntax |
|
graph.reverseDataOrder() |
|
Description
|
|
Reverses the order of the data items in the data series in the graph. For example, the last item in each data series that you sent to the graph is the first data item to be displayed. Note: This command does not work with X-Y or time plot graphs. |
|
method |
|
setCategories |
|
|---|---|---|---|
|
Syntax |
|
graph.setCategories(CategoryName; CategoryName*) |
|
|
Description
|
|
Sends the graph a set of category names separated by semi-colons (or the item delimiter, which is specified in the main.itemDelimiter method). Corda Server uses these category names to classify columns of data items. For example, the first data item in each graph.setSeries command is considered to be in the first column of data and thus belongs to the first category name specified by the graph.setCategories command. In most graphs, the category names become the values displayed along the x-axis (or category scale) of the graph. In some graphs, however, category names are used differently or even ignored. For more information about on how each graph type uses category names, see Data Organization in the Corda 7 Graph Guide. Note: You must send the graph a set of categories before sending it any series data. This means the graph.setCategories command must occur before any graph.setSeries commands. X-Y and time plot graphs are exceptions to this because they do not use categories. This method can be called only once; if it is called again, it erases all data in the graph and starts anew. The graph.setCategories also takes a special CLR_ macro, which overrides the color for all data items in that category. This macro is followed by a six- or eight-digit (RGB plus alpha) hexadecimal color code, indicating the value of the overriding color. It is placed in parenthesis in front of the name of the category it should override, as illustrated in Example 2 below. |
|
|
Parameters |
|
graph.setCategories accepts the following parameters: |
|
|
|
|
CategoryName |
String |
|
|
|
Specifies a category name. There can be any number of category names listed in a graph.setCategories method. |
|
|
Examples |
|
Example 1: Naming Categories graph.setCategories(Fred; Barney; Gus; George) Example 2: Changing Data Item Properties on the Fly graph.setCategories(Math; English; (CLR_00FF00)Science; History)
|
|
|
method |
|
setDataLabelFormat |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Syntax |
|
graph.setDataLabelFormat(label) |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Description
|
|
Specifies the format of the graph's data labels. Data labels are small boxes of text and data that appear above each data item. If data labels are enabled, the string that you pass to the setDataLabelFormat method appears above every data label. Note: If you have text that you want to put above only one data item, use either graph.addHoverText or graph.addNote. Use macros to represent information that is data-item specific, such as the value of the data item or the series name. For example, consider a data item in a series named Houston whose value is 38. Using the command shown in the example below, the label for this data item is Houston: 38 Pts. If this command is not specified, the value from the Image Template file is used. For more information on data labels, see Data Labels in the Corda Builder User Guide. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Parameters |
|
graph.setDataLabelFormat accepts the following parameters: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
label |
String | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Specifies the data label string. The string can contain both regular text and macros. Macros are replaced by information specific to each data item when Corda Server generates the graph. A macro must always be proceeded by a percent sign-underscore (%_), and all of the letters must be upper-case. The following table shows the supported string macros. Some of these macros do not apply for all graph types-for instance, %_XVALUE applies only to X-Y graphs, and %_PERCENT_OF_TOTAL only applies to bar, line, radar, and pie graphs. Data Label Macros
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Example |
|
graph.setDataLabelFormat(%_SERIES_NAME: %_VALUE Pts).;
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
method |
|
setITXMLAttributes |
|
|---|---|---|---|
|
Syntax |
|
graph.setITXMLAttributes(attributes) |
|
|
Description
|
|
Inserts the specified attribute assignments into this graph object's ITXML tag. If an attribute has already been assigned (e.g., in the Image Template file), this statement overrides its assignment. The setITXMLAttributes statement is useful for accessing features of Corda Server not available directly through PCScript. It allows you to add to or modify this object's definition within the actual Image Template file. The setITXMLAttributes statement provides access to the values in the common multi-valued attribute associated with each graph object type supported by Corda 7 (for example, bar-graph). PCScript does not give you access to these settings. However, setITXMLAttributes modifies the ITXML that defines the default setting. Example 1 below illustrates how to do this. Examples 2 and 3 show how this statement modifies the map object's definition in the Image Template file. Note that this applies only to attributes of the root graph element (e.g., <cit:bar-graph>). To modify properties of the root graph element (e.g., <cit:graph-settings>), use the graph.addITXML method. |
|
|
Parameters |
|
graph.setITXMLAttributes accepts the following parameters: |
|
|
|
|
attributes |
String |
|
|
|
A string of ITXML attribute assignments, each separated by a blank space. For example, to set the top attribute to 100, this string reads common="top:100";. This string can contain any number of attribute assignments. For more information about ITXML, see ITXML. |
|
|
Examples |
|
Example 1: graph.setITXMLAttributes Method Call graph.setITXMLAttributes(common="top:100;width:200;height:200") Example 2: Graph Definition before Calling setITXMLAttributes in Example 1 <cit:bar-graph name="graph" common="top:20;left:20;width:300;height:100"> ... </cit:bar-graph> Example 3: Graph Definition after Calling setITXMLAttributes in Example 1 <cit:bar-graph name="graph" common="top:100;left:20;width:200;height:200"> ... </cit:bar-graph> |
|
|
method |
|
setScale |
|
|---|---|---|---|
|
Syntax |
|
graph.setScale(type, auto|manual, max|startdate, min|enddate, majorTicks) |
|
|
Description
|
|
Specifies scale settings including automatic or manual scaling, scale range, and scale marker increments. For information about scales, scale ranges, and scale markers, see Scales and Grids in the Corda Builder User Guide. |
|
|
Parameters |
|
graph.setScale() accepts the following parameters. |
|
|
|
|
type |
{ value | svalue | x | y | y2 | time } |
|
|
|
Specifies which scale this method is changing the settings for. For most graphs, you make changes only to the value scale. Line bar combo graphs also have the svalue (secondary value) scale, which is on the right side of the graph. Time graphs have a time scale along the bottom of the graph, in addition to the value scale. X-Y graphs have both an x (x-axis) and y (y-axis) scale but do not have a value scale. If a graph is a dual-y scale graph, it also has a y2 (right y-axis) scale. |
|
|
|
|
scaling |
{ auto | manual } |
|
|
|
Specifies whether to use automatic or manual scaling. When set to automatic, Corda Server tries to adjust the scale range and the number of ticks and labels so that the scale remains useful and the graph remains visibly appealing. |
|
|
|
|
max | startdate |
float |
|
|
|
Specifies the maximum value for the scale. For time scales, this value is the starting date. |
|
|
|
|
min | enddate |
float |
|
|
|
Specifies the minimum value for the scale. This parameter is optional. For time scales, this value is the ending date. |
|
|
|
|
majorTicks |
int |
|
|
|
Specifies the number of major increments in the scale. Major ticks are places where large tick marks and scale labels appear on the graph. |
|
|
Example |
|
graph.setScale Example Method Calls graph.setScale(value,manual,100,0,5) graph.setScale(x, auto, 78.5) graph.setScale(y, manual, 500) graph.setScale(time, auto, 5/1/2000, 5/31/2000) |
|
|
method |
|
setSeries |
|||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Syntax |
|
graph.setSeries(SeriesName; DataItem*) |
|||||||||||||||||||||||
|
Description
|
|
Sends a data series to the graph. The first argument to this method is the name of the series, followed by an item delimiter (as specified in main.itemDelimiter, and all data items in this series. Data items can consist of one to four values, depending on the graph type. If there is more than one value in the data item (e.g., an X-Y plot point), the values are separated by a comma (,) or the parameter delimiter (specified in main.paramDelimiter). For more information about data organization in graphs, see Data Organization in the Corda 7 Graph Guide. A data series can have as many data items as you want it to have. Each data item is separated by an item delimiter. The data values in a data item are interpreted differently depending on what class of data the graph accepts. For more information, see Data Organization in the Corda 7 Graph Guide. Note: If the graph object uses the Standard Data class, you must send the graph a set of categories before sending it any series data. This means the graph.setCategories command must occur before any graph.setSeries commands. X-Y and time plot graphs are exceptions to this because they do not use the categories. The graph.setSeries method is unique in that it also accepts special color and symbol override commands. These commands dynamically change color or symbol properties for data items and series of data items. They are placed in parenthesis in front of the data items (for individual data items) or series names (for an entire series) that they are to affect, as demonstrated in Example 2 below. The override commands are listed in the following table. Color and Style Override Commands
|
|||||||||||||||||||||||
|
Parameters |
|
graph.setSeries accepts the following parameters: |
|||||||||||||||||||||||
|
|
|
SeriesName |
String | ||||||||||||||||||||||
|
|
|
The name of the series. This name is shown in the legend. |
|||||||||||||||||||||||
|
|
|
DataItem |
int [, int]* | ||||||||||||||||||||||
|
|
|
A data item. Technically, a data item consists of any number of comma- or parameter delimiter-separated values, but the number of values that are actually used for the data item are between one and four, depending on the class of data that the graph accepts. For more information, see Data Organization in the Corda 7 Graph Guide. Each series can have an infinite number of data items. Each data item is separated by a semi-colon (or the item delimiter, which is specified in the main.itemDelimiter method). |
|||||||||||||||||||||||
|
Examples |
|
Example 1: Setting Data Series for a Standard Graph graph.setSeries(Math; 23; 95; 56) graph.setSeries(English; 65; 32; 66) graph.setSeries(History; 72; 58; 44) graph.setSeries(Science; 53; 69; 52) Example 2: Changing Data Item Properties on the Fly graph.setSeries(Math; 23; (CLR_00FF00)95; 56) graph.setSeries((CLR_84EC90)English; 65; 32; 66) xygraph.setSeries((STYP_3)Plot Points; (SCLR_000099)10,15; 11,9; (SCLR_7180BB)20,4) |
|||||||||||||||||||||||
|
method |
|
setSeriesNames |
|
|---|---|---|---|
|
Syntax |
|
graph.setSeriesNames(SeriesName, SeriesName*) |
|
|
Description
|
|
Used to override a series names after you have already specified the data or loaded the data from a file. For example, suppose you input data from a CSV file where the series are named Row1, Row2, and Row3. Use this command to change the series names to Red, Green, and Blue without having to override the data. graph.setSeriesNames(Red; Green; Blue); |
|
|
Parameters |
|
graph.setSeriesNames accepts the following parameters: |
|
|
|
|
SeriesName |
{ Series Name } |
|
|
|
Specifies a series name. Specify as many names as you wanteach name is separated by a comma. |
|
|
method |
|
setSeriesStyle |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
Syntax |
|
graph.setSeriesStyle(SeriesName, lineWidth, symbolType, areaFill, bubbleType, linestyle) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Description
|
|
Specifies style settings (such as line width and symbol type) for line, X-Y, and time plot graphs. The first three parameters apply to line graphs in addition to X-Y and time plot graphs. The last two apply only to X-Y and time plot graphs. Note: Corda Server treats all X-Y and Time Plot graphs as combo graphs. For example, if you set a bubble type in an X-Y Scatter graph, you get a bubble, despite not being able to do this in the Corda Builder interface. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Parameters |
|
graph.setSeriesStyle accepts the following parameters. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Series |
{ int | Series Name } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Specifies the series to apply the style settings to. This value can be an integer or the name of a series that has been specified in a graph.setSeries method. If the value of this parameter is an integer, it refers to the nth series listed in the graph.setSeries method(s), where n is the integer specified. For example, if Fruit is the name of the series described in the second graph.setSeries method, and 2 is passed as the value of the series parameter, 2 refers to the Fruit series. To access a series number that is the same as another series' name, use the pound sign (#) before the series number. This lets Corda Server know that you are referring to a series number instead of a series name. For example, if series number 5 is named 3, then the statement graph.setSeriesStyle(3,2,7,false) changes the style of series number 5 and not 3 because it assumes you are referring to the series name. However, if you include a pound sign (#) before the number 3—for example, graph.setSeriesStyle(#3,2,7,false)—Corda Server overrides the series name and instead changes the style of series number 3. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
lineWidth |
int | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
The width of the line for this data series. Set this to 0 if you do not want the series to have a line. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
symbolType |
int | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Specifies the numeric code for the data series' symbol type. The table below shows the symbol types with their corresponding numbers.
1. Shows the label for the data point instead of a symbol. Available only for X-Y and time plot graphs. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
areaFill |
{ true | false } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Specifies whether or not the area underneath this graph's line is filled in. Applies only to X-Y and time plot graphs. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
bubbleType |
{ 3D | FILL | NONE | OUTLINE | OUTLINEANDFILL } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
Specifies the type of bubble to display for these data items. This automatically enables bubbles for the specified data series. Setting this to NONE disables bubbles. Applies only to X-Y and time plot graphs. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
linestyle |
{ plain | dashed | dotted | dashdot } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
(Optional) Specifies the style of the line. The default value is plain. Supported values include plain, dashed, dotted, and dashdot. Line and line-bar graphs do not support areaFill and bubbleType parameters. To specify a line style for these types of graphs, simply leave those attributes blank, as shown in the third line of the example below. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Example |
|
Setting the Series Style graph.setSeriesStyle(Fred, 1, 7, false, 3D) graph2.setSeriesStyle(Kuwait, 1, 0, true, none, dotted) graph3.setSeriesStyle(Fred, 2, 5, , ,dashed) |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
method |
|
setSeriesToSecondScale |
|
|---|---|---|---|
|
Syntax |
|
graph.setSeriesToSecondScale(Series) |
|
|
Description |
|
Associates the specified series to the secondary scale for dual-y scale graphs (X-Y, time). |
|
|
Parameters |
|
graph.setSeriesToSecondScale() accepts the following parameters: |
|
|
|
|
Series |
int | Series Name } |
|
|
|
Specifies the series that is associated with the secondary y scale. This value can be an integer, a range of integers, or the name of a series that has been specified in a graph.setSeries method. If the value of this parameter is an integer, it refers to the nth series listed in the graph.setSeries method(s), where n is the integer specified. For example, if Fruit is the name of the series described in the second graph.setSeries method, and 2 is passed as the value of the series parameter, 2 refers to the Fruit series. To access a series number that is the same as another series' name, use the pound (#) sign before the series number. This lets Corda Server know that you are referring to a series number instead of a series name. For example, if series number 5 is named 3, the statement graph.setSeriesToSecondScale(3) sets series number 5 and not 3 to the secondary scale because it assumes you are referring to the series name. However, if you include a pound sign (#) before the number 3—for example, graph.setSeriesToSecondScale(#3)—Corda Server overrides the series name and instead adds series number 3 to the secondary scale. Make sure to URL-encode the HTTP Request when using a pound sign. For more information about URL encoding issues, see Encoding Issues with Extended Characters. A range of series is denoted by an integer followed by a hyphen (-) and another integer. The first integer represents the first series that is added to the secondary scale, and the last integer indicates the last series that is added to the secondary scale. All data series in between also are added to the secondary scale. |
|
|
method |
|
setStockHLOCOrder |
|
|---|---|---|---|
|
Syntax |
|
graph.setStockHLOCOrder(high, low, open, close) |
|
|
Description
|
|
Specifies the order of values in a stock data item. Stock data items contain four data values: high, low, open, and close. By default, Corda Server assumes that values in a stock data item occur in this order. setStockHLOCOrder lets you specify a different value ordering (see the example below). This is particularly useful for importing data from HTML tables. Use this method before importing data to Corda Server, or Corda Server interprets the data items using the default value ordering. For more information about the stock data class, see Stock Data Class in the Corda 7 Graph Guide. |
|
|
Parameters |
|
graph.setStockHLOCOrder() accepts the following parameters: |
|
|
|
|
high |
int |
|
|
|
Specifies which column of data is used for each data item's high value. |
|
|
|
|
low |
int |
|
|
|
Specifies which column of data is used for each data item's low value. |
|
|
|
|
open |
int |
|
|
|
Specifies which column of data is used for each data item's open value. |
|
|
|
|
close |
int |
|
|
|
Specifies which column of data is used for each data item's close value. |
|
|
Example |
|
Changing the Order of Data Values for a Stock Data Item graph.setStockHLOCOrder(4, 5, 2, 3) |
|
|
method |
|
show |
|---|---|---|
|
Syntax |
|
graph.show() |
|
Description |
|
Makes this graph object visible. By default, all objects are visible. Use this command to make this object visible again after using the graph.hide command. |
|
method |
|
suppressAutoDescription |
|---|---|---|
|
Syntax |
|
graph.suppressAutoDescription() |
|
Description |
|
Suppresses automatic descriptive text generation for this graph. Only the description specified via graph.description appears in this graph's text description. |
|
method |
|
suppressDescriptionItem |
|
|---|---|---|---|
|
Syntax |
|
graph.suppressDescriptionItem(itemtype) |
|
|
Description |
|
Suppresses descriptive text generation for the specified type of items in this graph object. suppressDescriptionItem currently suppresses text descriptions for drilldown effects or hover text. |
|
|
Parameters |
|
graph.suppressDescriptionItem accepts the following parameters: |
|
|
|
|
itemtype |
{_CatDrilldown_ | _Drilldown_ | _Hover_ | _SeriesDrillDown_} |
|
|
|
The item type that you want to suppress descriptive text for. Choose _CatDrilldown_ to suppress descriptive text for drilldown effects on category labels. Choose _Drilldown_ to suppress descriptive text for all drilldown effects. Choose _Hover_ to suppress descriptive text for hover text. Choose _SeriesDrillDown_ to suppress descriptive text for drilldown effects on series labels. |
|
|
Example |
|
graph.suppressDescriptionItem Method graph.suppressDescriptionItem(_Hover_) |
|
|
method |
|
targetCategory |
|
|---|---|---|---|
|
Syntax |
|
graph.targetCategory(CategoryNumber) |
|
|
Description
|
|
Tells a pie graph which category to graph. Because a pie graph shows only one category of data, use targetCategory to specify the category that Corda Server graphs in the pie graph, when sending more than one category. If targetCategory is not specified, the first category received is charted in the pie graph. |
|
|
Parameters |
|
graph.targetCategory accepts the following parameters: |
|
|
|
|
CategoryNumber |
int |
|
|
|
The number of the category that is graphed in the pie graph. Categories are numbered according to the order in which they appear in the graph.appendByRow method. Numbering begins with 1. |
|
|
method |
|
transposed |
|---|---|---|
|
Syntax |
|
graph.transposed(true|false) |
|
Description
|
|
Tells the graph whether or not to view the data transposed. When a graph is transposed, data series become categories of data and categories of data become data series. In other words, the rows and columns of a graph are switched. Because this command applies only to categorical data, use it only for data in the Standard Data Class. The effects of this command on non-standard data classes (such as X-Y or stock) are unpredictable and, more than likely, not what you want. |
|
method |
|
useColorPalette |
|
|---|---|---|---|
|
Syntax |
|
graph.useColorPalette(paletteName) |
|
|
Description
|
|
Instructs Corda Server to import a color palette from the config/PCColors.xml file. The graph's data series is colored according to this palette. For more information about color palettes and the PCColors.xml file, see Color Themes. |
|
|
Parameters |
|
graph.useColorPalette accepts the following parameters: |
|
|
|
|
paletteName |
String |
|
|
|
The name of a color palette specified in the PCColors.xml file. |
|