Changeset 208 for trunk/src/simple_pie_plot.h
- Timestamp:
- 08/17/2009 08:42:41 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/simple_pie_plot.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/simple_pie_plot.h
r207 r208 32 32 const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, 33 33 long style = wxNO_BORDER, const wxString& name = wxPanelNameStr); 34 void SetData(std::vector<double> d );34 void SetData(std::vector<double> d, std::vector<wxString> labels); 35 35 void OnPaint(wxPaintEvent& event); 36 36 void OnResize(wxSizeEvent& event); 37 37 void OnMouseLeaveWindow(wxMouseEvent& event); 38 38 void OnMouseMove(wxMouseEvent& event); 39 wxSize GetMinSize() const; 39 40 private: 40 41 /** … … 44 45 wxColour GetSegmentColor(int i); 45 46 47 /** 48 * Calculate the angles in the plot and populate the m_angles array. 49 */ 50 void CalculateAngles(); 51 52 /** 53 * Calculate the maximum widht and height for a label in the legend. 54 */ 55 void CalculateLegendDimensions(wxGraphicsContext *dc); 56 57 /** 58 * Calculate the location and radius of the pie plot. 59 */ 60 void CalculatePiePlotLocation(); 61 62 void DrawLegend(wxGraphicsContext *dc); 63 46 64 void Highlight(int i); 47 65 void ClearHighlight(); 48 66 49 67 std::vector<double> m_data; 68 std::vector<wxString> m_labels; 50 69 std::vector<double> m_angles; 51 70 double m_data_total; 52 71 int m_highlight; 72 73 /// maximum width for a label in the legend. 74 double m_max_legend_width; 75 /// maximum height for a label in the legend. 76 double m_max_legend_height; 77 /// total width of the legend 78 double m_legend_width; 79 /// the line height of each legend entry including padding 80 double m_legend_line_height; 81 82 static const double m_legend_left_padding = 10; 83 84 // The center point of the pie plot 85 double m_pie_x; 86 double m_pie_y; 87 double m_radius; 88 53 89 }; 54 90
Note: See TracChangeset
for help on using the changeset viewer.
