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;
40 virtual NumericItem *clone()
const {
41 return new NumericItem();
44 virtual void setData(
const boost::any &data,
int role =
UserRole) {
50 double d = strtod(s.c_str(), &endptr);
69 std::ifstream f(fname.c_str());
74 for (
int row = 0; row < model->
rowCount(); ++row)
75 for (
int col = 0; col < model->
columnCount(); ++col) {
93 error.arg(fname,
UTF8);
94 new WText(error, parent);
103 new WText(WString::tr(
"introduction"),
this);
114 new WText(WString::tr(
"category chart"),
this);
117 = readCsvFile(WApplication::appRoot() +
"category.csv",
this);
140 if (WApplication::instance()->environment().ajax()) {
141 table->
resize(600, 20 + 5*22);
144 table->
resize(600, WLength::Auto);
194 new WText(WString::tr(
"scatter plot"),
this);
197 WApplication::appRoot() +
"timeseries.csv",
this);
205 for (
int i = 0; i < model->
rowCount(); ++i) {
207 WDate d = WDate::fromString(s,
"dd/MM/yy");
229 if (WApplication::instance()->environment().ajax()) {
230 table->
resize(800, 20 + 5*22);
233 table->
resize(800, 20 + 5*22 + 25);
266 for (
int i = 1; i < 3; ++i) {
283 new WText(WString::tr(
"scatter plot 2"),
this);
290 for (
unsigned i = 0; i < 40; ++i) {
291 double x = (
static_cast<double>(i) - 20) / 4;
333 new WText(WString::tr(
"pie chart"),
this);
367 for (
int row = 0; row < model->
rowCount(); ++row)
368 for (
int col = 0; col < model->
columnCount(); ++col)
381 if (WApplication::instance()->environment().ajax()) {
382 table->
resize(150 + 100 + 14, 20 + 6 * 22);
385 table->
resize(150 + 100 + 14, WLength::Auto);