360Works Charts 2.05 User Guide

Installation

Requirements

FileMaker version 12 or higher.

When 360Plugins are intialized for the first time, they will automatically download all required support files

Install Steps for FileMaker Pro

Drag the plugin from the MAC or WIN folder into your FileMaker extensions, and restart FileMaker.

If the plugin does not load correctly, please send an email to support@360works.com

WebDirect Install (FMS 13+)

Install plug-ins for use with WebDirect by dragging the appropriate plugin to FileMaker Server/Web Publishing/publishing-engine/cwpc/Plugins

Install steps for Instant Web Publishing

You do not need to do this step unless you plan on using the plugin with Instant Web Publishing with FileMaker Server Advanced. You will need an Enterprise license to use this feature.

For installing into the Web Publishing Engine with FileMaker Server or FileMaker Server Advanced, drag the plugin from the MAC or WIN(.fmx) folder into the FileMaker Server/Web Publishing/publishing-engine/wpc/Plugins folder. If there is no Plugins folder inside the wpc folder, then create it manually. Restart FileMaker Web Publishing, and now the plugins should be ready to go.

The easiest way to test whether the plugin is working is to call the version function of the plugin, and display that on an IWP layout. If it shows "?", then the plugin is not working. If it shows a number, then the plugin has been installed successfully.

Install steps for Custom Web Publishing

If you are using FileMaker Server 12.0v1 or earlier, you can follow the same procedure as detailed above for custom web publishing. However, in FileMaker Server 12.0v2 and later, custom web publishing now runs as a 64-bit application and requires the 64-bit version of the plugin You will need an Enterprise license to use this feature.

For Mac, the single plug-in file in the MAC directory contains both 32-bit and 64-bit versions. For Windows, look for the plug-in that has the extension .fmx64 and use it in exclusively in custom web publishing.

To install 64-bit plug-ins, install either the .fmx64 or the .fmplugin to the following directory:

FileMaker Server / Web Publishing / publishing-engine / cwpc / Plugins

If it does not exist, create the Plugin folder manually. Restart FileMaker Web Publishing, and then you can then test a script that contains a plug-in and see if it returns the correct values.

Install steps for server scheduled scripts

You do not need to do this step unless you plan on using the plugin with scheduled script triggering. You will need an Enterprise license to use this feature.

  1. Drag the plugin from the MAC (.fmplugin file) or WIN (.fmx64 file) folder into the FileMaker Server extensions folder. On Mac OS X, this is located at /Library/FileMaker Server/Database Server/Extensions folder. On Windows, this is at C:\Program Files\FileMaker\FileMaker Server\Database Server\Extensions.
  2. Restart the FileMaker Script Engine by opening Terminal (Mac) or CMD (Windows) and type the command: fmsadmin restart fmse -y . Note: On Windows you may need to change directories to where the fmsadmin utility is located in order to run this command. By default this is located at "C:\Program Files\FileMaker\FileMaker Server\Database Server" This step is not necessary if using Powershell
  3. Go to Configuration -> Database Server->Server Plug-ins and check the box that says 'Enable FileMaker Server to use plug-ins'(if it is not already checked), and then check the 'enabled' box for this plugin. Click the 'save' button and wait a few seconds to make sure that the 'enabled' check box stays checked. If it does not, then there was an error loading the plugin and you should contact us for help troubleshooting. You should now be able to write schedules that trigger scripts which use the plugin.

Auto Update

360Works has created an AutoUpdate helper database which makes setting up AutoUpdate much easier. This file includes pre-configured plugin files which you can place on your server, and an AutoUpdate script for each of our plugins which you can paste into your own solution.

You can get the AutoUpdate360Works file here Follow the instructions included in the file to either host your own Auto Update server or pull the files from ours.

Uninstalling the plugin

Uninstall the plugin by quitting FileMaker Pro or stopping FileMaker Server and removing the plugin file from your Extensions directory.

Demo mode and Registering the plugin

Plugins will run in demo mode until they are registered. While running in Demo mode, the product will run for 2 hours every time you launch FileMaker / FileMaker Server / FileMaker Web Publishing Engine. The 2 hour time limit will reset every time you relaunch FileMaker. There is no expiration date when Demo mode stops working. There are no feature differences between the Demo version and the licensed version.

Once you have purchased the plugin, you can register it with the license key. Once a valid license key is entered, the product will run for as long as FileMaker is running. After FileMaker starts up with the plugin installed, open FileMaker preferences, click on the Plug-ins tab, select the plugin from the list, and click the Configure button. Enter your license key and company name in this dialog. You will only need to do this once on a given machine. Alternately, you can use the registration function to register the plugin during a startup script.

Note: If you are running the plugin with FileMaker Server / FileMaker Web Publishing Engine, you must use the registration function to register the plugin, since there is no preferences dialog on FileMaker Server to enter the license key and company name. You will need to call the register function at the beginning of any script that is going to call plugin functions. This will ensure that you do not get demo mode errors.

Feedback

We love to hear your suggestions for improving our products! If you are experiencing problems with this plugin, or have a feature request, or are happy with it, we'd appreciate hearing about it. Send us a message on our website, or email us!

Error Handling/Reporting

When calling plugin functions as script steps, you will handle errors in the same manner you would any other FileMaker script step. Please see the FileMaker documentation for how to handle errors appropriately. Generally, if there is an error, our plugins will return an error code of 1552 when Get(LastError) is called. However, some plugin functions will return different error codes. If a function can return an error code other than a 1552, it will be documented with the description of the function below. In addition to the error code, you can also get the description of the error by calling Get(LastExternalErrorDetail)

You can also call our functions in a calculation dialog. In this case, error handling is done differently. If you decide to call plugin functions in a calculation dialog and you want to capture errors, see this page page for instruction on how to do so

Examples

ChartPlugin is a Filemaker Plugin for generating various types of graphical charts. Currently supported are: pie charts, bar charts, line charts, and time series chart.

Before creating a chart, you must register the plugin using chartRegister

The charting API is split into sections corresponding to each type of chart. In general, you call a method to create a chart, then populate data points, set color options, and generate the graphic.

Example Usage

Here is an example for creating a pie chart containing five values. The let() function is used to do the setup for the chart, and then the pieChartShowGraphic is called at the end to set the actual value of the container to the chart image.
 Set Variable [ $result = Let(
 debug = pieChartCreate( "Quoted Hours Worked" ) and
     pieChartSetDataPoint( Name 1 ; Quoted 1 ) and
     pieChartSetDataPoint( Name 2 ; Quoted 2 ) and
     pieChartSetDataPoint( Name 3 ; Quoted 3 ) and
     pieChartSetDataPoint( Name 4 ; Quoted 4 ) and
     pieChartSetDataPoint( Name 5 ; Quoted 5 );
     pieChartShowGraphic( 360; 360 )
 )
 

Custom parameters

The core charting API deals with the most common tasks. For additional flexibility, you can pass multiple extra parameters to the *ChartShowGraphic functions. The following is a list of all parameters:
legend
Set this to "false" to hide the legend at the bottom of the chart.
explodeSeries
causes one "slice" of a pie chart to appear offset from the center of the chart. The value can be a name or numeric index.
strokeWidth
The width of the stroke used to outline the parts of the chart.
backgroundColor
The background color of the chart. Pass in three numeric values, e.g. 64,128,255
plotBackgroundColor
The background color of the plot area (excluding the headers and legends). Pass in three numeric values, e.g. 64,128,255
noDataMessage
The message to display when there is no data to display in the chart
label
A template string which is used to generate chart labels. For pie charts, {0} is replace with the item name, {1} is the numeric amount, and {2} is the percent amount.
outline
1 or 0 to show/hide a single border around the chart, but within the legend.
outlines
1 or 0 to enable/disable outlines around individual chart elements (for pie charts only)
hideLabels
Whether to hide labels on the chart (for pie charts only)
valueAxis.min
The minimum range to use on the value axis (instead of auto-range)
valueAxis.max
The maximum range to use on the value axis (instead of auto-range)
valueAxis.showTickLabels
true/false to enable/disable the tick labels in the value axis
valueAxis.showTickMarks
true/false to enable/disable the tick marks in the value axi
To use this, simply pass any number of parameters as key/vaue pairs, for example:
 Set Variable [$result = Let(
 debug = pieChartCreate( "Quoted Hours Worked" ) and
     pieChartSetDataPoint( Name 1 ; Quoted 1 ) and
     pieChartSetDataPoint( Name 2 ; Quoted 2 ) and
     pieChartSetDataPoint( Name 3 ; Quoted 3 ) and
     pieChartSetDataPoint( Name 4 ; Quoted 4 ) and
     pieChartSetDataPoint( Name 5 ; Quoted 5 )
 ;
 pieChartShowGraphic(
     360 ;
     360 ;
     "explodeSeries=" & Name 1 ; // explode the first series
     "backgroundColor=100,100,255") ; // light-blue background
     "outline=false" // don't show an outline
     "legend=false" // don't show the legend
 )
 )
 ]
 

Function Summary

Function Detail

barChartCreate ( name ; categoryAxisLabel ; valueAxisLabel { ; isVertical ; use3d } )

Create a bar chart. A bar chart looks like this:

bar chart

Parameters:
name - the optional name of the chart
categoryAxisLabel - the optional label for the category axis of the chart
valueAxisLabel - the optional label for the value axis of the chart
isVertical - Whether to orient the chart horizontally (0) or vertically (1)
use3d - whether to apply a three-dimensional effect to the chart.
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

barChartSetDataPoint ( group; category ; value )

Set a data point in a bar chart. Categories are a way to break an item into smaller pieces. A group can have multiple categories.

Parameters:
group - unique group name identifier.
category - category name identifier. Typically, the same categories are repeated for each group.
value - the numeric value for the group/category combination
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

barChartSetSeriesColor ( category ; red ; green ; blue ; alpha )

Set the color that a particular category is displayed in. You should call chartSetColor AFTER adding values to the chart.

Parameters:
category - a category which was set in a previous call to {@link #barChartSetDataPoint(String, String, double)}.
red - a number between 0-255
green - a number between 0-255
blue - a number between 0-255
alpha - a number between 0-255 indicating the transparency of the color. 0 is completely transparent.
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

barChartShowGraphic ( width ; height { ; additionalParams... } )

Generates the bar chart containing all previously set data points.

See the Custom Parameters section for a list of parameters which this function accepts.

Parameters:
width - the width of the resulting image
height - the height of the resulting image
additionalParams - additional parameters
width -
Returns: an image containing the chart of the supplied dimensions.

chartLastError

Returns the last error which occurred, or "" if there was no error.


chartParam ( key ; value )

Parameters:

chartRegister ( key ; registeredTo )

Registers the Plugin.

Parameters:
licenseKey - a valid license key string, or the literal string "DEMO" to run in demo mode.
registeredTo - the company name for the license key used.
Returns: 1 on success, or "ERROR" on failure.

chartReportProblem ( emailAddress ; problemDescription )

Send a problem report to 360Works.

Parameters:
emailAddress - The user's email address to allow for support contact
problemDescription - A description of the current issue
Returns: Always returns 1

chartSetErrorCapture ( errorCapture )

Toggles error dialogs on or off. When something unexpected happens, the plug-in will pop up a dialog displaying the error message. This makes it easy to see what went wrong. However, in some cases, you (the developer) may prefer to show your own message to the user, or possibly not show a message at all. In that case, you can call chartSetErrorCapture with a parameter of true. That will suppress the error dialog from appearing to the user.

Parameters:
errorCapture - set to true to suppress the default popups.

lineChartCreate ( name ; categoryAxisLabel ; valueAxisLabel { ; isVertical ; use3d } )

Create a line chart.

Parameters:
name - The title of the chart
categoryAxisLabel - The label for the category axis
valueAxisLabel - The label for the value axis
isVertical - Whether to orient the line chart vertically or horizontally (pass a 1 for vertical)
use3d - whether to apply a three-dimensional effect to the chart
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

lineChartSetDataPoint ( seriesName ; category ; value )

Set a data point or a return separated list of points in a line chart. Categories are a way to break an item into smaller pieces. A group can have multiple categories. The line will be drawn from left to right in the order items are added.

Parameters:
seriesName - the name of the series (or line) that this data point will apply to.
category - category name identifier. This appears in the category axis of the line chart.
value - the numeric value for the group/category combination
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

lineChartSetSeriesColor ( category ; red ; green ; blue ; alpha )

Set the color that a particular category is displayed in. You should call chartSetColor AFTER adding values to the chart.

Parameters:
category - a category which was set in a previous call to {@link #lineChartSetDataPoint(String, String, String)}.
red - a number between 0-255
green - a number between 0-255
blue - a number between 0-255
alpha - a number between 0-255 indicating the transparency of the color. 0 is completely transparent.
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

lineChartShowGraphic ( width ; height { ; additionalParams... } )

Generates the line chart containing all previously set data points.

The additionalParams are optional parameters which can be used to customize the chart display.

See the Custom Parameters section for a list of parameters which this function accepts.

Parameters:
width -
width - the width of the resulting image
height - the height of the resulting image
additionalParams - additional parameters
Returns: an image containing the chart of the supplied dimensions.

pieChartCreate ( name { ; 3d } )

Creates a new pie chart with the given name. This function must be called before adding data to the chart, modifying colors or display options, or displaying the chart graphic. A pie chart looks like this:

pie chart

Parameters:
name - The optional name of the chart.
use3d - whether to use a three-dimensional effect on the chart.
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

pieChartSetDataPoint ( category ; value )

Adds a value or a return separated list of values to a pie chart created with the pieChartCreate function. Calling this twice with the same category name will overwrite the previously set value.

Parameters:
category - category name
value - The numeric value for the category.
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

pieChartSetSeriesColor ( category ; red ; green ; blue ; alpha )

Set the color that a particular category is displayed in. You should call chartSetColor AFTER adding values to the chart.

Parameters:
category - a category which was set in a previous call to {@link #pieChartSetDataPoint(String, String)}.
red - a number between 0-255
green - a number between 0-255
blue - a number between 0-255
alpha - a number between 0-255 indicating the transparency of the color. 0 is completely transparent.
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

pieChartShowGraphic ( width ; height { ; additionalParams... } )

Returns the container image for the currently configured chart. Note that this also releases any resources used by the chart, so it can only be called once.

The additionalParams are optional parameters which can be used to customize the chart display.

See the Custom Parameters section for a list of parameters which this function accepts.

Parameters:
width -
height -
additionalParams - additional parameters which customize how the chart is generated
Returns: the chart image

timeSeriesChartAddRegression ( seriesName { ; properties } )

Adds a regression to the time series. This should be called AFTER setting all time series data points.

The valid properties are:

Parameters:
seriesName - the name of the series to add the regression to. If blank, the first series is used.
properties - optional arguments
Returns:

timeSeriesChartCreate ( name ; timeAxisLabel ; valueAxisLabel )

Creates a time series chart, for displaying a line chart which displays value information for dates.

Parameters:
name - The optional name of the chart (this will be displayed in the chart header)
timeAxisLabel - the optional label for the time axis
valueAxisLabel - the optional label for the value axis
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

timeSeriesChartSetDataPoint ( seriesName ; dateOrTime ; value )

Sets a value or a return separated list of values for a specific series and date or return separated list of dates. Note that if passing in a list of values make sure to passin a corresponding list of dates.

Parameters:
seriesName - The series name (or line) whose value is being set.
date - the date whose value is being set.
value - the value of the series on the specified date
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

timeSeriesChartSetSeriesColor ( seriesName ; red ; green ; blue ; alpha )

Set the color that a particular time series is displayed in. You should call chartSetColor AFTER adding values to the chart.

Parameters:
seriesName - a seriesName which was set in a previous call to {@link #timeSeriesChartSetDataPoint(String, String, String)}.
red - a number between 0-255
green - a number between 0-255
blue - a number between 0-255
alpha - a number between 0-255 indicating the transparency of the color. 0 is completely transparent.
Returns: 1 on success, or "ERROR" if there was a problem (use ChartLastError for more detailed information about the nature of the error).

timeSeriesChartShowGraphic ( width ; height { ; additionalParams... } )

Generates the time series chart containing all previously set data points.

The additionalParams are optional parameters which can be used to customize the chart display.

See the Custom Parameters section for a list of parameters which this function accepts.

Parameters:
width -
width - the width of the resulting image
height - the height of the resulting image
additionalParams - additional parameters
Returns: an image containing the chart of the supplied dimensions.