41 connect(m.data(), &QAbstractItemModel::dataChanged,
50 const QModelIndex &topLeft,
const QModelIndex &bottomRight)
66 m_Window -> m_ImagePlot -> enableAxis(QwtPlot::yRight,
false);
77 int nr = model->rowCount(QModelIndex());
79 for (
int i=0; i<nr; i++) {
86 const double *cols[2];
91 int nr = integ->size();
92 labels[0] = integ->get_XUnitsLabel();
96 const double *xc = cols[xcol];
98 m_Window->m_ImagePlot -> setAxisTitle(QwtPlot::xBottom, labels[xcol]);
100 for (
int i=0; i<2; i++) {
101 if (model->getY(i)) {
102 appendCurve(labels[i], 0, curveNumber++, xc, cols[i], nr);
105 if (model->getY2(i)) {
106 appendCurve(labels[i], 1, curveNumber++, xc, cols[i], nr);
115 m_Window->m_ImagePlot -> setAxisTitle(QwtPlot::xBottom, xCol->get_Name());
117 for (
int i=0; i<nr; i++) {
118 if (model->getY(i)) {
122 appendCurve(yCol->get_Name(), 0, curveNumber++, xCol, yCol);
126 if (model->getY2(i)) {
130 appendCurve(y2Col->get_Name(), 1, curveNumber++, xCol, y2Col);
139 m_Window -> m_ImagePlot -> replot();
145 QString name,
int axis,
int curveNumber,
const double *x,
const double *y,
int npts)
149 curve->setSamples(x, y, npts);
151 m_Window->m_ImagePlot->setPlotCurveStyle(curveNumber, curve);
154 curve->setYAxis(QwtPlot::yLeft);
155 }
else if (axis == 1) {
156 curve->setYAxis(QwtPlot::yRight);
158 m_Window->m_ImagePlot->enableAxis(QwtPlot::yRight,
true);
168 const double *xp = x->data(), *yp = y->data();
169 int np = qMin(x->count(), y->count());
QSharedPointer< QcepScatterPlotGraphModel > QcepScatterPlotGraphModelPtr
QSharedPointer< QcepDataColumnScan > QcepDataColumnScanPtr
QSharedPointer< QcepDataColumn > QcepDataColumnPtr
JSON Parse a string as a JSON object
void appendCurve(QwtPlotCurve *curve)
QSharedPointer< QcepIntegratedData > QcepIntegratedDataPtr
QcepScatterPlotGraphModelPtr model()
QcepScatterPlotGraphController(QcepDataObjectGraphWindow *window, int mode, QcepDataObjectWPtr object)
QcepDataObjectGraphWindow * m_Window
A class which draws piecewise curves.
QWeakPointer< QcepDataObject > QcepDataObjectWPtr
QSharedPointer< QcepDataObject > QcepDataObjectPtr
void onPlotDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
virtual void updateDisplay()
virtual void updateDisplay()
QcepDataObjectWPtr m_Object
QcepScatterPlotGraphModelWPtr m_Model
void appendCurve(QString name, int axis, int curveNumber, const double *x, const double *y, int npts)
virtual ~QcepScatterPlotGraphController()