本文整理汇总了C++中Series::SetData方法的典型用法代码示例。如果您正苦于以下问题:C++ Series::SetData方法的具体用法?C++ Series::SetData怎么用?C++ Series::SetData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Series
的用法示例。
在下文中一共展示了Series::SetData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoTest
bool TestPlotWithArea::DoTest()
{
Plot *plot;
plot = new Plot();
Area *area = new Area2D();
Box *box1, *box2;
box1 = new Box(plot);
box2 = new Box(plot);
Series *series;
series = new Series2D("Series");
DataTyped<int> *xdata;
xdata = new DataTyped<int>();
series->SetData(xdata, AXIS_X);
area->AddSeries(series);
plot->AddArea(area);
delete box1;
delete plot;
return true;
}
示例2:
bool TestSeries2DwithData::DoTest()
{
Series *serie;
serie = new Series2D("new series");
DataNoType *xdata, *ydata;
xdata = new DataTyped<double>(100, "x-data");
ydata = new DataTyped<double>(100, "y-data");
serie->SetData(xdata, AXIS_X);
serie->SetData(ydata, AXIS_Y);
//delete ydata;
delete xdata;
delete serie;
return true;
}
示例3: Plot
// plot a new curve, if a figure of the specified figure name already exists,
// the curve will be plot on that figure; if not, a new figure will be created.
void PlotManager::Plot(const string figure_name, const float *p, int count, int step,
int R, int G, int B)
{
if (count < 1)
return;
if (step <= 0)
step = 1;
// copy data and create a series format.
float *data_copy = new float[count];
for (int i = 0; i < count; i++)
*(data_copy + i) = *(p + step * i);
Series s;
s.SetData(count, data_copy);
if ((R > 0) || (G > 0) || (B > 0))
s.SetColor(R, G, B, false);
// search the named window and create one if none was found
active_figure = FindFigure(figure_name);
if ( active_figure == NULL)
{
Figure new_figure(figure_name);
figure_list.push_back(new_figure);
active_figure = FindFigure(figure_name);
if (active_figure == NULL)
exit(-1);
}
active_series = active_figure->Add(s);
active_figure->Show();
}