# Schedule the Chart Generation

> Source: https://manual.pvxplus.com/chart-images-generation/schedule-the-chart-generation

The second step is to schedule the chart generation. To generate a chart image, the chart definition or program is added to the Chart Scheduler. The Chart Scheduler allows you to schedule chart image generation either on a fixed schedule or an on-demand basis. Entries can be added, modified or deleted in the Chart Scheduler by accessing **Chart Image Generation Schedule Maintenance**.

## Chart Image Generation Schedule Maintenance

The **Chart Image Generation Schedule Maintenance** utility displays a list of all scheduled entries that have been added, as indicated by the *All entries* selection in the drop box above this list. In addition to adding, changing or removing entries, you can refresh the list, view a report showing schedule details of all listed items, and generate a chart image on demand.

![](https://manual.pvxplus.com/migration-assets/ff83bd05e875c7cfb3c39f724e7b0c8ad2238f4a8742752f8e8464a5c8f4c7ea.jpg)

*(Chart Image Generation Schedule Maintenance was added in PxPlus v11.50.)*

The **Chart Image Generation Schedule Maintenance** window can be accessed by using various methods, and the particular method used determines the level of information presented.

For example, you can invoke the general maintenance window (above), which shows a list of ***all*** schedule entries, from the **[PxPlus IDE Main Launcher](https://manual.pvxplus.com/pxplus-ide/ide-main-launcher)**. To do this, first expand the *Graphical Application Builder (NOMADS)* category, and then expand the *Utilities* category. Under the *Utilities* category, select *Chart Image Scheduler*. Another method is to select *Chart Image Scheduler* from the *Utilities* menu on the **[NOMADS Session Manager](https://manual.pvxplus.com/nomads-graphical-application/nomads-development/getting-started#sessionmgr)** window.

More specifically, you can first select a library from within NOMADS, and then in **[Library Object Selection](https://manual.pvxplus.com/nomads-graphical-application/nomads-development/library-object-selection/overview)**, select *Chart Image Scheduler* from the *Utilities* menu to display schedule entries ***only for that library***.

**Chart Image Generation Schedule Maintenance** can also be invoked from your application when a query is invoked. If the query has ***public*** chart definitions associated with it, the *Schedule Chart Image Generation* option appears on the popup menu, and the **Chart Image Generation Schedule Maintenance** utility will display any entries associated with that query.

Note:  
To display a list of *all* schedule entries, rather than only those associated with a particular library or query, select All entries from the drop-down list located at the top of window.

Another method for accessing the **Chart Image Generation Schedule Maintenance** utility is by using the CHARTSCHED command line program. It can be invoked from the Command line at several levels:

| **Command** | **Description** |
| --- | --- |
| chartsched | General maintenance based on current directory and subdirectories |
| chartsched*Directory* | Maintenance for all schedule items for the specified directory and subdirectories  <br>  <br>***Example:***  <br>  <br>chartsched/work |
| chartsched*Library* | Maintenance for all schedule items for the specified library  <br>  <br>***Example:***  <br>  <br>chartschedtest.en |
| chartsched*Library,QueryPanel* | Maintenance for all schedule items for the specified query  <br>  <br>***Example:***  <br>  <br>chartsched/work/test.en, testquery |
| chartsched*ScheduleEntryName* | Item maintenance for the specified item  <br>  <br>***Example:***  <br>  <br>chartschedSales Totals |

Note:  
When invoking Chart Image Generation Schedule Maintenance for the first time, the chart schedule file, chartsched, is created in the local or prefix directory.

## Adding a Chart to the Schedule

Using **[Chart Image Generation Schedule Maintenance](https://manual.pvxplus.com/chart-images-generation/schedule-the-chart-generation#sched_maint)***,* you can add both AutoChart definitions and program references to the schedule.

To ***add*** an AutoChart definition to the schedule, click the *Add Chart* button in **Chart Image Generation Schedule Maintenance**. Depending on the method used to invoke this utility, a tree-view structure lists all of the ***public*** AutoChart definitions that exist at the current display level and lower.

![](https://manual.pvxplus.com/migration-assets/c0a150da1fba435284800e69498a081a1ce576bc4441dec123543b1f43c5bd4d.jpg)

At the general maintenance level, you can specify a *Starting Directory*, which is used as the top level of the tree-view structure. Selecting a Chart Definition from this display opens the **Chart Scheduler** window.

![](https://manual.pvxplus.com/migration-assets/c9ee22379cd8097b88debd25eec4750445d8be887572e16ca3f4a8fd45e50d35.jpg)

For a chart schedule entry, the **Chart Scheduler** requires the following information:

|  |  |
| --- | --- |
| *Schedule Item Name* | Unique name used to identify each schedule entry. The name is initially derived from the name of the chart definition; however, this can be changed. |
| **Location of Chart Definition** | \|  \|  \|<br>\| --- \| --- \|<br>\| *Directory* \| Path to the directory where the panel library containing the query definition with the selected AutoChart definition is stored. The directory path is optional if the panel library file is accessible using a simple path; i.e. it is in the current directory or a directory defined in the prefix settings.<br>The value of the directory can be fixed or an expression. If the specified directory does not exist, you are prompted with a choice to use it or not. \|<br>\| *Expression* \| Select this check box if the directory is an expression. \|<br>\| *Library Name* \| ***(Display Only)*** Name of the panel library in which the AutoChart definition is located. \|<br>\| *Query Name* \| ***(Display Only)*** Name of the query to which the AutoChart definition is associated. \|<br>\| *Chart Name* \| ***(Display Only)*** Name of the AutoChart definition used to generate the chart image. \| |
| **Scheduling Information** | \|  \|  \|<br>\| --- \| --- \|<br>\| *Frequency* \| Frequency at which the chart image is to be generated when the Chart Scheduler is running. Selections are:<br>5 minutes<br>15 minutes<br>1 hour<br>3 hours<br>12 hours<br>10 minutes<br>30 minutes<br>2 hours<br>6 hours<br>24 hours<br>An *On Demand* selection is also available. *On Demand* means that instead of going through the Chart Scheduler to generate the image, the image can be generated by clicking the *Generate* button in **Chart Image Generation Schedule Maintenance**, or it can be generated programmatically by calling the "\*gencharts;Generate_Chart" program.<br>See **[Generate the Chart Image](https://manual.pvxplus.com/chart-images-generation/generate-the-chart-image)** for information about **On Demand Chart Generation**. \|<br>\| *Next Image Generation* \| ***When adding a new schedule entry:***<br>Enter the date and time at which the chart is to be initially generated. You can type the date using the YYYY-MM-DD format or click the Calendar button to select the date. The time is entered using the 24-hour format.<br>***When modifying an existing schedule entry:***<br>This indicates the date and time of the next scheduled generation. \|<br>\| *Last Image Generated* \| ***For an existing schedule entry:***<br>This is the date and time at which the chart was last generated using either the fixed schedule or on-demand method. ***(Display Only)***<br>***When adding a new schedule entry:***<br>This field is hidden. \| |
| **Image Information** | \|  \|  \|<br>\| --- \| --- \|<br>\| *Output to \*mytiles subdirectory* \| ***(As of PxPlus 2021, this option is no longer available for selection.)***<br>For any existing schedule entries that were defined ***prior to PxPlus 2021*** with this check box ***On***, this option will display a check mark and be disabled.<br>The functionality associated with this option will not change, which is to output the image to a *\*mytiles* subdirectory if the image is to be used by a Windows Tile using the PxPlus MyTiles™ utility. \|<br>\| *Directory* \| ***(As of PxPlus 2021, this option is no longer available for selection.)***<br>For any existing schedule entries that were defined ***prior to PxPlus 2021*** with the *Output to \*mytiles subdirectory* check box ***On***, the *Directory* option will display and be disabled; otherwise, it will be hidden if the check box was ***Off***. \|<br>\| *Image Path or HTML File* \| Name of the image file to be generated. The name must include the image file suffix, i.e. *.png, .gif, .jpg*.<br>If the *Output to \*mytiles subdirectory* check box is ***On***, enter the *Image File*. The *Image File* entered must be a simple path name.<br>![](https://manual.pvxplus.com/migration-assets/34aef290b18fb24ec805cf84dff916599b237f25c22165ae75c3273c036050f3.png)<br>If the *Output to \*mytiles subdirectory* check box is ***Off***, enter the *Image Path or HTML File*. This can be a simple or full path name.<br>![](https://manual.pvxplus.com/migration-assets/0f8414e1f5c3b65e0a302cf6d9cf8c04821c9cebccda81a843ea53556d22563a.png)<br>The path can be a *Fixed* value or *Expression*. \|<br>\| *Image Shape* \| If the *Output to \*mytiles subdirectory* check box is ***On***, an image shape must be selected, either *Square* or *Wide*. \|<br>\| *Image Size in pixels* \| Enter the *Width* and *Height* of the image in pixels.<br>If the *Output to \*mytiles subdirectory* check box is ***On***, only the *Width* can be entered. The *Height* is calculated based on the specified shape.<br>If the *Output to \*mytiles subdirectory* check box is ***Off***, the *Width* and the *Height* can be entered. \|<br>\| *Test* \| Button used to generate and view a chart image based on the current definition.<br>When viewing the chart image, a check box option that allows you to delete the image file is available. \| |

Chart images can also be created by writing a program to create the chart and its image. To add this type of chart to the Chart Scheduler, click the *Add Program* button in *Chart Image Generation Schedule Maintenance*. A modified version of the **Chart Scheduler** is displayed.

![](https://manual.pvxplus.com/migration-assets/b780bb19460cc58b6c300d00f5a548f432e893453cb946e29b851db2a5c92b40.jpg)

For a chart schedule entry using a program, the **Chart Scheduler** requires the following information:

|  |  |
| --- | --- |
| *Schedule Item Name* | Unique name used to identify each schedule entry. The name is initially derived from the name of the chart definition; however, this can be changed. |
| **Program Information** | \|  \|  \|<br>\| --- \| --- \|<br>\| *(Input field)* \| Path of the program that generates the chart image. Path may be a *Fixed* value or an *Expression*. If the specified path does not exist, a message displays with a choice to use it or not. \|<br>\| *Expression* \| Select this check box if the directory is an expression. \| |
| **Scheduling Information** | \|  \|  \|<br>\| --- \| --- \|<br>\| *Frequency* \| See **[Adding a Chart to the Schedule](https://manual.pvxplus.com/chart-images-generation/schedule-the-chart-generation#addingachart)**. \|<br>\| *Next Image Generation* \| See **[Adding a Chart to the Schedule](https://manual.pvxplus.com/chart-images-generation/schedule-the-chart-generation#addingachart)**. \|<br>\| *Last Image Generated* \| See **[Adding a Chart to the Schedule](https://manual.pvxplus.com/chart-images-generation/schedule-the-chart-generation#addingachart)**. \| |

## Removing a Chart from the Schedule

From the list of schedule entries displayed in **Chart Image Generation Schedule Maintenance**, click to highlight the schedule entry to be deleted and select the *Remove* button.

## Modifying a Schedule Entry

From the list of schedule entries displayed in **Chart Image Generation Schedule Maintenance**, click to highlight the schedule entry to be modified and select the *Properties button.* The **Chart Scheduler** window opens with the information for the selected entry displayed for editing.
