Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

KDChartCartesianAxis.cpp File Reference

#include <cmath>
#include <QtDebug>
#include <QPainter>
#include <QPen>
#include <QBrush>
#include <QApplication>
#include "KDChartPaintContext.h"
#include "KDChartChart.h"
#include "KDChartCartesianAxis.h"
#include "KDChartCartesianAxis_p.h"
#include "KDChartAbstractCartesianDiagram.h"
#include "KDChartAbstractGrid.h"
#include "KDChartPainterSaver_p.h"
#include "KDChartLayoutItems.h"
#include "KDChartBarDiagram.h"
#include <KDABLibFakes>

Include dependency graph for KDChartCartesianAxis.cpp:

Go to the source code of this file.

Defines

#define d   (d_func())

Functions

void calculateNextLabel (qreal &labelValue, qreal step, bool isLogarithmic)
void calculateOverlap (int i, int first, int last, int measure, bool isBarDiagram, int &firstOverlap, int &lastOverlap)
bool referenceDiagramIsBarDiagram (const AbstractDiagram *diagram)


Define Documentation

#define d   (d_func())
 

Definition at line 49 of file KDChartCartesianAxis.cpp.


Function Documentation

void calculateNextLabel qreal &  labelValue,
qreal  step,
bool  isLogarithmic
[static]
 

Definition at line 347 of file KDChartCartesianAxis.cpp.

Referenced by KDChart::CartesianAxis::paintCtx().

00348 {
00349     if ( isLogarithmic ){
00350         labelValue *= 10.0;
00351     }else{
00352         //qDebug() << "new axis label:" << labelValue << "+" << step << "=" << labelValue+step;
00353         labelValue += step;
00354     }
00355     if( qAbs(labelValue) < 1.0e-15 )
00356         labelValue = 0.0;
00357 }

void calculateOverlap int  i,
int  first,
int  last,
int  measure,
bool  isBarDiagram,
int &  firstOverlap,
int &  lastOverlap
[static]
 

Definition at line 981 of file KDChartCartesianAxis.cpp.

Referenced by KDChart::CartesianAxis::maximumSize().

00985 {
00986     if( i == first ){
00987         if( isBarDiagram ){
00988             //TODO(khz): Calculate the amount of left overlap
00989             //           for bar diagrams.
00990         }else{
00991             firstOverlap = measure / 2;
00992         }
00993     }
00994     // we test both bounds in on go: first and last might be equal
00995     if( i == last ){
00996         if( isBarDiagram ){
00997             //TODO(khz): Calculate the amount of right overlap
00998             //           for bar diagrams.
00999         }else{
01000             lastOverlap = measure / 2;
01001         }
01002     }
01003 }

bool referenceDiagramIsBarDiagram const AbstractDiagram diagram  )  [static]
 

Definition at line 360 of file KDChartCartesianAxis.cpp.

References KDChart::AbstractCartesianDiagram::referenceDiagram().

Referenced by KDChart::CartesianAxis::maximumSize(), and KDChart::CartesianAxis::paintCtx().

00361 {
00362     const AbstractCartesianDiagram * dia =
00363             qobject_cast< const AbstractCartesianDiagram * >( diagram );
00364     if( dia && dia->referenceDiagram() )
00365         dia = dia->referenceDiagram();
00366     return qobject_cast< const BarDiagram* >( dia ) != 0;
00367 }


Generated on Thu May 10 11:06:27 2007 for KD Chart 2 by doxygen 1.3.6