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:
koldo 2015-08-07 23:00:32 +00:00
commit 59215a1315
5 changed files with 17 additions and 14 deletions

View file

@ -222,7 +222,7 @@ public:
private:
Vector<Vector <double> > s1;
Vector<int> idsBall;
Vector<int> idsBubble;
};
class TabPie : public WithTabPie<StaticRect> {

View file

@ -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)

View file

@ -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);
}
};

View file

@ -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);
}

View file

@ -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");