Creating a Default Options chart file

In Niagara 4.4 and later there is added support for creating a Default Options chart file. The defaultOptions file does not exist automatically, rather you must create and save an appropriately named file. It is used to configure common settings on the Axis, Layers and Sampling tabs plus the Time Range. Chart files will load their options from this file if it exists and the user has permissions to view it.
Prerequisites:
  • You have a station connection open in Workbench.
  • There is an existing Px page on the station that contains a WebChart widget.

In prior releases, if you were not using a chart file to load a WebChart, there was no way to preset any options. In Niagara 4.4 and later, in a Px page the WebChart widget (WebWidget) has an added property named defaultOptions with a default ord of file:^charts/defaultOptions.chart. The property is used to configure a source chart file which defines settings used each time the WebChart loads. Even when not on a Px page, WebChart files will load their options from this file if it exists and the user has permissions to view it.

 NOTE:  The defaultOptions file is used only to configure common settings on the Axis, Layers and Sampling tabs plus the Time Range.  
Perform the following steps:
  1. Open the Px page and in PxViewer mode.
  2. In the chart set your preferred Time Range (e.g., click the dropdown and select Auto).
    Image
  3. Click on the chart Settings icon and select your preferred settings for charts. As an example, on the Layers tab, click the Status Coloring dropdown, set it to On and click OK.
    Image
  4. Click the chart Export icon and in the Exporting window make the following selections:
    1. Click the Select Destination dropdown and click on Station File.
    2. In the File Name field, edit the file name as needed.
      Image
  5. Click OK to export the default options file.
Your preferred chart settings are exported to this location in the station: file:^charts/defaultOptions_Auto.chart

To use your new default options file, simply add another webchart to the Px page and in PxEditor view, double-click on the chart to open the Properties window. For the defaultOptions property, enter the name of your newly exported defaultOptions file and click OK. The chart now shows the Time Range and Status Coloring settings as those saved to the exported defaultOptions file.

Image

Note that you can create and export multiple chart files saved with different file names, each with different settings that you commonly use. Each WebChart widget in a Px view can use a different chart file to load the WebChart with different options.