SimulationCraft
SimulationCraft is a tool to explore combat mechanics in the popular MMO RPG World of Warcraft (tm).
highchart::chart_t Struct Reference
Inheritance diagram for highchart::chart_t:
js::sc_js_t highchart::bar_chart_t highchart::histogram_chart_t highchart::pie_chart_t highchart::time_series_t

Public Member Functions

 chart_t (std::string id_str, const sim_t &sim)
 
void set_toggle_id (std::string tid)
 
void set_title (std::string_view title)
 
void set_xaxis_title (std::string_view label)
 
void set_yaxis_title (std::string_view label)
 
void set_xaxis_max (double max)
 
void add_simple_series (std::string_view type, std::optional< color::rgb > color, std::string_view name, const std::vector< std::pair< double, double > > &series)
 
void add_simple_series (std::string_view type, std::optional< color::rgb > color, std::string_view name, const std::vector< double > &series)
 
void add_simple_series (std::string_view type, std::optional< color::rgb > color, std::string_view name, const std::vector< data_triple_t > &series)
 
void add_data_series (std::string_view type, std::string_view name, std::vector< sc_js_t > &d)
 
void add_data_series (std::vector< sc_js_t > &d)
 
chart_tadd_yplotline (double value, std::string_view name, double line_width_=1.25, std::optional< color::rgb > color={})
 Add y-axis plotline to the chart at value_ height. More...
 
virtual std::string to_string () const
 
virtual std::string to_aggregate_string (bool on_click=true) const
 
virtual std::string to_data () const
 
virtual std::string to_target_div () const
 
virtual std::string to_xml () const
 
- Public Member Functions inherited from js::sc_js_t
 sc_js_t (const sc_js_t &)
 
void print (std::ostream &) const
 
sc_js_tset (rapidjson::Value &obj, util::string_view name_, const rapidjson::Value &value_)
 
rapidjson::Value & value (util::string_view path)
 
template<typename T , typename = std::enable_if_t<!std::is_convertible<T, util::string_view>::value>>
sc_js_tset (util::string_view path, const T &value_)
 
template<typename T >
sc_js_tset (util::string_view path, const std::vector< T > &values_)
 
sc_js_tset (util::string_view path, const sc_js_t &value_)
 
sc_js_tset (util::string_view path, size_t value_)
 
sc_js_tset (util::string_view path, util::string_view value)
 
template<typename T , typename = std::enable_if_t<!std::is_convertible<T, util::string_view>::value>>
sc_js_tset (rapidjson::Value &obj, util::string_view name_, const T &value_)
 
template<typename T >
sc_js_tset (rapidjson::Value &obj, util::string_view name_, const std::vector< T > &value_)
 
sc_js_tset (rapidjson::Value &obj, util::string_view name, util::string_view value)
 
template<typename T , typename = std::enable_if_t<!std::is_convertible<T, util::string_view>::value>>
sc_js_tadd (util::string_view path, const T &value_)
 
template<typename T >
sc_js_tadd (util::string_view path, const std::vector< T > &data)
 
sc_js_tadd (util::string_view path, const rapidjson::Value &value_)
 
sc_js_tadd (util::string_view path, const sc_js_t &value_)
 
sc_js_tadd (util::string_view path, util::string_view value_)
 
sc_js_tadd (util::string_view path, double x, double low, double high)
 
sc_js_tadd (util::string_view path, double x, double y)
 

Public Attributes

std::string id_str_
 
std::string toggle_id_str_
 
size_t height_
 
size_t width_
 
const sim_tsim_
 
- Public Attributes inherited from js::sc_js_t
rapidjson::Document js_
 

Additional Inherited Members

- Protected Member Functions inherited from js::sc_js_t
rapidjson::Value * path_value (util::string_view path)
 
rapidjson::Value & do_set (rapidjson::Value &obj, util::string_view name_, rapidjson::Value &value_)
 
template<typename T >
rapidjson::Value & do_insert (rapidjson::Value &obj, const std::vector< T > &values)
 

Member Function Documentation

◆ add_yplotline()

chart_t & chart_t::add_yplotline ( double  value,
std::string_view  name,
double  line_width = 1.25,
std::optional< color::rgb color = {} 
)

Add y-axis plotline to the chart at value_ height.

If name is given, a subtitle will be added to the chart, stating name_=value_. Both the line and the text use color_. line_width_ sets the line width of the plotline. If there are multiple plotlines defined, the subtitle text will be concatenated at the end.