I created a wxmathplot with 62000 samples (X and Y data from csv). (http://wxmathplot.sourceforge.net/)
It takes 2 seconds to zoom and fit again for every ctrl + mouse scroll to zoom in and out.
I used the exact following code except the creation of x_values and y_values vectors.
Code: Select all
--------------------------------------------------------
double fRand(double fMin, double fMax)
{
double f = (double)rand() / RAND_MAX;
return fMin + f * (fMax - fMin);
}
--------------------------------------------------------
std::vector<double> x_values;
std::vector<double> y_values;
for(int i=0; i<62000;i++)
{
x_values.push_back(i);
y_values.push_back(fRand(1,1000));
}
--------------------------------------------------------
mpFXYVector* vectorLayer = new mpFXYVector("Series-1");
vectorLayer->SetData(x_values, y_values);
vectorLayer->SetContinuity(true);
wxPen vectorpen(*wxBLUE, 1, wxDOT);
vectorLayer->SetPen(vectorpen);
vectorLayer->SetDrawOutsideMargins(false);
wxFont graphFont(11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
m_plot = new mpWindow(m_panel6, -1, wxPoint(0, 0), wxSize(1600, 950), wxSUNKEN_BORDER);//Output Panel //900, 750
mpScaleX* xaxis = new mpScaleX(wxT("TIME"), mpALIGN_BOTTOM, true, mpX_NORMAL);
mpScaleY* yaxis = new mpScaleY(wxT("MAGNITUDE"), mpALIGN_LEFT, true);
xaxis->SetFont(graphFont);
yaxis->SetFont(graphFont);
xaxis->SetDrawOutsideMargins(false);
yaxis->SetDrawOutsideMargins(false);
m_plot->SetMargins(10, 110, 110, 110);
m_plot->AddLayer(xaxis);
m_plot->AddLayer(yaxis);
m_plot->AddLayer(vectorLayer);
m_plot->EnableDoubleBuffer(true);
m_plot->Fit();
Thank you,
Arun