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}
diff --git a/webrtc/tools/event_log_visualizer/plot_base.h b/webrtc/tools/event_log_visualizer/plot_base.h
index e2bec2d..0c0ebc0 100644
--- a/webrtc/tools/event_log_visualizer/plot_base.h
+++ b/webrtc/tools/event_log_visualizer/plot_base.h
@@ -28,6 +28,10 @@
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 @@
// 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: