Manipulating Charts (Deprecated)

Prev Next

Applies to: Lasernet Core 10

Manipulating Charts (Deprecated)

Note. This feature has no Lasernet Core 11 counterpart and is retained here for LN10 reference only.

The Lasernet Form Editor has a built-in chart tool for designing charts. More information about how to work with the chart tool can be found in the Form Editor manual. Inserting charts from script, as described here, is still supported but will be deprecated in future versions of Lasernet Core.

Scripted charts are based on an external API which supports a wide variety of chart types. The API has been mapped to the scripting engine in Lasernet Core, and as such charts can only be included via script. A "ChartHelper" script is available. The ChartHelper enables easy implementation of the most common setups for each chart type.

To use charts this way, a page-end modifier must be created on the page containing a chart to be printed. Due to limitations of the image tool in Lasernet Core, charts currently use overlays for the layout. This means that the chart positions are static and defined by the coordinates given by the script.

Lasernet Core includes a helper function to assist in making charts. By using this function, it is possible to create the majority of simple chart types by just changing a few parameters. The function has the following form:

createChart(type, posX, posY, width, height,

labelFontSize, yIntervals, margin, labels,

data, xTitle, yTitle, antiAliasing)

An explanation of the parameters is given in the table below.

Parameter

Type

Description

type

required

Defines the type of chart in the output. Available types include “Pie”, “Line”, “Bar”, “Area”, “Spline”, “StepLine” and “Trend”. The function also recognizes “3D” as a part of the string. Examples of this could be “Pie3D”, “Bar_3D” or “Area 3D”.

posX

required

X-axis position of the chart on the paper (in 0.1 mm).

posY

required

Y-axis position of the chart on the paper (in 0.1 mm).

width

required

Width of the chart on the paper (in 0.1 mm).

height

required

Height of the chart on the paper (in 0.1 mm).

labelFontSize

optional

Font size of the labels for the data to be displayed on the chart. (default: 10)

yIntervals

optional

Number of intervals on the y-axis of xy-charts. This parameter only affects xy-charts. (default: 5)

margin

optional

Defines the total margin of each axis. A margin of 200 makes 100 pixels margin on all sides of the chart. (default: 300)

labels

optional

The JobInfo name containing the labels for the data to be displayed in the chart. (default: “Chart_Labels”)

data

optional

The JobInfo name containing the data for display in the chart. (default: “Chart_Data”)

xTitle

optional

Defines the title of the x-axis of an xy-chart. (default: “Chart_XTitle”)

yTitle

optional

Defines the title of the y-axis of an xy-chart. (default: “Chart_YTitle”)

antiAliasing

optional

Defines antialiasing. The following constants are defined as valid values for this parameter:

Chart.NoAntiAlias = 0

Chart.AntiAlias = 1

Chart.AutoAntiAlias = 2

(default: Chart.NoAntiAlias)

To create complex charts, a more advanced script is required. The helper function is only intended for creating simple charts.

Was this page helpful? Let us know at knowledgebase.feedback@lasernetgroup.com