XYSetErrorbarConfig

XYSetErrorbarConfig sets the error bar settings.

bool = XYSetErrorbarConfig(hData, ssXY, rvConfig)

Return Value

If the function succeeds, the return value bool is TRUE (1); otherwise it is FALSE (0).

Parameters

hData

The handle of a dataset created with XYCreate or TYCreate.

ssXY

ssXY is a scalare string. For “X” the configuration of the x-errorbars is returned and for “Y” the y errobar configuration.

rvConfig

rvConfig is a real vector with 5 elements:

Value Name Description
rvConfig[1] Pen Pen Handle that is used to draw the error bar.
rvConfig[2] LineWidthCap Line width of the error bar cap in steps of 0.1 mm.
rvConfig[3] CapWidth Width of the error bar cap in centimeters. If the width is 0 the cap is not drawn.
rvConfig[4] dValue Error value. The meaning depends on the attribute value.
rvConfig[5] Attribut See next table.

The element rvConfig[5] (Attribut) can be a combination of the following values:

Value Name Description
  0 switch off error bar
ERRORBAR_PERCENT 1 Error value in percent
ERRORBAR_CONSTANT 2 Absolut error value
ERRORBAR_PLUS 8 Draw positive error bar
ERRORBAR_MINUS 16 Draw negative error bar
ERRORBAR_PLUSMINUS 24 Draw positive and negative error bar.

Comment

The function returns a copy of the used pen (rvConfig[1]). This pen must be deleted with PenDestroy after it has been used to avoid memory leaks.

Example

XYSetStyle(hData, XY_SHOWLINE | XY_SHOWERRORBARS);
rvConfig = XYGetErrorbarConfig(hData, "Y");
rvConfig[4] = 0.03; // Percent
rvConfig[5] = ERRORBAR_PERCENT | ERRORBAR_PLUSMINUS; // Attrib
XYSetErrorbarConfig(hData, "Y", rvConfig);
PenDestroy(rvConfig[1]);  // Delete Pen
// Do not display x-errorbars
rvConfig = XYGetErrorbarConfig(hData, "X");
rvConfig[5] = 0; // switch off
XYSetErrorbarConfig(hData, "X", rvConfig);
PenDestroy(rvConfig[1]);  // Delete Pen

id-288974