Creating Custom Graph Templates

How to:

Note: Creating custom graph templates is only applicable when using the Advanced Graph Assistant.

Custom graph templates are great for having complete control over the look of the chart. If you have many charts that share most of their characteristics, using a graph template would probably make sense. When creating charts in Advanced Graph Assistant, you can choose from one of the built-in templates or create your own custom template. Custom templates can be stored for easy accessibility and future use. This section describes the process for selecting a built-in template, creating a custom template file, and using a template file in Advanced Graph Assistant.


Top of page

x
Procedure: How to Select a Built-in Template from the Advanced Graph Assistant
  1. Open the Advanced Graph Assistant.

    Note: For details about opening the Advanced Graph Assistant, see Accessing Advanced Graph Assistant.

    The Advanced Graph Assistant opens at the Chart type tab.

  2. From the Properties window, select the Apply Template drop-down list.

    Apply template field

    Tip: The Apply Template property also appears under the Chart Editor tab of the Advanced Graph Assistant.

  3. Select the template of your choice.

    Note: The default template is SouthWestern.

    The graph refreshes applying the template you selected.


Top of page

x
Procedure: How to Create a Custom Graph Template in the Advanced Graph Assistant
  1. Open the Advanced Graph Assistant.

    Note: For details about opening the Advanced Graph Assistant, see Accessing Advanced Graph Assistant.

    The Advanced Graph Assistant opens at the Chart type tab.

  2. Create and apply the chart styling options.
  3. Save the procedure and exit the tool.
  4. Open the saved procedure with the Text Editor.
  5. Copy all of the formatting calls (graphs api) in the GRAPHSTYLE section to Notepad.

    The following syntax is an example of GRAPHSTYLE syntax in the Text Editor.

    ON GRAPH SET GRAPHSTYLE *
    setTemplateFile("/images/tdg/template/IBISouthWestern.txt");
    setReportParsingErrors(false);
    setSelectionEnableMove(false);
    setTransparentBorderColor(getSeries(0),true);
    setTransparentBorderColor(getSeries(1),true);
    setTransparentBorderColor(getSeries(2),true);
    setTransparentBorderColor(getSeries(3),true);
    setTransparentBorderColor(getSeries(4),true);
    setTransparentBorderColor(getSeries(5),true);
    setTransparentBorderColor(getSeries(6),true);
    setTransparentBorderColor(getSeries(7),true);
    setTransparentBorderColor(getSeries(8),true);
    setTransparentBorderColor(getSeries(9),true);
    setTransparentBorderColor(getSeries(10),true);
    setDepthRadius(5);
    setTransparentBorderColor(getChartBackground(),true);
    setPlace(true);
    setFillColor(getChartBackground(),new Color(128,128,255));
    ENDSTYLE

    Note: If you are familiar with graph api syntax, you manually type custom syntax in the GRAPHSTYLE section of the Text Editor.

  6. Save the Notepad file as templatename.txt, where templatename is the name of your template, to the following location, drive:\ibi\WebFOCUSXX\ibi_html\javaassist\images\tdg\template

    Note about naming templates: The name of the template file cannot start with 'IBI', which is reserved for WebFOCUS built-in templates.

    Note about using JSCOM3: When generating graphs on reporting server and using JSCOM3 method, template files must be saved to the same directory as the reporting server, drive:\ibi\srvxx\home\graph.

The template name will be available from the Apply Template drop-down list in the Advanced Graph Assistant.


Top of page

x
Procedure: How to Use a Template File in Advanced Graph Assistant
  1. Open the Advanced Graph Assistant.

    Note: For details about opening the Advanced Graph Assistant, see Accessing Advanced Graph Assistant.

    The Advanced Graph Assistant opens at the Chart type tab.

  2. From the Properties window, select your template name from the Apply Template drop-down list.

    Tip: The Apply Template property also appears under the Chart Editor tab of the Advanced Graph Assistant.

    The graph refreshes applying your customized template. The following image shows the Advanced Graph Assistant template selections.

    Advanced Graph Assistant templates

  3. Optionally, to execute a graph procedure with a custom template using WebFOCUS syntax, you may open a procedure with the Text Editor and add the template api call to the graph request in the GRAPHSTYLE section.

    For example, the following syntax shows TemplateName.txt as the file that contains styling commands.

    ON GRAPH SET GRAPHSTYLE *
    setTemplateFile("/images/tdg/template/TemplateName.txt");

WebFOCUS