26 lines
691 B
C++
26 lines
691 B
C++
#include "polarbarchart.h"
|
|
#include <QApplication>
|
|
|
|
int main(int argc, char* argv[])
|
|
{
|
|
QApplication app(argc, argv);
|
|
|
|
PolarBarChart chart;
|
|
chart.setTitle(u8"极坐标柱状图示例");
|
|
chart.setDirectMarkerFlag(true);
|
|
// 设置示例数据(角度-半径对)
|
|
QVector<QPointF> samples;
|
|
samples << QPointF(0, 30) // 0 度方向,半径 30
|
|
<< QPointF(45, 50) // 45 度方向,半径 50
|
|
<< QPointF(90, 80) // 90 度方向,半径 80
|
|
<< QPointF(180, 40); // 180 度方向,半径 40
|
|
|
|
|
|
chart.setData(samples);
|
|
chart.setBarColor(Qt::darkGreen);
|
|
chart.resize(600, 500);
|
|
|
|
chart.show();
|
|
|
|
return app.exec();
|
|
} |