feat:完成柱状图的基本绘制
This commit is contained in:
parent
d4c24d364f
commit
605b8dd190
|
|
@ -7,8 +7,8 @@ dpBarsChart::dpBarsChart(QWidget* parent)
|
||||||
setAttribute(Qt::WA_TranslucentBackground,true);
|
setAttribute(Qt::WA_TranslucentBackground,true);
|
||||||
|
|
||||||
m_pCustomPlot = new QCustomPlot(this);
|
m_pCustomPlot = new QCustomPlot(this);
|
||||||
initQCP();
|
|
||||||
m_barsGroup = new QCPBarsGroup(m_pCustomPlot);
|
m_barsGroup = new QCPBarsGroup(m_pCustomPlot);
|
||||||
|
initQCP();
|
||||||
|
|
||||||
QBoxLayout* mainLayout = new QBoxLayout(QBoxLayout::LeftToRight);
|
QBoxLayout* mainLayout = new QBoxLayout(QBoxLayout::LeftToRight);
|
||||||
mainLayout->setContentsMargins(0, 1, 0, 0);
|
mainLayout->setContentsMargins(0, 1, 0, 0);
|
||||||
|
|
@ -37,9 +37,9 @@ void dpBarsChart::initQCP()
|
||||||
/*m_pCustomPlot->axisRect()->setRangeDrag(Qt::Horizontal); //只允许x轴方向的拖拽
|
/*m_pCustomPlot->axisRect()->setRangeDrag(Qt::Horizontal); //只允许x轴方向的拖拽
|
||||||
double zoomFactor = m_pCustomPlot->axisRect()->rangeZoomFactor(Qt::Horizontal);
|
double zoomFactor = m_pCustomPlot->axisRect()->rangeZoomFactor(Qt::Horizontal);
|
||||||
m_pCustomPlot->axisRect()->setRangeZoomFactor(zoomFactor, 1); //只做x轴的缩放*/
|
m_pCustomPlot->axisRect()->setRangeZoomFactor(zoomFactor, 1); //只做x轴的缩放*/
|
||||||
m_pCustomPlot->xAxis->setTicks(false);
|
//m_pCustomPlot->xAxis->setTicks(false);
|
||||||
m_pCustomPlot->xAxis->setSubTicks(false);
|
m_pCustomPlot->xAxis->setSubTicks(false);
|
||||||
m_pCustomPlot->yAxis->setTicks(false);
|
//m_pCustomPlot->yAxis->setTicks(false);
|
||||||
m_pCustomPlot->yAxis->setSubTicks(false);
|
m_pCustomPlot->yAxis->setSubTicks(false);
|
||||||
//m_pCustomPlot->yAxis->setVisible(false);
|
//m_pCustomPlot->yAxis->setVisible(false);
|
||||||
//m_pCustomPlot->yAxis2->setTicks(false);
|
//m_pCustomPlot->yAxis2->setTicks(false);
|
||||||
|
|
@ -92,7 +92,146 @@ void dpBarsChart::viewHistoricalData(const QDateTime& dateTime)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
void dpBarsChart::synchronizeConfigData(const configurationResults& cfg)
|
void dpBarsChart::synchronizeConfigData(const configurationResults& cfg)
|
||||||
{}
|
{
|
||||||
|
//先清除现有图形(直方图不像曲线一样有连续的过程展现,所以不采用动态更新,每次都清除、重新创建)
|
||||||
|
m_pCustomPlot->clearPlottables();
|
||||||
|
m_bars.clear();
|
||||||
|
|
||||||
|
bool groupByType = false;
|
||||||
|
|
||||||
|
//设定朝向
|
||||||
|
QCPAxis* keyAxis = nullptr;
|
||||||
|
QCPAxis* valueAxis = nullptr;
|
||||||
|
if(cfg.barOrientataion == Vertical)
|
||||||
|
{
|
||||||
|
keyAxis = m_pCustomPlot->xAxis;
|
||||||
|
valueAxis = m_pCustomPlot->yAxis;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
keyAxis = m_pCustomPlot->yAxis;
|
||||||
|
valueAxis = m_pCustomPlot->xAxis;
|
||||||
|
}
|
||||||
|
if(!keyAxis && !valueAxis)
|
||||||
|
return;
|
||||||
|
|
||||||
|
QVector<double> ticks;
|
||||||
|
int tick = 0;
|
||||||
|
QVector<QString> tickLabels;
|
||||||
|
|
||||||
|
QHash<RealTimeDataType, QSet<QString>> groupedBars; //按数据类型对bar进行分组,以实现可以按组放置以及设置颜色等操作
|
||||||
|
for(int i = 0; i < cfg.m_pModel_dataSource->rowCount(); i++)
|
||||||
|
{
|
||||||
|
QString itemText = cfg.m_pModel_dataSource->item(i, 0)->text();
|
||||||
|
QString stationID = cfg.m_pModel_dataSource->item(i, 0)->data(Qt::UserRole + itemRole_stationID).toString();
|
||||||
|
QString compoentID = cfg.m_pModel_dataSource->item(i, 0)->data(Qt::UserRole + itemRole_componentID).toString();
|
||||||
|
QString pointID = cfg.m_pModel_dataSource->item(i, 0)->data(Qt::UserRole + itemRole_pointID).toString();
|
||||||
|
QString dataID = stationID + "-" + compoentID + "-" + pointID;
|
||||||
|
QVariant colorData = cfg.m_pModel_dataSource->item(i, 0)->data(Qt::DecorationRole);
|
||||||
|
RealTimeDataType dataType = (RealTimeDataType)cfg.m_pModel_dataSource->item(i, 0)->data(Qt::UserRole + itemRole_dataType).toInt();
|
||||||
|
|
||||||
|
/*QCPBarsGroup* barsGroup = nullptr;
|
||||||
|
if(!m_barsGroups.contains(dataType))
|
||||||
|
{
|
||||||
|
barsGroup = new QCPBarsGroup(m_pCustomPlot);
|
||||||
|
m_barsGroups.insert(dataType, barsGroup);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
barsGroup = m_barsGroups.value(dataType);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(!barsGroup)
|
||||||
|
continue;*/
|
||||||
|
|
||||||
|
Bars bars;
|
||||||
|
bars.name = itemText;
|
||||||
|
bars.dataID = dataID;
|
||||||
|
bars.dataType = dataType;
|
||||||
|
bars.color = colorData.value<QColor>();
|
||||||
|
QCPBars* qBars = new QCPBars(keyAxis, valueAxis);
|
||||||
|
qBars->setName(bars.name);
|
||||||
|
qBars->setPen(bars.color); //边框颜色
|
||||||
|
qBars->setBrush(bars.color); //填充颜色
|
||||||
|
bars.qBars = qBars;
|
||||||
|
|
||||||
|
if(groupByType)
|
||||||
|
groupedBars[dataType].insert(dataID);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ticks << ++tick;
|
||||||
|
tickLabels << itemText;
|
||||||
|
bars.keys << tick;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_bars.insert(dataID, bars);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(groupByType)
|
||||||
|
{
|
||||||
|
for(auto it = groupedBars.begin(); it != groupedBars.end(); ++it)
|
||||||
|
{
|
||||||
|
ticks.push_back(++tick);
|
||||||
|
switch(it.key())
|
||||||
|
{
|
||||||
|
case power:
|
||||||
|
tickLabels.push_back("功率");
|
||||||
|
break;
|
||||||
|
case voltage:
|
||||||
|
tickLabels.push_back("电压");
|
||||||
|
break;
|
||||||
|
case current:
|
||||||
|
tickLabels.push_back("电流");
|
||||||
|
break;
|
||||||
|
case temperature:
|
||||||
|
tickLabels.push_back("温度");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
tickLabels.push_back("未定义");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(auto bars_it = it.value().begin(); bars_it != it.value().end(); ++bars_it)
|
||||||
|
{
|
||||||
|
QString dataID = *bars_it;
|
||||||
|
if(m_bars.contains(dataID))
|
||||||
|
m_bars[dataID].keys.push_back(tick);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QSharedPointer<QCPAxisTickerText> textTicker(new QCPAxisTickerText);
|
||||||
|
textTicker->addTicks(ticks, tickLabels);
|
||||||
|
keyAxis->setTicker(textTicker);
|
||||||
|
keyAxis->setRange(1, ticks.count());
|
||||||
|
if(groupByType)
|
||||||
|
keyAxis->setTickLabels(true);
|
||||||
|
else
|
||||||
|
keyAxis->setTickLabels(false);
|
||||||
|
|
||||||
|
valueAxis->setTickLabels(true);
|
||||||
|
valueAxis->setRange(0, 11);
|
||||||
|
|
||||||
|
for(auto it = m_bars.begin(); it != m_bars.end(); ++it)
|
||||||
|
{
|
||||||
|
if(it.value().qBars.isNull())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//随机模拟值
|
||||||
|
QVector<double> values;
|
||||||
|
double randomVaule = 1 + QRandomGenerator::global()->generateDouble() * (8 - 1);
|
||||||
|
values << randomVaule;
|
||||||
|
|
||||||
|
it.value().qBars->setData(it.value().keys, values);
|
||||||
|
if(groupByType)
|
||||||
|
it.value().qBars->setBarsGroup(m_barsGroup);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Legend
|
||||||
|
m_pCustomPlot->legend->setVisible(cfg.showLegend);
|
||||||
|
|
||||||
|
m_pCustomPlot->replot();
|
||||||
|
}
|
||||||
|
|
||||||
void dpBarsChart::onSignal_dataUpdated(const QString& dataKey, const QVariant& data, const QDateTime& timestamp)
|
void dpBarsChart::onSignal_dataUpdated(const QString& dataKey, const QVariant& data, const QDateTime& timestamp)
|
||||||
{}
|
{}
|
||||||
|
|
|
||||||
|
|
@ -33,11 +33,29 @@ public slots:
|
||||||
void onSignal_dataUpdated(const QString& dataKey, const QVariant& data, const QDateTime& timestamp);
|
void onSignal_dataUpdated(const QString& dataKey, const QVariant& data, const QDateTime& timestamp);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
struct Bars
|
||||||
|
{
|
||||||
|
QColor color;
|
||||||
|
QString name;
|
||||||
|
QString dataID;
|
||||||
|
RealTimeDataType dataType;
|
||||||
|
QVector<double> keys;
|
||||||
|
QPointer<QCPBars> qBars;
|
||||||
|
|
||||||
|
Bars()
|
||||||
|
{
|
||||||
|
name = "";
|
||||||
|
dataID = "";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void initQCP();
|
void initQCP();
|
||||||
|
|
||||||
QCustomPlot* m_pCustomPlot;
|
QCustomPlot* m_pCustomPlot;
|
||||||
ChartStyle m_chartStyle;
|
ChartStyle m_chartStyle;
|
||||||
QCPBarsGroup* m_barsGroup;
|
QCPBarsGroup* m_barsGroup;
|
||||||
|
QHash<QString, Bars> m_bars;
|
||||||
|
//QHash<RealTimeDataType, QCPBarsGroup*> m_barsGroups;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -115,25 +115,6 @@ protected:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Graph
|
|
||||||
{
|
|
||||||
QColor color;
|
|
||||||
RealTimeDataType dataType;
|
|
||||||
//QCPGraph* qGraph;
|
|
||||||
QPointer<QCPGraph> qGraph;
|
|
||||||
|
|
||||||
QString dataID;
|
|
||||||
QString synchronizeTagging; //同步配置数据时的标记,new、update两种,没有的就是要被删除
|
|
||||||
QString name; //用户legend图例展示用
|
|
||||||
|
|
||||||
Graph()
|
|
||||||
{
|
|
||||||
dataID = "";
|
|
||||||
//qGraph = nullptr;
|
|
||||||
synchronizeTagging = "noTagging";
|
|
||||||
name = "";
|
|
||||||
}
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -257,8 +257,8 @@ void dpConfigurationDialog::setPanel(DataPanel* pPanel)
|
||||||
{
|
{
|
||||||
case lineChart:
|
case lineChart:
|
||||||
{
|
{
|
||||||
ui->specialSettings->setCurrentIndex(0);
|
|
||||||
ui->specialSettings->setVisible(true);
|
ui->specialSettings->setVisible(true);
|
||||||
|
ui->specialSettings->setCurrentIndex(0);
|
||||||
ui->axisObject->clear();
|
ui->axisObject->clear();
|
||||||
m_axisCfgMap.clear();
|
m_axisCfgMap.clear();
|
||||||
ui->axisName->setText("");
|
ui->axisName->setText("");
|
||||||
|
|
@ -289,6 +289,11 @@ void dpConfigurationDialog::setPanel(DataPanel* pPanel)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case barChart:
|
case barChart:
|
||||||
|
{
|
||||||
|
ui->specialSettings->setVisible(true);
|
||||||
|
ui->specialSettings->setCurrentIndex(1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
ui->specialSettings->setVisible(false);
|
ui->specialSettings->setVisible(false);
|
||||||
break;
|
break;
|
||||||
|
|
@ -357,7 +362,13 @@ void dpConfigurationDialog::onBtnClicked_confirm()
|
||||||
m_pDataPanel->m_cofigurationResults.dataServiceIP = ui->serviceIP->text();
|
m_pDataPanel->m_cofigurationResults.dataServiceIP = ui->serviceIP->text();
|
||||||
m_pDataPanel->m_cofigurationResults.dataServicePort = ui->servicePort->text().toInt();
|
m_pDataPanel->m_cofigurationResults.dataServicePort = ui->servicePort->text().toInt();
|
||||||
m_pDataPanel->m_cofigurationResults.showLegend = ui->radioBtn_showLegend->isChecked();
|
m_pDataPanel->m_cofigurationResults.showLegend = ui->radioBtn_showLegend->isChecked();
|
||||||
m_pDataPanel->m_cofigurationResults.arrangement = (AxisArrangementMode)ui->axisArrangement->currentIndex();
|
m_pDataPanel->m_cofigurationResults.axisArrangement = (AxisArrangementMode)ui->axisArrangement->currentIndex();
|
||||||
|
|
||||||
|
DataPanelType panelType = m_pDataPanel->getType();
|
||||||
|
switch (panelType)
|
||||||
|
{
|
||||||
|
case lineChart:
|
||||||
|
{
|
||||||
RealTimeDataType itemDataType = (RealTimeDataType)ui->axisObject->currentData().toInt();
|
RealTimeDataType itemDataType = (RealTimeDataType)ui->axisObject->currentData().toInt();
|
||||||
if(m_axisCfgMap.contains(itemDataType))
|
if(m_axisCfgMap.contains(itemDataType))
|
||||||
{
|
{
|
||||||
|
|
@ -365,6 +376,12 @@ void dpConfigurationDialog::onBtnClicked_confirm()
|
||||||
m_axisCfgMap[itemDataType].name = ui->axisName->text();
|
m_axisCfgMap[itemDataType].name = ui->axisName->text();
|
||||||
m_axisCfgMap[itemDataType].unit = ui->axisUnit->text();
|
m_axisCfgMap[itemDataType].unit = ui->axisUnit->text();
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
m_pDataPanel->m_cofigurationResults.axisCfgMap = m_axisCfgMap;
|
m_pDataPanel->m_cofigurationResults.axisCfgMap = m_axisCfgMap;
|
||||||
m_pDataPanel->configurationComplete();
|
m_pDataPanel->configurationComplete();
|
||||||
}
|
}
|
||||||
|
|
@ -401,8 +418,8 @@ void dpConfigurationDialog::onItemClicked_typeSource(const QModelIndex& index)
|
||||||
|
|
||||||
if(!bIsHad && m_pModel_typeSelected)
|
if(!bIsHad && m_pModel_typeSelected)
|
||||||
{
|
{
|
||||||
int nMaximumType = m_pModel_typeSelected->rowCount();
|
int nMaximumType = m_pModel_typeSource->rowCount();
|
||||||
if(m_pDataPanel && (m_pDataPanel->getType() == lineChart || m_pDataPanel->getType() == curveChart))
|
if(m_pDataPanel && (m_pDataPanel->getType() == lineChart || m_pDataPanel->getType() == barChart))
|
||||||
nMaximumType = 4;
|
nMaximumType = 4;
|
||||||
|
|
||||||
if(m_pModel_typeSelected->rowCount() >= nMaximumType)
|
if(m_pModel_typeSelected->rowCount() >= nMaximumType)
|
||||||
|
|
@ -428,8 +445,6 @@ void dpConfigurationDialog::onItemClicked_typeSource(const QModelIndex& index)
|
||||||
switch (panelType)
|
switch (panelType)
|
||||||
{
|
{
|
||||||
case lineChart:
|
case lineChart:
|
||||||
case curveChart:
|
|
||||||
case barChart:
|
|
||||||
{
|
{
|
||||||
AxisCfgInfo cfg;
|
AxisCfgInfo cfg;
|
||||||
cfg.name = item->text();
|
cfg.name = item->text();
|
||||||
|
|
@ -442,6 +457,10 @@ void dpConfigurationDialog::onItemClicked_typeSource(const QModelIndex& index)
|
||||||
connect(ui->axisObject, &QComboBox::currentIndexChanged, this, &dpConfigurationDialog::onComboBoxIndexChanged_axis);
|
connect(ui->axisObject, &QComboBox::currentIndexChanged, this, &dpConfigurationDialog::onComboBoxIndexChanged_axis);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case barChart:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -483,8 +502,6 @@ void dpConfigurationDialog::onBtnClicked_remove_type()
|
||||||
switch (panelType)
|
switch (panelType)
|
||||||
{
|
{
|
||||||
case lineChart:
|
case lineChart:
|
||||||
case curveChart:
|
|
||||||
case barChart:
|
|
||||||
{
|
{
|
||||||
m_axisCfgMap.remove(itemDataType);
|
m_axisCfgMap.remove(itemDataType);
|
||||||
int index = ui->axisObject->findData(itemDataType);
|
int index = ui->axisObject->findData(itemDataType);
|
||||||
|
|
@ -500,6 +517,10 @@ void dpConfigurationDialog::onBtnClicked_remove_type()
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case barChart:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -62,6 +62,7 @@ private:
|
||||||
QStandardItemModel* m_pModel_dataSource;
|
QStandardItemModel* m_pModel_dataSource;
|
||||||
QStandardItemModel* m_pModel_dataSelected;
|
QStandardItemModel* m_pModel_dataSelected;
|
||||||
|
|
||||||
|
//特定配置项
|
||||||
QHash<RealTimeDataType, AxisCfgInfo> m_axisCfgMap;
|
QHash<RealTimeDataType, AxisCfgInfo> m_axisCfgMap;
|
||||||
int m_curAxisComboBoxIndex;
|
int m_curAxisComboBoxIndex;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
enum DataPanelType
|
enum DataPanelType
|
||||||
{
|
{
|
||||||
lineChart = 0, //折线图
|
lineChart = 0, //曲线图
|
||||||
curveChart, //曲线图
|
//curveChart, //曲线图
|
||||||
barChart, //柱状图
|
barChart, //柱状图
|
||||||
dotChart, //点图
|
dotChart, //点图
|
||||||
pieChart, //饼图
|
pieChart, //饼图
|
||||||
|
|
@ -28,6 +28,12 @@ enum AxisArrangementMode //坐标轴排列方式
|
||||||
AllRight //右侧排列
|
AllRight //右侧排列
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum BarOrientation //直方图方向
|
||||||
|
{
|
||||||
|
Horizontal = 0,
|
||||||
|
Vertical
|
||||||
|
};
|
||||||
|
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
struct AxisCfgInfo
|
struct AxisCfgInfo
|
||||||
{
|
{
|
||||||
|
|
@ -41,7 +47,8 @@ struct configurationResults
|
||||||
QString dataServiceIP;
|
QString dataServiceIP;
|
||||||
int dataServicePort;
|
int dataServicePort;
|
||||||
bool showLegend;
|
bool showLegend;
|
||||||
AxisArrangementMode arrangement;
|
AxisArrangementMode axisArrangement;
|
||||||
|
BarOrientation barOrientataion;
|
||||||
QHash<RealTimeDataType, AxisCfgInfo> axisCfgMap; //可能有多个轴(数据类别)
|
QHash<RealTimeDataType, AxisCfgInfo> axisCfgMap; //可能有多个轴(数据类别)
|
||||||
|
|
||||||
configurationResults()
|
configurationResults()
|
||||||
|
|
@ -53,7 +60,8 @@ struct configurationResults
|
||||||
dataServicePort = 1987;
|
dataServicePort = 1987;
|
||||||
|
|
||||||
showLegend = false;
|
showLegend = false;
|
||||||
arrangement = AlternateSides;
|
axisArrangement = AlternateSides;
|
||||||
|
barOrientataion = Vertical;
|
||||||
}
|
}
|
||||||
|
|
||||||
void setModelParent(QObject* parent) //为QStandardItemModel对象构造对象树,从而利用QT的资源自动管理
|
void setModelParent(QObject* parent) //为QStandardItemModel对象构造对象树,从而利用QT的资源自动管理
|
||||||
|
|
|
||||||
|
|
@ -421,7 +421,7 @@ void dpLineChart::synchronizeConfigData(const configurationResults& cfg)
|
||||||
}
|
}
|
||||||
|
|
||||||
//重新排列坐标轴
|
//重新排列坐标轴
|
||||||
m_axisArrangementMode = cfg.arrangement;
|
m_axisArrangementMode = cfg.axisArrangement;
|
||||||
arrangeAxes();
|
arrangeAxes();
|
||||||
|
|
||||||
//2.曲线-数据源决定
|
//2.曲线-数据源决定
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,26 @@ private:
|
||||||
ReassignToOthrer //重新分配到其它坐标轴
|
ReassignToOthrer //重新分配到其它坐标轴
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Graph
|
||||||
|
{
|
||||||
|
QColor color;
|
||||||
|
RealTimeDataType dataType;
|
||||||
|
//QCPGraph* qGraph;
|
||||||
|
QPointer<QCPGraph> qGraph;
|
||||||
|
|
||||||
|
QString dataID;
|
||||||
|
QString synchronizeTagging; //同步配置数据时的标记,new、update两种,没有的就是要被删除
|
||||||
|
QString name; //用户legend图例展示用
|
||||||
|
|
||||||
|
Graph()
|
||||||
|
{
|
||||||
|
dataID = "";
|
||||||
|
//qGraph = nullptr;
|
||||||
|
synchronizeTagging = "noTagging";
|
||||||
|
name = "";
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
void initQCP();
|
void initQCP();
|
||||||
void arrangeAxes();
|
void arrangeAxes();
|
||||||
void reLayoutLegend();
|
void reLayoutLegend();
|
||||||
|
|
|
||||||
|
|
@ -618,17 +618,17 @@ background-color: rgb(24, 32, 38);
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>150</y>
|
<y>155</y>
|
||||||
<width>521</width>
|
<width>521</width>
|
||||||
<height>181</height>
|
<height>121</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>1</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="lineChart">
|
<widget class="QWidget" name="axisCfg">
|
||||||
<property name="styleSheet">
|
<property name="styleSheet">
|
||||||
<string notr="true">QWidget #coordinate
|
<string notr="true">QWidget #axisCfg
|
||||||
{
|
{
|
||||||
background-color:transparent;
|
background-color:transparent;
|
||||||
}</string>
|
}</string>
|
||||||
|
|
@ -751,13 +751,66 @@ background-color:transparent;
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="page_2"/>
|
<widget class="QWidget" name="barsCfg">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QWidget #barsCfg
|
||||||
|
{
|
||||||
|
background-color:transparent;
|
||||||
|
}</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QComboBox" name="barOrientation">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>80</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>91</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>水平方向</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>垂直方向</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
<widget class="QLabel" name="label_barOrientation">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>10</y>
|
||||||
|
<width>71</width>
|
||||||
|
<height>21</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>图形朝向:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QRadioButton" name="groupByType">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>40</y>
|
||||||
|
<width>161</width>
|
||||||
|
<height>31</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>按类型分组</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QRadioButton" name="radioBtn_showLegend">
|
<widget class="QRadioButton" name="radioBtn_showLegend">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>105</y>
|
<y>110</y>
|
||||||
<width>121</width>
|
<width>121</width>
|
||||||
<height>31</height>
|
<height>31</height>
|
||||||
</rect>
|
</rect>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue