24 #include "gobchartsbarview.h"
25 #include "utils/gobchartscolours.h"
27 #include <QGraphicsDropShadowEffect>
28 #include <QGraphicsRectItem>
32 const int BAR_SPACING = 5;
61 QString cat =
category( validRows.at( row ) );
62 qreal val =
value( validRows.at( row ) );
79 if( dataPercentage < 0.01 )
86 bottomRight = QPointF(
innerSceneRectF().left() + barColWidth * row + barColWidth - BAR_SPACING,
94 bottomRight = QPointF(
innerSceneRectF().left() + barColWidth * row + barColWidth - BAR_SPACING,
98 QRectF barRectangle( topLeft, bottomRight );
99 QLinearGradient columnGradient( barRectangle.bottomLeft(), barRectangle.topRight() );
100 columnGradient.setColorAt( 0, QColor( ( Qt::GlobalColor ) 2 ) );
107 columnGradient.setColorAt( 1, colour );
112 columnGradient.setColorAt( 1, colour );
116 QBrush columnBrush( columnGradient );
117 QGraphicsRectItem *graphicsBar =
new QGraphicsRectItem( barRectangle );
118 graphicsBar->setBrush( columnBrush );
120 QGraphicsDropShadowEffect *dropShadow =
new QGraphicsDropShadowEffect;
121 dropShadow->setOffset( QPointF( 2,-2 ) );
122 graphicsBar->setGraphicsEffect( dropShadow );
124 QString legendText = QString(
"%1 - %2" ).arg( cat ).arg( val );
132 debugLog( tr(
"GobChartsBarView::generateGraphicsItems# No valid items." ) );
147 return QString(
"%1" ).arg( static_cast< int >( BAR ) );