Pass label and plot style to the TimeSeries' constructor.

BUG=webrtc:7323

Review-Url: https://codereview.webrtc.org/2750583002
Cr-Commit-Position: refs/heads/master@{#17237}
This commit is contained in:
terelius
2017-03-15 01:59:12 -07:00
committed by Commit bot
parent 5d389dbde0
commit 23c595adba
3 changed files with 65 additions and 91 deletions

View File

@ -28,6 +28,10 @@ struct TimeSeriesPoint {
struct TimeSeries {
TimeSeries() = default;
TimeSeries(const char* label, PlotStyle style)
: label(label), style(style), points() {}
TimeSeries(const std::string& label, PlotStyle style)
: label(label), style(style), points() {}
TimeSeries(TimeSeries&& other)
: label(std::move(other.label)),
style(other.style),
@ -97,6 +101,10 @@ class Plot {
// Sets the title of the plot.
void SetTitle(std::string title);
// Add a new TimeSeries to the plot.
TimeSeries* AddTimeSeries(const char* label, PlotStyle style);
TimeSeries* AddTimeSeries(const std::string& label, PlotStyle style);
std::vector<TimeSeries> series_list_;
protected: