#ifndef CCTRLGRAPHCHARTOPENGL_H
#define CCTRLGRAPHCHARTOPENGL_H

#include <QDate>
#include "cctrlgraphopengl.h"
typedef struct _Chart_Data
{
    QPointF pt;
    QColor color;
    _Chart_Data()
    {
        pt=QPointF(0,0);
        color=QRgb(0x0000ff00);
    }
    _Chart_Data( QPointF pt1, QColor color1)
    {
        pt=pt1;
        color=color1;
    }

}Chart_Data;

typedef QMMutexVector<Chart_Data> Chart_Data_Vector;
class CTRLS_GRAPH_EXPORT CCtrlGraph_Chart : public CCtrlGraphOpenGL
{
    Q_OBJECT
public:
    void initializeGL() Q_DECL_OVERRIDE;
    void resizeGL(int w, int h) Q_DECL_OVERRIDE;
    void paintGL() Q_DECL_OVERRIDE;
    explicit CCtrlGraph_Chart(QWidget *parent = 0);
    void MInit();
    Chart_Data_Vector m_ptVector;
    bool m_bshowText;
    void refreshPixmap(bool bupdate=true);
    void draw_Coord(QPainter &painter);
    QRectF DrawCoordBar(Chart_Data& data,
                        QPainter &painter);
    void DrawCoordText(QRectF& rect,
                       Chart_Data& data,
                       QPainter &painter);
    void  init_rectWindow();
    QString MakeCoordText(double dPos, bool bX=true);
    QDate m_StartDate;
    int m_iPrecise;
protected:
     void updaterubberBandRect();
signals:

public slots:
};

#endif // CCTRLGRAPHCHARTOPENGL_H
