ScatterDraw_Demo: Included new legend table

git-svn-id: svn://ultimatepp.org/upp/trunk@6757 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
koldo 2014-01-11 13:44:32 +00:00
parent 404773ae9e
commit 1320827163

View file

@ -13,20 +13,21 @@ CONSOLE_APP_MAIN
ScatterDraw scatter; ScatterDraw scatter;
Vector<Pointf> s1; Vector<Pointf> s1;
s1 << Pointf(10,14) << Pointf(20,25) << Pointf(30,29) << Pointf(40,24) << Pointf(50,36); s1 << Pointf(10,14) << Pointf(20,25) << Pointf(30,29) << Pointf(40,24) << Pointf(50,36);
scatter.AddSeries(s1).Legend("Series 1").NoMark(); scatter.AddSeries(s1).Legend("Series 1").NoMark().Units("ºC", "seg");
double x[] = {20, 30, 40, 50, 60}; double x[] = {20, 30, 40, 50, 60};
double y[] = {34, 45, 49, 44, 56}; double y[] = {34, 45, 49, 44, 56};
scatter.AddSeries(x, y, 5).Legend("Series 2").Stroke(5, Null).Dash(LINE_DASHED) scatter.AddSeries(x, y, 5).Units("ºC", "seg").Legend("Series 2").Stroke(5, Null)
.MarkStyle<SquareMarkPlot>().MarkWidth(12); .Dash(LINE_DASHED).MarkStyle<SquareMarkPlot>().MarkWidth(12);
scatter.FitToData(); scatter.FitToData();
scatter.SetTitle("ScatterDraw_Demo").SetTitleFont(SansSerif(14).Bold()); scatter.SetTitle("ScatterDraw_Demo").SetTitleFont(SansSerif(14).Bold());
scatter.SetLabelY("Temperature [C]").SetLabelX("Time [sec]").SetLabelsFont(SansSerif(12)); scatter.SetLabelY("Temperature").SetLabelX("Time").SetLabelsFont(SansSerif(12));
scatter.SetPlotAreaLeftMargin(40).SetPlotAreaRightMargin(30).SetPlotAreaTopMargin(40).SetPlotAreaBottomMargin(50); scatter.SetPlotAreaLeftMargin(40).SetPlotAreaRightMargin(30).SetPlotAreaTopMargin(40).SetPlotAreaBottomMargin(50);
scatter.SetSize(Size(1000, 500)); scatter.SetSize(Size(1000, 500));
scatter.SetMode(ScatterDraw::MD_ANTIALIASED); scatter.SetMode(ScatterDraw::MD_ANTIALIASED);
//scatter.SetLegendAnchor(ScatterDraw::LEGEND_ANCHOR_RIGHT_TOP);
String fileName = AppendFileName(GetDesktopFolder(), "Scatter.png"); String fileName = AppendFileName(GetDesktopFolder(), "Scatter.png");
PNGEncoder().SaveFile(fileName, scatter.GetImage()); PNGEncoder().SaveFile(fileName, scatter.GetImage());