##// END OF EJS Templates
First version of legend. Simple markers and serie names. Using drilldown as example for now.
First version of legend. Simple markers and serie names. Using drilldown as example for now.

File last commit:

r476:b6fb05e4e56f
r529:73dc1554f5c7
Show More
linechartitem_p.h
54 lines | 1.1 KiB | text/x-c | CLexer
#ifndef LINECHARTITEM_H
#define LINECHARTITEM_H
#include "qchartglobal.h"
#include "xychartitem_p.h"
#include "xychartanimationitem_p.h"
#include <QPen>
QTCOMMERCIALCHART_BEGIN_NAMESPACE
class ChartPresenter;
class QLineSeries;
class LineChartItem : public XYChartItem
{
Q_OBJECT
public:
explicit LineChartItem(QLineSeries* series,QGraphicsItem *parent = 0);
~ LineChartItem(){};
//from QGraphicsItem
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
QPainterPath shape() const;
void setLinePen(const QPen& pen);
void setPointsVisible(bool visible);
public slots:
void handleUpdated();
protected:
virtual void setGeometry(QVector<QPointF>& points);
private:
void createPoints(int count);
void deletePoints(int count);
private:
QLineSeries* m_series;
QGraphicsItemGroup m_items;
QPainterPath m_path;
QRectF m_rect;
QPen m_pen;
template<class,class> friend class XYChartAnimator;
};
typedef XYChartAnimationItem<LineChartItem,QLineSeries> LineChartAnimationItem;
QTCOMMERCIALCHART_END_NAMESPACE
#endif