14 #include <Wt/WApplication>
16 #include <Wt/WEnvironment>
17 #include <Wt/WItemDelegate>
18 #include <Wt/WStandardItemModel>
21 #include <Wt/WBorderLayout>
22 #include <Wt/WFitLayout>
24 #include <Wt/WStandardItem>
25 #include <Wt/WTableView>
27 #include <Wt/Chart/WCartesianChart>
28 #include <Wt/Chart/WPieChart>
31 using namespace Wt::Chart;
41 std::ifstream f(fname.c_str());
46 for (
int row = 0; row < model->
rowCount(); ++row)
47 for (
int col = 0; col < model->
columnCount(); ++col) {
65 error.arg(fname,
UTF8);
66 new WText(error, parent);
75 new WText(WString::tr(
"introduction"),
this);
86 new WText(WString::tr(
"category chart"),
this);
89 = readCsvFile(WApplication::appRoot() +
"category.csv",
this);
112 if (WApplication::instance()->environment().ajax()) {
113 table->
resize(600, 20 + 5*22);
116 table->
resize(600, WLength::Auto);
166 new WText(WString::tr(
"scatter plot"),
this);
169 WApplication::appRoot() +
"timeseries.csv",
this);
177 for (
int i = 0; i < model->
rowCount(); ++i) {
179 WDate d = WDate::fromString(s,
"dd/MM/yy");
201 if (WApplication::instance()->environment().ajax()) {
202 table->
resize(800, 20 + 5*22);
205 table->
resize(800, 20 + 5*22 + 25);
238 for (
int i = 1; i < 3; ++i) {
255 new WText(WString::tr(
"scatter plot 2"),
this);
261 for (
unsigned i = 0; i < 40; ++i) {
262 double x = (
static_cast<double>(i) - 20) / 4;
304 new WText(WString::tr(
"pie chart"),
this);
337 for (
int row = 0; row < model->
rowCount(); ++row)
338 for (
int col = 0; col < model->
columnCount(); ++col)
351 if (WApplication::instance()->environment().ajax()) {
352 table->
resize(150 + 100 + 14, 20 + 6 * 22);
355 table->
resize(150 + 100 + 14, WLength::Auto);