Changeset 208 for trunk/src/statistics_dialog.cpp
- Timestamp:
- 08/17/2009 08:42:41 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/statistics_dialog.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/statistics_dialog.cpp
r206 r208 46 46 games_started = new wxStaticText(this, wxID_ANY, wxT("")); 47 47 games_finished = new wxStaticText(this, wxID_ANY, wxT("")); 48 histogram= new simple_pie_plot::SimplePiePlot(this, wxID_ANY);48 pie_plot = new simple_pie_plot::SimplePiePlot(this, wxID_ANY); 49 49 statistics_reset_date = new wxStaticText(this, wxID_ANY, wxT("")); 50 50 } … … 64 64 65 65 vector<int> score_dist = m_stats->score_distribution(); 66 vector<double> dist (score_dist.begin(), score_dist.end()); 67 histogram->SetData(dist); 66 vector<double> dist; 67 vector<wxString> labels; 68 for (int i; i<score_dist.size(); i++) { 69 if (score_dist[i]) { 70 assert(score_dist[i]>0); 71 dist.push_back(score_dist[i]); 72 tmp = wxString::Format(wxT("%i - %i"), 73 i*statistics::score_distribution_granuality, 74 (i+1)*statistics::score_distribution_granuality); 75 labels.push_back(tmp); 76 } 77 } 78 pie_plot->SetData(dist, labels); 68 79 } 69 80 … … 79 90 80 91 wxStaticBoxSizer* score_distribution = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Score Distribution") ), wxHORIZONTAL); 81 score_distribution->Add( histogram, 1, wxEXPAND, 10);92 score_distribution->Add(pie_plot, 1, wxEXPAND, 10); 82 93 top_sizer->Add(score_distribution,10,wxEXPAND, 10); 83 94
Note: See TracChangeset
for help on using the changeset viewer.
