mirror of
https://github.com/QtExcel/QXlsx.git
synced 2025-01-30 05:02:52 +08:00
update chartsquestions example
This commit is contained in:
parent
c9c8a54820
commit
d273ce7159
@ -5,6 +5,7 @@
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QDebug>
|
||||||
|
|
||||||
#include "sat_calc.h"
|
#include "sat_calc.h"
|
||||||
|
|
||||||
@ -145,17 +146,23 @@ void sat_calc::generate_report()
|
|||||||
chrom_data_array += ":B" + QString::number(output_line_count - 1);
|
chrom_data_array += ":B" + QString::number(output_line_count - 1);
|
||||||
|
|
||||||
Chart * Crom = output.insertChart( 3, 5, QSize(600, 500) );
|
Chart * Crom = output.insertChart( 3, 5, QSize(600, 500) );
|
||||||
Crom->setChartType( Chart::CT_Scatter );
|
Crom->setChartType( Chart::CT_ScatterChart );
|
||||||
Crom->addSeries( CellRange(chrom_data_array) );
|
Crom->addSeries( CellRange(chrom_data_array) );
|
||||||
Crom->setAxisTitle( Chart::Left, QString("left title") ); // dev24
|
Crom->setAxisTitle( Chart::Left, QString("left title") );
|
||||||
Crom->setAxisTitle( Chart::Bottom, QString("bottom title") ); // dev24
|
Crom->setAxisTitle( Chart::Bottom, QString("bottom title") );
|
||||||
Crom->setChartTitle( QString("hello chart") ); // dev25
|
Crom->setChartTitle( QString("hello chart") );
|
||||||
|
|
||||||
qDebug() << "[debug] chrom_data_array : " << chrom_data_array;
|
qDebug() << "[debug] chrom_data_array : " << chrom_data_array;
|
||||||
|
|
||||||
output.saveAs(report_file);
|
output.saveAs(report_file);
|
||||||
input.close();
|
input.close();
|
||||||
|
|
||||||
|
Document doc2(report_file);
|
||||||
|
if (doc2.load())
|
||||||
|
{
|
||||||
|
doc2.saveAs("doc2.xlsx");
|
||||||
|
}
|
||||||
|
|
||||||
QMessageBox msgBox;
|
QMessageBox msgBox;
|
||||||
msgBox.setText("Success to write a xlsx file.");
|
msgBox.setText("Success to write a xlsx file.");
|
||||||
msgBox.exec();
|
msgBox.exec();
|
||||||
|
@ -2,11 +2,12 @@
|
|||||||
# sat_gui.pro
|
# sat_gui.pro
|
||||||
#
|
#
|
||||||
# Copyright (c) 2018 edosad(github) All rights reserved.
|
# Copyright (c) 2018 edosad(github) All rights reserved.
|
||||||
# Some code is fixed by j2doll.
|
#
|
||||||
|
# Some code is fixed by j2doll(github)
|
||||||
|
|
||||||
QT += core gui
|
QT += core
|
||||||
|
QT += gui
|
||||||
# greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
|
QT += widgets
|
||||||
|
|
||||||
TARGET = sat_gui
|
TARGET = sat_gui
|
||||||
TEMPLATE = app
|
TEMPLATE = app
|
||||||
|
Loading…
x
Reference in New Issue
Block a user