Skip to content

Commit

Permalink
Specify X columns for methods.
Browse files Browse the repository at this point in the history
Don't use convenience method versions, as this will allow to specify
our own X columns later on.

Refs #7579
  • Loading branch information
arturbekasov committed Sep 24, 2013
1 parent c6a1e07 commit 2ddb81d
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions Code/Mantid/MantidPlot/src/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3175,9 +3175,10 @@ bool Graph::addCurves(Table* w, const QStringList& names, int style, double lWid

// --- Drawing error columns -----------------------------
if (colType == Table::xErr || colType == Table::yErr){
int ycol = w->colY(colIndex);
QString yColName = w->colName(w->colY(colIndex));
QString xColName = w->colName(w->colX(colIndex));

if (ycol < 0)
if (xColName.isEmpty() || yColName.isEmpty())
return false;

int dir;
Expand All @@ -3186,17 +3187,17 @@ bool Graph::addCurves(Table* w, const QStringList& names, int style, double lWid
else
dir = QwtErrorPlotCurve::Vertical;

PlotCurve* c = addErrorBars(w->colName(ycol), w, colName, dir);
PlotCurve* c = addErrorBars(xColName, yColName, w, colName, dir);
updateCurveLayout(c, &cl);
// --- Drawing label columns -----------------------------
} else if (colType == Table::Label){
int xcol = w->colX(colIndex);
int ycol = w->colY(colIndex);
QString xColName = w->colName(w->colX(colIndex));
QString yColName = w->colName(w->colY(colIndex));

if (xcol < 0 || ycol < 0)
if (xColName.isEmpty() || yColName.isEmpty())
return false;

DataCurve* mc = masterCurve(w->colName(xcol), w->colName(ycol));
DataCurve* mc = masterCurve(xColName, yColName);
if (!mc)
return false;

Expand All @@ -3205,7 +3206,12 @@ bool Graph::addCurves(Table* w, const QStringList& names, int style, double lWid
// --- Drawing Y columns -----------------------------
} else if (colType == Table::Y)
{
PlotCurve* c = insertCurve(w, colName, style, startRow, endRow);
QString xColName = w->colName(w->colX(colIndex));

if (xColName.isEmpty())
return false;

PlotCurve* c = insertCurve(w, xColName, colName, style, startRow, endRow);
updateCurveLayout(c, &cl);
}
}
Expand Down

0 comments on commit 2ddb81d

Please sign in to comment.