You can use standard WebFOCUS GRAPH FILE syntax to create an active chart. The GRAPH FILE syntax supports the following types of active charts:
In the GRAPH FILE procedure, you can apply one of three output formats to the chart:
The following guidelines apply.
COMPOUND LAYOUT {PCHOLD|HOLD} FORMAT {AHTML|FLEX|APDF}
To create an active chart, use
ON GRAPH {PCHOLD|HOLD|SAVE} FORMAT {AHTML|FLEX|APDF}
where:
Displays the chart output in a Web browser in the format specified. PCHOLD is the default value.
Saves the chart output to a temporary file for later use. The output is saved with an associated Master File.
Saves the chart output to a file for later use, but the output is not saved with a Master File.
Creates an HTML version of the chart.
Creates an Adobe Flash Player version of the chart (Adobe Flash file).
Creates an Adobe Flash Player version of the chart (Adobe Flash file), embedded in a PDF file.
The following WebFOCUS code creates an Adobe Flash Player version of an active chart.
The code that controls the chart type (PIE) and the code that controls the output format (FLEX) is shown in bold.
The WebFOCUS StyleSheet code, which follows the code shown in bold, controls the way that the legend is displayed in the output. In this example, the legend is fixed. It appears underneath the chart. For more information on controlling the legend, see Controlling the Legend of an Active Technologies Chart in FLEX or APDF Format.
GRAPH FILE GGSALES SUM DOLLARS BY CATEGORY BY PRODUCT ON GRAPH SET LOOKGRAPH PIE ON GRAPH PCHOLD FORMAT FLEX ON GRAPH SET STYLE * TYPE=REPORT, OBJECT=LEGEND, LEGEND-VIEW=FLAT,$ ENDSTYLE END
The output is shown in the following image.
You can use the icons at the top of the chart as you do for charts that are generated by a graphical tool. For example, you can change the chart type from pie to bar.
The Chart Tool is accessible from the left-most icon at the top of the chart. The Chart Tool allows you to change the columns and switch the chart type.
How to: |
You can control the chart type using the WebFOCUS code ON GRAPH SET LOOKGRAPH.
To create a vertical bar chart, use
ON GRAPH SET LOOKGRAPH BAR
where:
Is the default value.
To create a vertical line chart, use:
ON GRAPH SET LOOKGRAPH LINE
To create a pie chart, use:
ON GRAPH SET LOOKGRAPH PIE
To create a scatter chart, use:
ON GRAPH SET LOOKGRAPH SCATTER
In this section: How to: |
You can control how to display the legend for an active chart in FLEX or APDF format, using WebFOCUS StyleSheet code. The legend can be fixed or collapsible.
A legend always appears on a pie chart. A legend appears on a bar, line, or scatter chart if the chart has more than one Y-axis field.
To display a fixed legend underneath the chart, use:
TYPE=REPORT, OBJECT=LEGEND, LEGEND-VIEW=FLAT,$
To display a collapsible legend at the position specified, use
TYPE=REPORT, OBJECT=LEGEND, LEGEND-VIEW=DOCKING,
POSITION-POINT={BOTTOM-LEFT|BOTTOM-CENTER|BOTTOM-RIGHT},$
where:
Is the default value.
The following WebFOCUS StyleSheet code generates a collapsible legend at the bottom right of an active pie chart in FLEX format.
TYPE=REPORT, OBJECT=LEGEND, LEGEND-VIEW=DOCKING, POSITION-POINT=BOTTOM-RIGHT,$
The output is shown in the following image. In the image, the cursor is pointing to the Legend icon at the bottom right of the chart.
You can:
The examples in this topic describe the supported chart legend syntax and the output that it generates.
GRAPH FILE vs. TABLE FILE
When you run a GRAPH FILE procedure to generate a chart, the output displays the chart toolbar above the chart. The result is the same when you run a TABLE FILE procedure with the initial report view set to a chart, using the following StyleSheet code:
TYPE=REPORT, REPORT-VIEW=CHART, CHART-TYPE=PIE,$
The chart that is generated runs inside a canvas frame, not inside a window or panel type of frame.
When you run a TABLE FILE procedure and you do not set the initial report view to a chart, WebFOCUS generates an active report that is in grid view. You can create a chart from a drop-down menu on the active report, using the Chart menu option. When you do that, the chart opens up inside a new window or panel type of frame. You can minimize, maximize, or close the window.
Examples
The WebFOCUS syntax generates the chart legend, as shown in the following image.
TYPE=REPORT,OBJECT=LEGEND,LEGEND-VIEW=FLAT,$
The WebFOCUS syntax generates the chart legend, as shown in the following image.
TYPE=REPORT,OBJECT=LEGEND,LEGEND-VIEW=DOCKING,POSITION-POINT=BOTTOM-CENTER,$
The WebFOCUS syntax generates the chart legend, as shown in the following image.
TYPE=REPORT,OBJECT=LEGEND,LEGEND-VIEW=DOCKING,POSITION-POINT= BOTTOM-RIGHT,$
The WebFOCUS syntax generates the chart legend, as shown in the following image.
How to: |
You may customize chart colors and styles for active reports and active dashboards by creating a JavaScript file to overwrite the default colors and styles used for charts. The customization steps vary, depending on the output format.
By default, the chart colors are stored in the irpfnc.js file, located in the Reporting Server \home\etc directory. Optionally, you may create a custom JavaScript file (using the file name irpcusf.js) in your application folder and add a line of JavaScript code to overwrite the default color settings. Customizing the colorTable RGB color codes in this JavaScript file enables you to edit the series colors of active charts. The irpcusf.js file overwrites the default colors used for charts and applies changes to all chart types in active reports and active dashboards using the HTML output format.
By default, the chart styles are stored in the irpfsty.js file, located in the Reporting Server \home\etc directory. Optionally, you may copy this file to your application folder and edit the chart series StyleSheet section. This enables you to customize the look and feel of charts and gives you full control over styling individual chart types using Cascading Style Sheet syntax. You can apply different sets of colors to Pie, Bar, Line, and Scatter chart as needed. In addition to changing chart series colors, you can customize the labels to display inside or outside the Pie chart, change the legend font colors, and add background colors to Bar, Line, and Scatter charts.
For all output formats, if these customized JavaScript files exist in your application folder, the default styles are overwritten by the colors and styles specified. You can have different customized JavaScript files in your application folder, enabling you to update the active reports and active dashboards in your existing applications with different styles and color themes to meet your needs.
By creating the irpcusf.js JavaScript file, you may add JavaScript code to customize the colorTable RGB color codes for charts in active reports and active dashboards in HTML.
This should be the same directory as the location of the active report or active dashboard. For example, from the Projects area of Developer Studio, create a new JScript Script File in the Other subfolder of the project folder.
colorTable["ibi"]=[[0,121,193],[127,173,220],[84,12,182], [161,161,217],[46,46,171],[105,3,164],[9,184,206]];
The numbers represent the array of colors for active chart series using colorTable RGB color codes. Enter the series color of your choice separated by commas, no spaces, and brackets.
The next time you run an active report or active dashboard, the charts appear with the series colors you selected in the customized JavaScript file.
The following image shows an active dashboard, using the HTML output format, with customized chart colors.
By copying and pasting the irpfsty.js JavaScript file, you may edit JavaScript code to customize the Cascading Style Sheet syntax for charts in active reports and active dashboards for Adobe Flash Player and for PDF.
This should be the same directory as the location of the active report or active dashboard. For example, from the Projects on localhost area in Developer Studio, paste irpfsty.js in the Other subfolder of the project folder.
Tip: Cascading Style Sheet syntax uses HTML color code or hex values for the colors. For details on each available property, see the Adobe documentation.
Currently, you may only modify the first series in a pie chart of the active report for Adobe Flash Player.
.arPieChartStyle { chartSeriesStyles: arPieSeries1, arPieSeries2, arPieSeries3; } .arPieSeries1 { fills: #35675B, #A4C366, #FFAC1B, #618466, #E4CDAD, #3f9f3f, #aca52d, #09cf6b, #d4dc7f, #B50CB1; color: #408a1c; fontWeight: bold; labelPosition: outside; }
where:
A single array of colors to specify the individual color for each pie chart wedge.
The color of the text used in the chart, including the label.
Sets the text to be in boldface.
Specifies how to display data labels for the pie chart wedges. The default is none. The possible values are:
You can add as many series as needed. The number of series specified in the array for arBarChartStyle has to correspond with the number of bar series defined.
.arBarChartStyle{ chartSeriesStyles: arBarSeries1, arBarSeries2, arBarSeries3, arBarSeries4, arBarSeries5, arBarSeries6, arBarSeries7, arBarSeries8, arBarSeries9, arBarSeries10; } .arBarSeries1 { fill: #35675B; } .arBarSeries2 { fill: #A4C366; } .arBarSeries3 { fill: #FFAC1B; } … }
where:
Sets the color for each series in a chart.
You can add as many series as needed. The number of series specified in the array for arLineChartStyle has to correspond with the number of line series defined.
.arLineChartStyle{ chartSeriesStyles: arLineSeries1, arLineSeries2, arLineSeries3, arLineSeries4, arLineSeries5, arLineSeries6, arLineSeries7, arLineSeries8, arLineSeries9, arLineSeries10; } .arLineSeries1 { form: curve; color: #35675B; weight: 2; } .arLineSeries2{ color: #A4C366; weight: 2; } .arLineSeries3 { color: #FFAC1B; weight: 2; } … }
where:
Sets the line type for the chart. The default is segment. Possible values are:
Sets the color of the line.
Sets the width of the line in pixels. The default value is 0.
You can add as many series as needed. The number of series specified in the array for arScatterChartStyle has to correspond with the number of scatter chart series defined.
.arScatterChartStyle{ chartSeriesStyles: arScatterSeries1, arScatterSeries2, arScatterSeries3, arScatterSeries4, arScatterSeries5, arScatterSeries6, arScatterSeries7, arScatterSeries8, arScatterSeries9, arScatterSeries10; } .arScatterSeries1 { fill: #35675B; radius: 8; } .arScatterSeries2 { fill: #A4C366; } .arScatterSeries3 { fill: #FFAC1B; } … }
where:
Sets the radius of the plot point in pixels. The default value is 5 pixels.
For example, the following syntax applies the alternate background color and changes the font color of the legend:
Legend { color: #306814; } GridLines { horizontalAlternateFill: #e8f7e6; horizontalFill: #f5fbf1; }
For example, the following code applies the different colors and font styles to the tabs, pull down menu, and text in the dashboard:
TabNavigator { backgroundColor: #d8fcb1; borderColor: #118822; color: #35675b; tabStyleName: "myTabs"; firstTabStyleName: "myTabs"; lastTabStyleName: "myTabs"; } .myTabs { fillColors: #ffffff, #a6cdb1; borderColor: #118822; color: #35675b; textRollOverColor: #118822; themeColor: #35675b; } ComboBox { color: #35675b; borderColor: #118822; iconColor: #35675b; selectionColor: #2cd61c; textSelectedColor: #254941; rollOverColor: #9eefaa; textRollOverColor: #075812; themeColor: #35675b; dropdownStyleName: "myComboBoxDropDowns"; } .myComboBoxDropDowns { borderColor: #118822; color: #35675b; } Text { color: #35675b; fontWeight: bold; }
The next time you run an active report or active dashboard, the charts appear with the colors and styles you selected in the customized JavaScript file.
The following image shows an active dashboard for PDF with fully customized style.
How to: |
For active reports and dashboards in HTML formats, the advanced JavaScript chart styles are stored in the irpstd.js file on the server \home\etc directory. For active reports and dashboards for Adobe Flash Player, the advanced Flash chart styles are stored in the irpfstd.js file on the server \home\etc directory. By copying this file into your application folder and editing the chart style property section for each chart type, you can customize the look and feel of advanced active JavaScript and Flash charts.
Note: For active reports and dashboards for Adobe Flash Player, the chart styles in the Chart/Rollup Tool dialog box will change dynamically, according to the changes made in irpfstd.js file.
Both files follow the same style property convention that corresponds to the properties defined in the FusionCharts documentation. For more information on a specific property, see the FusionCharts product documentation, located at http://www.fusioncharts.com/docs/.
For active reports and dashboards in HTML formats, these properties are defined in the fcinfo variable in the irpstd.js file. For active reports and dashboards for Adobe Flash Player, these properties are defined in the getFCGlobal function in the irpfstd.js file. Each chart type has its corresponding chartParams name assigned in these functions and all the chart styling properties are defined in each chartParams section of the files. You have full control over styling individual chart types by assigning a different chartParams name to each chart type. For example, you can apply different sets of colors to Pie 2D, Multi-series Column 2D, Multi-series Line 2D, Scatter, or any other advanced chart types as needed. In addition to changing chart series colors, you can customize the labels to display inside or outside the pie chart types, change the default font type or colors used globally, add background color to the chart canvas, change legend color or mouse-over data tip colors, and so on.
{swfName:'Pie2D', label:'Pie 2D', chartParams: 'pieParams'},
Note: It is recommended that you create a new chartParams name for the chart types you are modifying because the same chartParams name may be assigned to other chart types that you may not need to modify. You can also create one default chartParams name and assign it to all chart types to globally apply the same styles.
For active reports and dashboards for Adobe Flash Player, locate the chart properties section defined in this.chartParams_name. For example, this.pieParams.
For this Pie 2D chart example, the properties section should look like below for active reports and dashboards in HTML formats:fcinfo.pieParams = '{'+ '"caption":"%caption%",'+ '"alternateHGridAlpha":"100",'+ '"alternateHGridColor":"f9f9fa",'+ '"baseFont":"Arial",'+ '"baseFontColor":"000000",'+ '"baseFontSize":"10",'+ '"bgColor":"e5e5e5,ffffff",'+ . . .
For this Pie 2D chart example, the properties section should look like below for active reports and dashboards for Adobe Flash Player:
this.pieParams = [ {alternateHGridColor:"f9f9fa"}, {alternateHGridAlpha:"100"}, {baseFont:"Arial"}, {baseFontSize:"10"}, {baseFontColor:"000000"}, {baseFont:"Arial"}, {baseFontSize:"10"}, . . .The values on the left-hand side correspond to chart element attribute names defined in the FusionCharts documentation, and the default values used in advanced active charts are set on the right-hand side, wrapped in double quotation marks.
{swfName:'Pie2D', label:'Pie 2D', chartParams: 'testParams'},
public var testParams:Array;
In the irpstd.js file, you should now have:
fcinfo.fcCategory = [ … {category:this.ibiMsgStr['crtpie'], //Pie Category … {swfName:'Pie2D', label:'Pie 2D', chartParams: 'testParams'}, … isCreated:false} ]; … fcinfo.testParams = '{'+ '"caption":"%caption%",'+ … '"zeroPlaneThickness":"3"},';
In the irpfstd.js file, you should now have:
<mx:Script> <![CDATA[ … public var testParams:Array; private function getFCGlobal(): void { … this.fcCategory = [ … {category:this.ibiMsgStr['crtpie'], //Pie Category … {swfName:'Pie2D', label:'Pie 2D', chartParams: 'testParams'}, … isCreated:false} ]; … this.testParams = [ {alternateHGridColor:"f9f9fa"}, … {zeroPlaneColor:"717171"} ]; //end testParams } // end getFCGlobal() ]]> </mx:Script>
Note: In the above irpstd.js file sample, the ellipses indicate additional lines of code.
For example, the attributes, such as baseFont, baseFontSize, and baseFontColor, define the generic font properties for all the text used on the chart inside the chart canvas, including data labels, values, and so on.
baseFont. Specify the font family name to be used for all the text (data labels, values, and so on) on the chart inside the chart canvas.
baseFontSize. Specify the font size to be used for all the text (data labels, values, and so on) on the chart inside the chart canvas using a numeric value between 0 to 72.
baseFontColor. Specify the font color to be used for all the text (data labels, values, and so on) on the chart inside the chart canvas using the HTML color code. Do not include the number (#) character when using the HTML color code.
The following font properties set the fonts used for the pie chart label and mouse-over data tip texts to be Comic Sans MS in dark red color and size 20:
{baseFont:"Comic Sans MS"}, {baseFontSize:"20"}, {baseFontColor:"D70A0A"},
paletteColors. Specify a list of HTML color codes separated by commas. Do not include the # character when using the HTML color code. The chart will cycle through the list of specified colors.
For example, the following set of eight colors changes the color of pie chart slices into a red color scheme.
{paletteColors:"D788A2, E13939, DC4295, A52A2A, FAAFBE, C11B17, FF7157, CC4444"},
Notice the same style changes are reflected for the Pie 2D chart in the Chart/Rollup Tool. Because we assigned testParams only to the Pie 2D chart type in this example, the other charts still retain the default chart styles specified in other chartParams parameters.
{swfName:'MSColumn2D', label:'Multi-series Column 2D', chartParams: 'testParams'},
The same red color scheme is now applied to the Multi-series Column 2D chart.
In the testParams section, locate the canvasBgColor property, and change its value as follows. If the canvasBgColor property does not exist, you can simply add it.
{canvasBgColor:"FDEEF4"},
For alternating background color, locate the alternateHGridColor property, and change its value as follows. If the alternateHGridColor property does not exist, you can simply add it.
{alternateHGridColor:"FEF7D6"},
Depending on the chart type, different types of properties are available to modify multiple areas of the chart. For more information, see the FusionCharts documentation.
The chart now contains light pink and yellow alternating background color.
Adding or modifying the following properties changes the background colors used in the mouse-over data tip and legend.
{legendBgColor :"EBDDE2"}, {toolTipBgColor:"EBDDE2"},
In this section: How to: |
Active Technologies for Adobe Flash Player allow you to customize how a chart is displayed on an active report or active dashboard. There are three separate animation effects that you can use: SeriesInterpolate, SeriesSlide, and SeriesZoom. You can control the properties of each effect to achieve a distinct impact.
All the styling options for the charts in Active Technologies for Adobe Flash Player are stored in the irpfsty.js file, found in the \home\etc directory of the WebFOCUS Reporting Server. You can copy this file to your application folder and edit the contents to customize the charts for your application.
The animation effects used in the charts are listed at the top of the irpfsty.js file, as shown here.
<mx:SeriesSlide id="lineShowEffect" duration="2000"/> <mx:SeriesSlide id="lineHideEffect" duration="2000"/> <mx:SeriesSlide id="scatterShowEffect" duration="2000"/> <mx:SeriesSlide id="scatterHideEffect" duration="2000"/> <mx:SeriesInterpolate id="barShowEffect" duration="2000" elementOffset="10" /> <mx:SeriesSlide id="XbarShowEffect" direction="up" duration="2000"/> <mx:SeriesSlide id="XbarHideEffect" direction="down" duration="2000"/> <mx:SeriesInterpolate id="pieShowEffect" duration="2000" elementOffset="10" />
Active Technologies determines which effect to use by the id specified in this section.
For example, you can edit this section to change the bar chart effect to slide instead of interpolate by commenting out the existing barShowEffect element. You would set the id for SeriesSlide to “barShowEffect" and set the direction of the slide to "right," as shown in the following procedure.
This should be the same directory as the location of the active report or active dashboard. For example, from the Projects on localhost area in Developer Studio, paste irpfsty.js in the Other subfolder of the project folder.
<!-- <mx:SeriesInterpolate id="barShowEffect" duration="2000" elementOffset="10" /> -->
<mx:SeriesSlide id="barShowEffect" direction="right" duration="2000"/>
The code will look like the following:
<!-- <mx:SeriesInterpolate id="barShowEffect" duration="2000" elementOffset="10" /> --> <mx:SeriesSlide id="barShowEffect" direction="right" duration="2000"/>
Tip: Adding <!-- at the beginning of the first XML tag and --> at the end of the closing XML tag comments out the entire section.
One of the effects that is not included in the irpfsty.js file is SeriesZoom.
In order to use this effect, you need to add it to the irpfsty.js file. You also need to include the datavisualization.swc file in your WebFOCUS Reporting Server \home\etc\flex\frameworks\libs folder. The datavisualization.swc file is found in your Adobe Flex Builder SDK directory, typically in \Program Files\Adobe\Adobe Flex Builder 3\sdks\3.5.0 (or 3.4.0)\frameworks\libs.
Then you can comment out the existing pieShowEffect element, and add the SeriesZoom effect as pieShowEffect, as shown in the following example.
<!-- <mxSeriesInterpolate id="pieShowEffect" duration="2000" elementOffset="10" /> -->
<mx:SeriesZoom id="pieShowEffect" duration="2000" elementOffset="-50"
minimumElementDuration="50" verticalFocus="top" horizontalFocus="right"
relativeTo="chart" />
You can find more information on each effect and its properties in the Adobe documentation.
WebFOCUS |