Hello,

My application is plotting graphs with line style and then there is a configuration dialog where the user can add dots on this lines. But when I press the checkbox to create the dots, nothing happens, my graph keeps the same. The part that I plot the graph is:

Qt Code:
  1. // Insert new curves
  2. curveArray[iGraphCounter].setAxes(QwtPlot::xBottom,QwtPlot::yLeft+iGraphCounter);
  3. curveArray[iGraphCounter].setTitle(object->legend.c_str());
  4. curveArray[iGraphCounter].setRenderHint(QwtPlotItem::RenderAntialiased);
  5. curveArray[iGraphCounter].setLegendAttribute(QwtPlotCurve::LegendShowLine, true);
  6.  
  7. curveArray[iGraphCounter].setPen(QColor(iColorMap[iGraphCounter][0],iColorMap[iGraphCounter][1],iColorMap[iGraphCounter][2],iColorMap[iGraphCounter][3]));
  8. curveArray[iGraphCounter].setStyle(QwtPlotCurve::Lines);
  9. curveArray[iGraphCounter].setRawSamples(&object->xContent[0],&object->yContent[0],object->xContent.size());
  10. curveArray[iGraphCounter].attach(plot);
To copy to clipboard, switch view to plain text mode 

When the user press the combox to add the dots, the application goes to this part:

Qt Code:
  1. if (dotLinesCheckBox->isChecked())
  2. {
  3. for (int i=0; i<iGraphCounter; i++)
  4. {
  5. curveArray[iGraphCounter].setSymbol(new QwtSymbol ( QwtSymbol::Ellipse , QBrush(curveArray[iGraphCounter].pen().color()), QPen(curveArray[iGraphCounter].pen().color()), QSize(5,5)));
  6. }
  7. }
  8. else
  9. {
  10. for (int i=0; i<iGraphCounter; i++)
  11. {
  12. curveArray[iGraphCounter].setSymbol(new QwtSymbol ( QwtSymbol::NoSymbol , QBrush(curveArray[iGraphCounter].pen().color()), QPen(curveArray[iGraphCounter].pen().color()), QSize(5,5)));
  13. }
  14. }
  15. plot->replot();
To copy to clipboard, switch view to plain text mode 

I think it's because my curves are already attached and then I cannot change. But I'm not sure. And if what I think it's true, how can I make it?
How can I plot a graph with lines and then later add dots to the lines?

Thanks in advance
Best Regards