![]() |
Bridges-C++
3.2.0
Bridges(C++API)
|
#include <LineChart.h>
Show series of data or functions using a line chart.
Line charts (https://en.wikipedia.org/wiki/Line_chart) are used to represent graphically functions such as f(x) = 3*x+1, or data such as temperature of a liquid on a stove as time passes. A individual function or a set of data is called "series".
A series is represented by two arrays xdata and ydata such that there is a point at (xdata[0], ydata[0]), an other at (xdata[1], ydata[1]), ... One can add a series by passing the two arrays using setDataSeries() or add the arrays individually using setXData() and setYData().
The different series have a label associated with them by default which can be disabled (see toggleSeriesLabel()).
The data is typically shown with axes that use a linear scale. However, the scale can be changed to logarithmic for each axis individually (see toggleLogarithmicX() and toggleLogarithmic()).
The LineChart can have a title (see getTitle() and setTitle()) and a subtitle (see setSubTitle() and getSubTitle()).
Public Member Functions | |
| LineChart () | |
| virtual const string | getDStype () const override |
| Get the data type. More... | |
| void | toggleMouseTrack (bool val) |
| Enables or disables mouse tracking. More... | |
| void | toggleSeriesLabel (bool val) |
| Enables or disables series labels. More... | |
| void | toggleLogarithmicX (bool val) |
| Change the X-axis scale to logarithmic. More... | |
| void | toggleLogarithmicY (bool val) |
| Change the Y-axis scale to logarithmic. More... | |
| void | setTitle (string t) |
| Title of the plot. More... | |
| string | getTitle () const |
| Title of the plot. More... | |
| void | setSubTitle (string s) |
| Subtitle of the plot. More... | |
| string | getSubTitle () const |
| Subtitle of the plot. More... | |
| void | setYLabel (string yaxisName) |
| Change the label for the Y-axis. More... | |
| string | getYLabel () const |
| Returns the label for the Y-axis. More... | |
| void | setXLabel (string xaxisName) |
| Change the label for the X-axis. More... | |
| string | getXLabel () const |
| Returns the label for the Y-axis. More... | |
| void | setDataSeries (string seriesName, vector< double > xdata, vector< double > ydata) |
| Add a series (or update it) More... | |
| void | setXData (string series, vector< double > xdata) |
| Changes the X data for a series. More... | |
| vector< double > | getXData (string series) |
| Returns the X data for a series. More... | |
| void | setYData (string series, vector< double > ydata) |
| Changes the Y data for a series. More... | |
| vector< double > | getYData (string series) |
| Returns the Y data for a series. More... | |
| virtual const string | getDataStructureRepresentation () const override |
Public Member Functions inherited from bridges::datastructure::DataStructure | |
| virtual | ~DataStructure ()=default |
|
inline |
|
inlineoverridevirtual |
Ease of use function for the deletion of an entire datastructure. Overrides should call delete on itself and each linked data structure
Implements bridges::datastructure::DataStructure.
|
inlineoverridevirtual |
Get the data type.
Implements bridges::datastructure::DataStructure.
|
inline |
Subtitle of the plot.
|
inline |
Title of the plot.
|
inline |
Returns the X data for a series.
| series | indicate the series to get |
|
inline |
Returns the label for the Y-axis.
|
inline |
Returns the Y data for a series.
| series | indicate the series to get |
|
inline |
Returns the label for the Y-axis.
|
inline |
Add a series (or update it)
| seriesName | indicates the series to add (or change) |
| xdata | the X data in the series |
| ydata | the Y data in the series |
|
inline |
Subtitle of the plot.
| s | the subtitle to be shown |
|
inline |
Title of the plot.
| t | the title to be shown |
|
inline |
Changes the X data for a series.
| series | indicates the series to get |
| xdata | the X data in the series |
|
inline |
Change the label for the X-axis.
| xaxisName | label to use for the X-axis |
|
inline |
Changes the Y data for a series.
| series | indicates the series to get |
| ydata | the Y data in the series |
|
inline |
Change the label for the Y-axis.
| yaxisName | label to show for the Y-axis |
|
inline |
Change the X-axis scale to logarithmic.
When enabled, the X-axis scale becomes logarithmic (as opposed to linear).
| val | Should the X-axis use a logarithmic scale? |
|
inline |
Change the Y-axis scale to logarithmic.
When enabled, the Y-axis scale becomes logarithmic (as opposed to linear).
| val | Should the Y-axis use a logarithmic scale? |
|
inline |
Enables or disables mouse tracking.
Mouse tracking show the value of a data point when the mouse hovers on a data point.
| val | Should mouse tracking be activated or not. |
|
inline |
Enables or disables series labels.
When enabled, the name of the series will be shown on the line chart.
| val | Should series be labeled or not |
1.8.13