summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/graph.cpp
Unidiff
Diffstat (limited to 'noncore/apps/checkbook/graph.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/graph.cpp9
1 files changed, 0 insertions, 9 deletions
diff --git a/noncore/apps/checkbook/graph.cpp b/noncore/apps/checkbook/graph.cpp
index 8ae835c..acdb846 100644
--- a/noncore/apps/checkbook/graph.cpp
+++ b/noncore/apps/checkbook/graph.cpp
@@ -78,29 +78,24 @@ void Graph::initGraph()
78 return; 78 return;
79 } 79 }
80 80
81 // Any common stuff here (titles, ???) 81 // Any common stuff here (titles, ???)
82 82
83 switch ( data->graphType() ) 83 switch ( data->graphType() )
84 { 84 {
85 case GraphInfo::BarChart : 85 case GraphInfo::BarChart :
86 { 86 {
87 drawBarChart( width(), height(), data->maxValue() ); 87 drawBarChart( width(), height(), data->maxValue() );
88 } 88 }
89 break; 89 break;
90 case GraphInfo::LineChart :
91 {
92 //drawLineChart( p, s, min, max );
93 }
94 break;
95 case GraphInfo::PieChart : 90 case GraphInfo::PieChart :
96 { 91 {
97 drawPieChart( width(), height(), data->totalValue() ); 92 drawPieChart( width(), height(), data->totalValue() );
98 } 93 }
99 }; 94 };
100} 95}
101 96
102void Graph::drawBarChart( int width, int height, float max ) 97void Graph::drawBarChart( int width, int height, float max )
103{ 98{
104 QPainter p( &graph ); 99 QPainter p( &graph );
105 100
106 // Try to set the font size smaller for text 101 // Try to set the font size smaller for text
@@ -123,28 +118,24 @@ void Graph::drawBarChart( int width, int height, float max )
123 int bw = ( width - width / 4 - x ) / ( n - i ); 118 int bw = ( width - width / 4 - x ) / ( n - i );
124 int bh = int( ( height - height / 4 - 1 ) * dp->value() / max ); 119 int bh = int( ( height - height / 4 - 1 ) * dp->value() / max );
125 p.drawRect( width / 8 + x, height - height / 8 - 1 - bh, bw, bh ); 120 p.drawRect( width / 8 + x, height - height / 8 - 1 - bh, bw, bh );
126 fw = fm.width( dp->label() ); 121 fw = fm.width( dp->label() );
127 p.drawText( width / 8 + x - fw / 2 + bw / 2, height - height / 8, fw, 122 p.drawText( width / 8 + x - fw / 2 + bw / 2, height - height / 8, fw,
128 fh + height / 8, AlignTop | AlignHCenter, dp->label() ); 123 fh + height / 8, AlignTop | AlignHCenter, dp->label() );
129 // WordBreak | AlignTop | AlignHCenter, dp->label() ); 124 // WordBreak | AlignTop | AlignHCenter, dp->label() );
130 i++; 125 i++;
131 x += bw; 126 x += bw;
132 } 127 }
133} 128}
134 129
135void Graph::drawLineChart( int width, int height, float max )
136{
137}
138
139void Graph::drawPieChart( int width, int height, float sum ) 130void Graph::drawPieChart( int width, int height, float sum )
140{ 131{
141 QPainter p( &graph ); 132 QPainter p( &graph );
142 133
143 // Try to set the font size smaller for text 134 // Try to set the font size smaller for text
144 QFont f = font(); 135 QFont f = font();
145 f.setPointSize( 8 ); 136 f.setPointSize( 8 );
146 p.setFont( f ); 137 p.setFont( f );
147 138
148 int n = data->numberDataPoints(); 139 int n = data->numberDataPoints();
149 140
150 int apos = -90 * 16; 141 int apos = -90 * 16;