![]() |
Bridges-Java 3.5.0
Bridges(Java API)
|
Enable plotting series of data or functions using a line chart. More...
Public Member Functions | |
| LineChart () | |
| Line chart default constructor. More... | |
| String | getDataStructType () |
| gets the representation of the line chart as a JSON More... | |
| void | toggleMouseTrack (boolean val) |
| Enables or disables mouse tracking. More... | |
| void | toggleSeriesLabel (boolean val) |
| Enables or disables series labels. More... | |
| void | toggleLogarithmicX (boolean val) |
| Change the X-axis scale to logarithmic. More... | |
| void | toggleLogarithmicY (boolean val) |
| Change the Y-axis scale to logarithmic. More... | |
| void | setTitle (String t) |
| Title of the plot. More... | |
| String | getTitle () |
| Title of the plot. More... | |
| void | setSubTitle (String s) |
| Subtitle of the plot. More... | |
| String | getSubTitle () |
| Subtitle of the plot. More... | |
| void | setYLabel (String yaxisName) |
| Change the label for the Y-axis. More... | |
| String | getYLabel () |
| Returns the label for the Y-axis. More... | |
| void | setXLabel (String xaxisName) |
| Change the label for the X-axis. More... | |
| String | getXLabel () |
| Returns the label for the Y-axis. More... | |
| void | setDataSeries (String seriesName, double[] xdata, double[] ydata) |
| Add a series (or update it) More... | |
| void | setDataSeries (String seriesName, ArrayList< Double > xdata, ArrayList< Double > ydata) |
| Add a series (or update it) More... | |
| void | setDataSeries (String seriesName, double[] xdata, ArrayList< Double > ydata) |
| Add a series (or update it) More... | |
| void | setDataSeries (String seriesName, ArrayList< Double > xdata, double[] ydata) |
| Add a series (or update it) More... | |
| void | setXData (String series, double[] xdata) |
| Changes the X data for a series. More... | |
| void | setXData (String series, ArrayList< Double > xdata) |
| Changes the X data for a series. More... | |
| double[] | getXData (String series) |
| Returns the X data for a series. More... | |
| void | setYData (String series, ArrayList< Double > ydata) |
| Changes the Y data for a series. More... | |
| void | setYData (String series, double[] ydata) |
| Changes the Y data for a series. More... | |
| double[] | getYData (String series) |
| Returns the Y data for a series. More... | |
| String | getDataStructureRepresentation () |
| abstract String | getDataStructType () |
| abstract String | getDataStructureRepresentation () |
Additional Inherited Members | |
Protected Attributes inherited from bridges.base.DataStruct | |
| String | QUOTE = "\"" |
| String | COMMA = "," |
| String | COLON = ":" |
| String | OPEN_CURLY = "{" |
| String | CLOSE_CURLY = "}" |
| String | OPEN_PAREN = "(" |
| String | CLOSE_PAREN = ")" |
| String | OPEN_BOX = "[" |
| String | CLOSE_BOX = "]" |
Enable plotting 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 are 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()).
| bridges.base.LineChart.LineChart | ( | ) |
Line chart default constructor.
| String bridges.base.LineChart.getDataStructType | ( | ) |
gets the representation of the line chart as a JSON
Reimplemented from bridges.base.DataStruct.
| String bridges.base.LineChart.getDataStructureRepresentation | ( | ) |
Reimplemented from bridges.base.DataStruct.
| String bridges.base.LineChart.getSubTitle | ( | ) |
Subtitle of the plot.
| String bridges.base.LineChart.getTitle | ( | ) |
Title of the plot.
| double[] bridges.base.LineChart.getXData | ( | String | series | ) |
Returns the X data for a series.
| series | indicate the series to get |
| String bridges.base.LineChart.getXLabel | ( | ) |
Returns the label for the Y-axis.
| double[] bridges.base.LineChart.getYData | ( | String | series | ) |
Returns the Y data for a series.
| series | indicate the series to get |
| String bridges.base.LineChart.getYLabel | ( | ) |
Returns the label for the Y-axis.
| void bridges.base.LineChart.setDataSeries | ( | String | seriesName, |
| ArrayList< Double > | xdata, | ||
| ArrayList< Double > | ydata | ||
| ) |
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 |
| void bridges.base.LineChart.setDataSeries | ( | String | seriesName, |
| ArrayList< Double > | xdata, | ||
| double[] | ydata | ||
| ) |
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 |
| void bridges.base.LineChart.setDataSeries | ( | String | seriesName, |
| double[] | xdata, | ||
| ArrayList< Double > | ydata | ||
| ) |
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 |
| void bridges.base.LineChart.setDataSeries | ( | String | seriesName, |
| double[] | xdata, | ||
| double[] | ydata | ||
| ) |
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 |
| void bridges.base.LineChart.setSubTitle | ( | String | s | ) |
Subtitle of the plot.
| s | the subtitle to be shown |
| void bridges.base.LineChart.setTitle | ( | String | t | ) |
Title of the plot.
| t | the title to be shown |
| void bridges.base.LineChart.setXData | ( | String | series, |
| ArrayList< Double > | xdata | ||
| ) |
Changes the X data for a series.
| series | indicates the series to get |
| xdata | the X data in the series |
| void bridges.base.LineChart.setXData | ( | String | series, |
| double[] | xdata | ||
| ) |
Changes the X data for a series.
| series | indicates the series to get |
| xdata | the X data in the series |
| void bridges.base.LineChart.setXLabel | ( | String | xaxisName | ) |
Change the label for the X-axis.
| xaxisName | label to use for the X-axis |
| void bridges.base.LineChart.setYData | ( | String | series, |
| ArrayList< Double > | ydata | ||
| ) |
Changes the Y data for a series.
| series | indicates the series to get |
| ydata | the Y data in the series |
| void bridges.base.LineChart.setYData | ( | String | series, |
| double[] | ydata | ||
| ) |
Changes the Y data for a series.
| series | indicates the series to get |
| ydata | the Y data in the series |
| void bridges.base.LineChart.setYLabel | ( | String | yaxisName | ) |
Change the label for the Y-axis.
| yaxisName | label to show for the Y-axis |
| void bridges.base.LineChart.toggleLogarithmicX | ( | boolean | val | ) |
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? |
| void bridges.base.LineChart.toggleLogarithmicY | ( | boolean | val | ) |
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? |
| void bridges.base.LineChart.toggleMouseTrack | ( | boolean | val | ) |
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. |
| void bridges.base.LineChart.toggleSeriesLabel | ( | boolean | val | ) |
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 |