Ignore:
Timestamp:
05/04/2009 12:22:36 PM (3 years ago)
Author:
guyru
Message:

Add simple histogram to statistics

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/statistics_dialog.cpp

    r199 r202  
    4646        games_started = new wxStaticText(this, wxID_ANY, wxT("")); 
    4747        games_finished = new wxStaticText(this, wxID_ANY, wxT("")); 
     48        histogram = new SimpleHistogram(this, wxID_ANY); 
    4849        statistics_reset_date = new wxStaticText(this, wxID_ANY, wxT("")); 
    4950} 
     
    6162        tmp = wxT("Last reset: ") + reset_time.Format(); 
    6263        statistics_reset_date->SetLabel(tmp); 
     64 
     65        vector<int> score_dist = m_stats->score_distribution(); 
     66        vector<double> dist (score_dist.begin(), score_dist.end()); 
     67        histogram->SetData(dist); 
    6368} 
    6469 
     
    7176        game_counts->AddStretchSpacer(10); 
    7277        game_counts->Add(games_finished); 
    73         top_sizer->Add(game_counts,10,wxEXPAND); 
     78        top_sizer->Add(game_counts,0,wxEXPAND,10); 
    7479 
    7580        wxStaticBoxSizer* score_distribution = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxT("Score Distribution") ), wxHORIZONTAL); 
    76         top_sizer->Add(score_distribution,10,wxEXPAND); 
     81        score_distribution->Add(histogram, 1, wxEXPAND, 10); 
     82        top_sizer->Add(score_distribution,10,wxEXPAND, 10); 
    7783 
    78         top_sizer->Add(statistics_reset_date,10,wxEXPAND); 
     84        top_sizer->Add(statistics_reset_date,0,wxEXPAND,10); 
    7985         
    8086        wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL ); 
Note: See TracChangeset for help on using the changeset viewer.