Wt examples: charts/ChartConfig.h Source File

Wt examples 4.10.4

Loading...
Searching...
No Matches
ChartConfig.h
Go to the documentation of this file.
1// This may look like C code, but it's really -*- C++ -*-
2/*
3 * Copyright (C) 2008 Emweb bv, Herent, Belgium.
4 *
5 * See the LICENSE file for terms of use.
6 */
7#ifndef CHART_CONFIG_H_
8#define CHART_CONFIG_H_
9
10#include <Wt/WContainerWidget.h>
11#include <Wt/Chart/WDataSeries.h>
12
13namespace Wt {
14 class WCheckBox;
15 class WComboBox;
16 class WFormWidget;
17 class WLineEdit;
18 class WStandardItemModel;
19 class WTable;
20 class WValidator;
21
22 namespace Chart {
23 class WAxis;
24 class WCartesianChart;
25 }
26}
27
32
40 class ChartConfig : public Wt::WContainerWidget
41{
42public:
45 ChartConfig(Wt::Chart::WCartesianChart *chart);
46
47 void setValueFill(Wt::Chart::FillRangeType fill);
48
49private:
50 Wt::Chart::WCartesianChart *chart_;
51 Wt::Chart::FillRangeType fill_;
52
54 struct SeriesControl {
55 Wt::WCheckBox *enabledEdit;
56 Wt::WComboBox *typeEdit;
57 Wt::WComboBox *markerEdit;
58 Wt::WComboBox *xAxisEdit;
59 Wt::WComboBox *yAxisEdit;
60 Wt::WCheckBox *legendEdit;
61 Wt::WCheckBox *shadowEdit;
62 Wt::WComboBox *labelsEdit;
63 };
64
66 std::vector<SeriesControl> seriesControls_;
67
69 struct AxisControl {
70 Wt::WCheckBox *visibleEdit;
71 Wt::WComboBox *scaleEdit;
72 Wt::WCheckBox *autoEdit;
73 Wt::WLineEdit *minimumEdit;
74 Wt::WLineEdit *maximumEdit;
75 Wt::WCheckBox *gridLinesEdit;
76 Wt::WLineEdit *labelAngleEdit;
77 Wt::WLineEdit *titleEdit;
78 Wt::WComboBox *titleOrientationEdit;
79 Wt::WComboBox *tickDirectionEdit;
80 Wt::WComboBox *locationEdit;
81 };
82
84 std::vector<AxisControl> axisControls_;
85
86 Wt::WLineEdit *titleEdit_;
87 Wt::WLineEdit *chartWidthEdit_;
88 Wt::WLineEdit *chartHeightEdit_;
89 Wt::WComboBox *chartOrientationEdit_;
90 Wt::WComboBox *legendLocationEdit_;
91 Wt::WComboBox *legendSideEdit_;
92 Wt::WComboBox *legendAlignmentEdit_;
93 Wt::WCheckBox *borderEdit_;
94
95 std::shared_ptr<Wt::WStandardItemModel> xAxesModel_, yAxesModel_, xScales_, yScales_;
96 Wt::WTable *axisConfig_;
97 std::shared_ptr<Wt::WValidator> anyNumberValidator_, angleValidator_;
98
99 void connectSignals(Wt::WFormWidget *w);
100 void update();
101 void addXAxis();
102 void addYAxis();
103 void addAxis(Wt::Chart::Axis axis, int axisId);
104 void removeXAxis(const Wt::Chart::WAxis *axis);
105 void removeYAxis(const Wt::Chart::WAxis *axis);
106 void clearXAxes();
107 void clearYAxes();
108
109 static bool validate(Wt::WFormWidget *w);
110};
111
114#endif // CHARTS_EXAMPLE_H_
ChartConfig
A class that allows configuration of a cartesian chart.
Definition ChartConfig.h:41
ChartConfig::seriesControls_
std::vector< SeriesControl > seriesControls_
Controls for series.
Definition ChartConfig.h:66
ChartConfig::addAxis
void addAxis(Wt::Chart::Axis axis, int axisId)
Definition ChartConfig.C:692
ChartConfig::legendAlignmentEdit_
Wt::WComboBox * legendAlignmentEdit_
Definition ChartConfig.h:92
ChartConfig::legendLocationEdit_
Wt::WComboBox * legendLocationEdit_
Definition ChartConfig.h:90
ChartConfig::angleValidator_
std::shared_ptr< Wt::WValidator > angleValidator_
Definition ChartConfig.h:97
ChartConfig::axisConfig_
Wt::WTable * axisConfig_
Definition ChartConfig.h:96
ChartConfig::legendSideEdit_
Wt::WComboBox * legendSideEdit_
Definition ChartConfig.h:91
ChartConfig::removeXAxis
void removeXAxis(const Wt::Chart::WAxis *axis)
Definition ChartConfig.C:794
ChartConfig::anyNumberValidator_
std::shared_ptr< Wt::WValidator > anyNumberValidator_
Definition ChartConfig.h:97
ChartConfig::setValueFill
void setValueFill(Wt::Chart::FillRangeType fill)
Definition ChartConfig.C:393
ChartConfig::chartWidthEdit_
Wt::WLineEdit * chartWidthEdit_
Definition ChartConfig.h:87
ChartConfig::titleEdit_
Wt::WLineEdit * titleEdit_
Definition ChartConfig.h:86
ChartConfig::removeYAxis
void removeYAxis(const Wt::Chart::WAxis *axis)
Definition ChartConfig.C:808
ChartConfig::addYAxis
void addYAxis()
Definition ChartConfig.C:683
ChartConfig::xAxesModel_
std::shared_ptr< Wt::WStandardItemModel > xAxesModel_
Definition ChartConfig.h:95
ChartConfig::validate
static bool validate(Wt::WFormWidget *w)
Definition ChartConfig.C:655
ChartConfig::connectSignals
void connectSignals(Wt::WFormWidget *w)
Definition ChartConfig.C:667
ChartConfig::chart_
Wt::Chart::WCartesianChart * chart_
Definition ChartConfig.h:50
ChartConfig::axisControls_
std::vector< AxisControl > axisControls_
Controls for axes.
Definition ChartConfig.h:84
ChartConfig::clearYAxes
void clearYAxes()
Definition ChartConfig.C:839
ChartConfig::ChartConfig
ChartConfig(Wt::Chart::WCartesianChart *chart)
Constructor.
Definition ChartConfig.C:76
ChartConfig::xScales_
std::shared_ptr< Wt::WStandardItemModel > xScales_
Definition ChartConfig.h:95
ChartConfig::clearXAxes
void clearXAxes()
Definition ChartConfig.C:822
ChartConfig::fill_
Wt::Chart::FillRangeType fill_
Definition ChartConfig.h:51
ChartConfig::addXAxis
void addXAxis()
Definition ChartConfig.C:674
ChartConfig::update
void update()
Definition ChartConfig.C:398
ChartConfig::borderEdit_
Wt::WCheckBox * borderEdit_
Definition ChartConfig.h:93
ChartConfig::chartHeightEdit_
Wt::WLineEdit * chartHeightEdit_
Definition ChartConfig.h:88
ChartConfig::yAxesModel_
std::shared_ptr< Wt::WStandardItemModel > yAxesModel_
Definition ChartConfig.h:95
ChartConfig::chartOrientationEdit_
Wt::WComboBox * chartOrientationEdit_
Definition ChartConfig.h:89
ChartConfig::yScales_
std::shared_ptr< Wt::WStandardItemModel > yScales_
Definition ChartConfig.h:95
Wt
Definition AddresseeEdit.h:16
ChartConfig::AxisControl
Struct that holds the controls for one axis.
Definition ChartConfig.h:69
ChartConfig::AxisControl::maximumEdit
Wt::WLineEdit * maximumEdit
Definition ChartConfig.h:74
ChartConfig::AxisControl::tickDirectionEdit
Wt::WComboBox * tickDirectionEdit
Definition ChartConfig.h:79
ChartConfig::AxisControl::titleEdit
Wt::WLineEdit * titleEdit
Definition ChartConfig.h:77
ChartConfig::AxisControl::labelAngleEdit
Wt::WLineEdit * labelAngleEdit
Definition ChartConfig.h:76
ChartConfig::AxisControl::titleOrientationEdit
Wt::WComboBox * titleOrientationEdit
Definition ChartConfig.h:78
ChartConfig::AxisControl::gridLinesEdit
Wt::WCheckBox * gridLinesEdit
Definition ChartConfig.h:75
ChartConfig::AxisControl::minimumEdit
Wt::WLineEdit * minimumEdit
Definition ChartConfig.h:73
ChartConfig::AxisControl::locationEdit
Wt::WComboBox * locationEdit
Definition ChartConfig.h:80
ChartConfig::AxisControl::scaleEdit
Wt::WComboBox * scaleEdit
Definition ChartConfig.h:71
ChartConfig::AxisControl::visibleEdit
Wt::WCheckBox * visibleEdit
Definition ChartConfig.h:70
ChartConfig::AxisControl::autoEdit
Wt::WCheckBox * autoEdit
Definition ChartConfig.h:72
ChartConfig::SeriesControl
Struct that holds the controls for one series.
Definition ChartConfig.h:54
ChartConfig::SeriesControl::markerEdit
Wt::WComboBox * markerEdit
Definition ChartConfig.h:57
ChartConfig::SeriesControl::labelsEdit
Wt::WComboBox * labelsEdit
Definition ChartConfig.h:62
ChartConfig::SeriesControl::enabledEdit
Wt::WCheckBox * enabledEdit
Definition ChartConfig.h:55
ChartConfig::SeriesControl::legendEdit
Wt::WCheckBox * legendEdit
Definition ChartConfig.h:60
ChartConfig::SeriesControl::shadowEdit
Wt::WCheckBox * shadowEdit
Definition ChartConfig.h:61
ChartConfig::SeriesControl::typeEdit
Wt::WComboBox * typeEdit
Definition ChartConfig.h:56
ChartConfig::SeriesControl::xAxisEdit
Wt::WComboBox * xAxisEdit
Definition ChartConfig.h:58
ChartConfig::SeriesControl::yAxisEdit
Wt::WComboBox * yAxisEdit
Definition ChartConfig.h:59