mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-10-06 00:30:10 -06:00
ScatterCtrl_Demo: Improvements in multiseries and other
git-svn-id: svn://ultimatepp.org/upp/trunk@8800 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
fb4e0f9e30
commit
59215a1315
5 changed files with 17 additions and 14 deletions
|
|
@ -222,7 +222,7 @@ public:
|
|||
|
||||
private:
|
||||
Vector<Vector <double> > s1;
|
||||
Vector<int> idsBall;
|
||||
Vector<int> idsBubble;
|
||||
};
|
||||
|
||||
class TabPie : public WithTabPie<StaticRect> {
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ LAYOUT(Tab13, 420, 236)
|
|||
END_LAYOUT
|
||||
|
||||
LAYOUT(TabRangePlot, 420, 236)
|
||||
ITEM(ScatterCtrl, scatter, SetTitle(t_("Range Plot")).SetPlotAreaLeftMargin(40).SetPlotAreaTopMargin(20).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).HSizePosZ(4, 4).VSizePosZ(4, 4))
|
||||
ITEM(ScatterCtrl, scatter, SetTitle(t_("Range Plot")).SetPlotAreaLeftMargin(40).SetPlotAreaTopMargin(20).SetPlotAreaBottomMargin(40).SetLabelsFont(StdFontZ(11)).SetTitleFont(SansSerifZ(14).Bold()).HSizePosZ(4, 4).VSizePosZ(4, 4))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(TabBubblePlot, 420, 236)
|
||||
|
|
|
|||
|
|
@ -45,10 +45,12 @@ private:
|
|||
}
|
||||
|
||||
public:
|
||||
void Paint(Draw &p, const int& scale, const Point& cp, const double& size, const Color& markColor) const {
|
||||
void Paint(Draw &p, const int& scale, const Point& cp, const double& size, const Color& markColor,
|
||||
const double&, const Color&) const {
|
||||
DoPaint(p, scale, cp, size, markColor);
|
||||
}
|
||||
void Paint(Painter &p, const int& scale, const Point& cp, const double& size, const Color& markColor) const {
|
||||
void Paint(Painter &p, const int& scale, const Point& cp, const double& size, const Color& markColor,
|
||||
const double&, const Color&) const {
|
||||
DoPaint(p, scale, cp, size, markColor);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -8,17 +8,18 @@ void TabRangePlot::Init()
|
|||
|
||||
scatter.SetMouseHandling(true, true).ShowContextMenu();
|
||||
|
||||
for (double size = 0; size <= 10; size += 2.) {
|
||||
for (double time = 0; time <= 10; time += 2.) {
|
||||
Vector<double> &data = s1.Add();
|
||||
double val = size * 10.;
|
||||
data << size << val << (val - 10) << (val - 4) << (val + 4) << (val + 10);
|
||||
double size = time * 10.;
|
||||
data << time << ((size - 10) + Random(50)) << ((size - 4) + Random(50)) <<
|
||||
((size + 4) + Random(50)) << ((size + 10) + Random(50));
|
||||
}
|
||||
idsRange << 2 << 3 << 4 << 5;
|
||||
idsRange << 1 << 2 << 3 << 4;
|
||||
static Vector<int> idVoid;
|
||||
scatter.AddSeries(s1, 1, 0, idsRange, idVoid, idVoid).Legend("Time").Units("sec")
|
||||
.MarkStyle<RangePlot>(RangePlot::MIN_AVG_MAX).NoPlot();
|
||||
scatter.AddSeries(s1, 0, Null, idVoid, idsRange, idVoid).Legend("Size").Units("m")
|
||||
.MarkStyle<RangePlot>(RangePlot::MIN_AVG_MAX);//.NoPlot();
|
||||
|
||||
scatter.SetLabelY("Size");
|
||||
scatter.SetLabelY("Size").SetLabelX("time [seg]");
|
||||
scatter.FitToData(true, 0.2);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ void TabBubblePlot::Init()
|
|||
|
||||
for (double size = 0; size <= 10; size += 2.) {
|
||||
Vector<double> &data = s1.Add();
|
||||
data << size << 10 + 50*sin(size/M_PI) << size*4 + 4;
|
||||
data << size << (10 + 10*Random(30)*size) << Random(80);
|
||||
}
|
||||
idsBall << 2;
|
||||
idsBubble << 2;
|
||||
static Vector<int> idVoid;
|
||||
scatter.AddSeries(s1, 1, 0, idVoid, idVoid, idsBall).Legend("Importance").MarkStyle<BubblePlot>()
|
||||
scatter.AddSeries(s1, 0, 1, idVoid, idVoid, idsBubble).Legend("Importance").MarkStyle<BubblePlot>()
|
||||
.NoPlot().MarkColor(Green()).MarkBorderColor(LtRed()).MarkBorderWidth(3);
|
||||
|
||||
scatter.SetLabelY("Size");
|
||||
|
|
|
|||
Loading…
Reference in a new issue