CustomplotHead.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. #ifndef CUSTOMPLOTHEAD_H
  2. #define CUSTOMPLOTHEAD_H
  3. #include "QCustomPlot.h"
  4. #include "qlayout.h"
  5. #pragma execution_character_set("utf-8")
  6. #ifndef TIMEMS
  7. #define TIMEMS qPrintable(QTime::currentTime().toString("HH:mm:ss zzz"))
  8. #endif
  9. #include <QVector>
  10. #include <QColor>
  11. #include <QList>
  12. #include <QStringList>
  13. //重新定义一些数据类型
  14. typedef QList<QColor> lcolor;
  15. typedef QVector<QPointF> vpoint;
  16. typedef QVector<QString> vstring;
  17. typedef QVector<double> vdouble;
  18. typedef QList<QVector<double> > lvdouble;
  19. typedef QList<QStringList> lstringl;
  20. //线条数据结构体
  21. struct LineData {
  22. int index; //画布索引
  23. QString name; //画布名称
  24. vdouble key; //X轴数据
  25. vdouble value; //Y轴数据
  26. vpoint points; //数据点集合 就是XY轴数据合并的点
  27. int lineWidth; //线条宽度
  28. QColor lineColor; //线条颜色
  29. int dataWidth; //数据点宽度
  30. QColor dataColor; //数据点颜色
  31. int lineStyle; //线条样式
  32. int scatterShape; //数据形状
  33. int fillColor; //填充画布形成面积图 0-不填充 1-单色填充 2-渐变填充
  34. int smoothType; //平滑算法类型
  35. bool drawValue; //绘制对应的值
  36. bool autoScale; //坐标轴自动缩放
  37. LineData() {
  38. index = 0;
  39. name = "";
  40. lineWidth = 3;
  41. lineColor = "darkorange";
  42. dataWidth = 6;
  43. dataColor = "white";
  44. lineStyle = 1;
  45. scatterShape = 4;
  46. fillColor = 0;
  47. smoothType = 0;
  48. drawValue = false;
  49. autoScale = false;
  50. }
  51. };
  52. #endif // CUSTOMPLOTHEAD_H