Learn how to easily plot dashboard data directly from your Mercury program.
Simple plotting follows a higher-level SDK helper, DashboardBuilder, that in the background relies on the same components as Complex Plotting.
The DashboardBuilder object has three main functions:
pub fn add_table(mut self, title: &str, columns: Vec<String>, rows: Vec<Vec<String>>) -> Self : returns a dashboard object with a new table.
pub fn add_bar_chart( mut self, title: &str, hover_title: &str, categories: Vec<&str>, data: Vec<i64>) -> Self : returns a dashboard with a new bar chart. Note that categories is generally the explicative x-axis and data the numeric y-axis.
pub fn add_line_chart( mut self, title: &str, categories: Vec<String>, series: Vec<(&str, Vec<i64>)>, ) -> Self : returns a dashboard with a new line chart. Note that categories is generally the x-axis. There can be more than one series specified, and each series ( (&str, Vec<i64> ) has a name (the first tuple element) and a set of data (the i64 vector).