Hi!
I want to draw a diagram/graph. I tried wxMathPlot, wxPlotCtrl but can't get the result i wanted.
would be nice if someone could help.
Look a the attachment or look here: http://www.pokertracker.com/screenshots ... _thumb.png
Thank you!
How to draw a diagram like this...(inside) Topic is solved
-
- I live to help wx-kind
- Posts: 192
- Joined: Fri Dec 22, 2006 9:17 am
- Location: Germany
How to draw a diagram like this...(inside)
You do not have the required permissions to view the files attached to this post.
-
- Experienced Solver
- Posts: 72
- Joined: Fri Feb 20, 2009 7:13 pm
- Location: $(#wx)\src
-
- I live to help wx-kind
- Posts: 192
- Joined: Fri Dec 22, 2006 9:17 am
- Location: Germany
Heres a piece of code i used for testing:
Code: Select all
m_graph = new mpWindow( this, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE );
itemBoxSizer2->Add(m_graph, 1, wxGROW|wxALL, 0);
// @ home
// Car shape:
std::vector<float> car_xs(20), car_ys(20);
car_xs[0]=100; car_ys[0]=300;
car_xs[1]=500; car_ys[1]=800;
car_xs[2]=1000; car_ys[2]=400;
car_xs[3]= 800; car_ys[3]=300;
/*car_xs[i]= 0; car_ys[i++]=-0.5;
car_xs[i]= 0.6; car_ys[i++]=-0.5;
car_xs[i]= 0.6; car_ys[i++]=-0.6;
car_xs[i]= 0.8; car_ys[i++]=-0.6;
car_xs[i]= 0.8; car_ys[i++]=-0.5;
car_xs[i]= 1.0; car_ys[i++]=-0.5;
car_xs[i]= 1.0; car_ys[i++]= 0.5;
car_xs[i]= 0.8; car_ys[i++]= 0.5;
car_xs[i]= 0.8; car_ys[i++]= 0.6;
car_xs[i]= 0.6; car_ys[i++]= 0.6;
car_xs[i]= 0.6; car_ys[i++]= 0.5;
car_xs[i]= 0; car_ys[i++]= 0.5;
car_xs[i]= 0; car_ys[i++]= 0.6;
car_xs[i]=-0.2; car_ys[i++]= 0.6;
car_xs[i]=-0.2; car_ys[i++]= 0.5;
car_xs[i]=-0.5; car_ys[i++]= 0.5;*/
mpFXYVector* vecs = new mpFXYVector(_("one"), mpALIGN_NE );
vecs->SetPen(wxPen(*wxGREEN, 5, wxSOLID));
vecs->SetData(car_xs, car_ys);
vecs->SetContinuity(false);
SetLabelX(_T("moin"));
SetLabelY(_T("zack"));
mpScaleX* xaxis = new mpScaleX(GetLabelX(), mpALIGN_BOTTOM, true);
mpScaleY* yaxis = new mpScaleY(GetLabelY(), mpALIGN_LEFT, true);
xaxis->SetDrawOutsideMargins(true);
yaxis->SetDrawOutsideMargins(true);
m_graph->AddLayer(xaxis);
m_graph->AddLayer(yaxis);
wxBrush hatch2(wxColour(163,208,212), wxSOLID);
mpInfoLegend* leg;
m_graph->AddLayer( leg = new mpInfoLegend(wxRect(200,20,40,40), &hatch2));
leg->SetVisible(true);
m_graph->AddLayer(vecs);
m_graph->Fit();
-
- I live to help wx-kind
- Posts: 192
- Joined: Fri Dec 22, 2006 9:17 am
- Location: Germany