## Description

Adds an X error bar plot to an existing dataplot.

## Syntax

int AddXErrBar( Curve & cData, Column & colXErrBar )

int AddXErrBar( Curve & cData, Dataset & dsXErrBar )

## Parameters

cData
[input] Data curve to add the X error bar to
colXErrBar
[input] the Data curve to be used as X error bar

cData
[input] Data curve to add the X error bar to
dsXErrBar
[input] the dataset to be used as X error bar

## Return

the index of the the added X error bar dataplot in layer, or -1 if failed.

## Examples

EX1

// For this example to run, a worksheet with columns "A" and "B" and another column
// (the third column) must exist with some numeric data in them.
// After the function executes, the third column of the worksheet will be used
// for X error bars (the graph may need to be refreshed to see the error bars).
{
GraphPage gp;
gp.Create();
GraphLayer    lay = gp.Layers(0);

// a dataplot in the layer that uses column B as Y and column A as X
Worksheet wks = Project.WorksheetPages(0).Layers(0);
if(lay && wks)
{
Curve            cc(wks, 0, 1);

// use the third column in the worksheet for X error bar:
Column    colErrBar(wks, 2);
lay.Rescale();
out_int("nPlotIndex = ", nPlotIndex);
}
}

EX2

//For this example to run, a worksheet with columns "A" and
//"B" and "C" must exist with some numeric data in them.
//After the function executes, the graph may need to be
//refreshed to see the error bars.
{
Worksheet wks = Project.WorksheetPages(0).Layers(0);
GraphPage gp;
gp.Create("origin");
GraphLayer glMyLayer = gp.Layers(0);

if(wks && glMyLayer)
{
Curve crvMyCurve(wks, 0, 1);
Dataset dsXErrBar(wks, 2);
glMyLayer.Rescale();
if (iPlotIndex==-1)
printf("X ErrBar Plotting Error!");
else
}