ONYX - 9.0 - Utilisation

Graphics management

De MappingDoc
Cette page est une version traduite de la page ONYX:9.0:Utilisation:Fonctionnement des graphiques et la traduction est complétée à 100 %.

Autres langues :
English • ‎français


ONYX Designer includes a graphics creation module whose operation is explained below.

Create a new graphic

  1. - Click on the Graphic icon on the Variable toolbar.
  2. - Click on the page and drag the mouse to draw the frame where the graphic will be printed.
  3. - Enter a name, a number of zones, and check the type of chart you want to print.


The number of zones to enter is the maximum number of zones that your graph can contain.

Graph1.png


Configure a chart

The graphics allow fairly advanced configuration. You can modify axis titles, number of intervals, maximum values…


For all these parameters, you can either set the values ​​for this graph or retrieve this information from the spool. The information retrieved from the spool will take priority over the values ​​defined “hard” for this graph.


This is useful, for example, in the case where the chart title is not present in all pages of the spool. This amounts to considering the values ​​in the chart as default values. In this case, the graphic type zones must be conditioned on the presence of a value in the spool.


  1. - Chart title
  2. - Title of the axes
  3. - Axis data
  4. - Minimum / maximum values
  5. - Number of Y axis intervals
  6. - Y axis origin
  7. - Round Y axis values
Graph2.png

Graphic type area

These areas allow you to completely configure your graph according to the spool values: titles, legend, axes, etc.


  1. - Chart data
  2. - X axis data
  3. - Y axis data
  4. - Chart title
  5. - X axis title
  6. - Y axis title
  7. - Legend data
  8. - Minimum value of Y axis
  9. - Maximum value of Y axis
  10. - Number of Y axis intervals
  11. - Round to the nearest n in the Y axis
  12. - Y axis origin


Retrieving data field

A chart does not retrieve data from the spool on its own. It uses graphic type areas. This allows you to completely condition data recovery.


To associate zones with a graph, simply give them the same name.


The zones can of course belong to a group, fixed or variable, be conditioned... Font and style information is not used. A Graphic type zone does not print anything on its own.


Retrieve data from the spool as chart data

  1. - Create your zone (positions in the original file, condition, group membership, etc.)
  2. - Name it as the complex graph it depends on
  3. - Select type Graphic
  4. - Choose subtype Chart Data

Configuration

Round Y axis values

To round the Y axis data values, you can either:

  1. - Create a zone of type Graphic / Round the Y axis to the nearest n recovering the value "n" in the spool
  2. - Set value in chart properties


To change the rounding pitch:

  1. - In the chart properties, select the Positioning tab
  2. - Double-click on the image representing the graph
  3. - In the Y Axis tab, change the value

Font and style
The font and style of the axes are defined in the chart properties and not in the chart type boxes. Even if you don't set a label in the chart properties, you must set the font to use.


Axis data

To define the axis data, you must create a Graphic / X axis data (or Y) zone retrieving the values ​​in the spool.


Font and style
The font and style of the data are defined in the chart properties and not in the chart type boxes.


To change the font and style:

  1. - In the chart properties, select the Positioning tab
  2. - Double click on the chart image
  3. - Change the values ​​of the Y Axis Font or X Axis Font tab


Number of Y axis intervals

To set the number of Y axis intervals, you can either:

  1. - Create a zone of type Graphic / Nbr of intervals of the Y axis recovering the value in the spool
  2. - Set this number in chart properties


To set the number of intervals in the chart properties:

  1. - In the chart properties, select the Positioning tab
  2. - Double-click on the image representing the graph
  3. - In the Y Axis tab, modify the value


Font and style
The font and style of the axes are defined in the chart properties and not in the chart type boxes. Even if you don't set a label in the chart properties, you must set the font to use.

Y axis origin

To set the origin of the Y axis, you can either:

  1. - Create a zone of type Graphic / Origin of the Y axis recovering the value in the spool
  2. - Set value in chart properties


To set the origin of the Y axis in the chart properties:

  1. - In the chart properties, select the Positioning tab
  2. - Double-click on the image representing the graph
  3. - In the Y Axis tab, modify the value


Font and style
The font and style of the axes are defined in the chart properties and not in the chart type boxes. Even if you don't set a label in the chart properties, you must set the font to use.


Axis titles

To give a title to the axes, you can either:

  1. - Create a Graphic / Title of the X axis (or Y) type zone retrieving the title in the spool
  2. - Set title in chart


To set the axis title in the chart:

  1. - In the chart properties, select the Positioning tab
  2. - Double-click on the X axis title area
  3. - Enter a value in the label


Font and style
The font and style of the axes are defined in the chart properties and not in the chart type boxes. Even if you don't set a label in the chart properties, you must set the font to use.


Chart title

To give a title to the graph, you can either:

  1. - Create a zone of type Graph / Title of the graph retrieving the title in the spool
  2. - Set title in chart


To set the axis title in the chart:

  1. - In the chart properties, select the Positioning tab
  2. - Double-click on the Graphic Title area
  3. - Enter a value in the label


Font and style
The font and style of the axes are defined in the chart properties and not in the chart type boxes. Even if you don't set a label in the chart properties, you must set the font to use.


Minimum / maximum values

To set the min and max values ​​for the Y axis, you can either:

  1. - Create a zone of type Graphic / Maximum (minimum) value of the Y axis retrieving the value in the spool
  2. - Set this value in chart properties


To set the min and max values ​​in the chart properties:

  1. - In the chart properties, select the Positioning tab
  2. - Double-click on the image representing the graph
  3. - In the Y Axis tab, modify the values

Font and style
The font and style of the axes are defined in the chart properties and not in the chart type boxes. Even if you don't set a label in the chart properties, you must set the font to use.


Parameters

Round to the nearest n in the Y axis

This type of zone allows you to round the values ​​of the vertical axis (for histograms and lines).


X axis data

This type of zone retrieves values ​​from the spool to use as horizontal axis data (for histograms and lines).

Y axis data

This type of zone retrieves values ​​from the spool to use as vertical axis data (for histograms and lines).


Legend data

This type of zone retrieves from the spool the values ​​which will be used to draw the legend.
This is the caption text.


Chart data

This type of zone retrieves from the spool the values ​​which will be used to draw the graph.
It only retrieves signed digital data. Other characters are ignored.


Number of Y axis intervals

This type of zone retrieves values ​​from the spool to use as the number of vertical axis intervals (for histograms and lines).

X axis origin

This type of zone retrieves a value from the spool as the origin of the vertical axis (for histograms and lines) i.e. as the first value of the axis.


X-axis title

This zone type retrieves a value from the spool as the title of the horizontal axis (for histograms and lines).


Y-axis title

This zone type retrieves a value from the spool as the title of the vertical axis (for histograms and lines).


Chart title

This zone type retrieves a value from the spool as the graph title.

Maximum value of Y-axis

This zone type returns a value of the spool as the maximum value of the vertical axis (for histograms and lines).
Attention, if a chart data exceeds this value, it will not be displayed corre


Minimum value of Y-axis

This zone type returns a value from the spool as the minimum value of the vertical axis (for histograms and lines).
Attention, if a chart data is less than this value, it will not be displayed correctly.

Barcodes

To create a barcode in MapDraw, simply create an object of type “Graphics”.

Graph3.png


In the “Type” tab, the number of zones represents the number of types of values ​​to represent, in most cases only one zone is required. The use of multiple zones allows you to define a particular color and style for each value of the chart.


The “Attributes” tab allows you to define the appearance, color, fill type, etc. of each zone.


The “Positioning” tab allows you to position each element of the graph, including the graph itself, the title of each axis, the title of the graph as well as the legend.

Graph4.png


By double-clicking on a particular element, the Properties window is accessed allowing you to modify the properties of the object (character police, color, etc.)


Defining Chart Values


To define the graph attributes and add values, graph type zones must be added.


The possible parameters are:

  1. - Graph Data
  2. - X-axis data
  3. - Y-axis data
  4. - Chart title
  5. - X-axis titer
  6. - Y-axis title
  7. - Legend data
  8. - Minimum value of Y-axis
  9. - Maximum Y-axis value
  10. - Number of Y-axis intervals
  11. - Rounding the Y-axis values ​​to n
  12. - Y-axis origin


These zones allow you to retrieve information from the spool and use it in the graph.


IMPORTANT:
Graph type areas must have the same name as the graph they are linked to.


Overlaid histograms

To obtain this type of graph, it is necessary to superimpose several graphs:

Graph5.png


It is enough to play on the spacing in percentages Left and Right:

Graph6.png


By default, a bar of a histogram takes up the entire available width (100%), but by modifying these parameters, it is possible to reduce the width of the bar as well as its position in it by providing a different scale to the left and right .


It is then sufficient to overlay multiple graphs with different spacing settings to obtain the desired rendering:

Graph7.png


Here, four graphics are superimposed giving a 3D look.

Example

Graph8.png

+

Graph9.png

=

Graph5.png


Dynamic Graph Positioning

A graphic is considered as a fixed zone, so it is impossible to place it dynamically on the page based on the zones located before it.

Though, you can play around this rule thanks to some conditions.


With a PAG/TXT spool

Graph11.png
Graph12.png
Graph13.png


Here is a simple example of a paged spool containing data to be used in a camembert. Appearance conditions must be set so that the graph appears only if the lines are at certain values.


Next you need to duplicate the graph. For example, 15 new graphs will be created with the same settings, but each offset 1cm downwards more than the previous one. It is important to increase the conditions, otherwise the zone will only be based on the same lines.

Graph14.png
Graph15.png


After duplication, we get this, each graph is scaled incrementally downwards and checks for different rows in the spool.

Graph16.png

First image: The data starts line 12. Second image: the data starts line 22.

Graph17.png
Graph18.png


The graph has therefore changed position according to the position of its data in the spool.


This is the only way to position a fixed pseudo-dynamic fashion zone, but a future evolution of ONYX should allow a simpler and more tailored solution to be provided.


With an XML spool

The best way to render the position of a graph dynamically with an XML spool and to add a field in the input file containing the number of zones present before the graph, as we cannot rely on the number of rows or all other information comes from the spool because the graph is not part of it.


For example: The “BEFORECAM” field indicates which combination of zones are present before the camembert, for example, its value is 1.

Graph19.png

Here is the condition on the first graph:

Graph20.png
Graph21.png


The duplicate button can be used, but the value must be changed manually because this is not a row, so the increment will not change anything.


The first graph showed that if the value is equal to 1, the second if it is 2, etc…


The problem with this solution, is that it requires a modification of the Connect potential that generates the XML file to reach the field, and assign a value to it based on the content of the previous fields.


The XML method is riskier because the number of lines present in the XML fields preceding the camembert was unknown, so it would have to join a lot more graph, or do more code-lettering to fit different functions of the blocks.