Package com.jbstrap.ui.components.charts
Class LineSeries
java.lang.Object
com.jbstrap.ui.components.charts.Series
com.jbstrap.ui.components.charts.AxesBaseSeries
com.jbstrap.ui.components.charts.LineSeries
- All Implemented Interfaces:
AdvancedMarker<LineSeries>
,ColorizedSeries<LineSeries>
public class LineSeries
extends AxesBaseSeries
implements AdvancedMarker<LineSeries>, ColorizedSeries<LineSeries>
Series object to be used on a line chart.
- Since:
- 4.0
- Author:
- JBStrap
-
Field Summary
Fields inherited from class com.jbstrap.ui.components.charts.AxesBaseSeries
VALUE_TANGENT
Fields inherited from class com.jbstrap.ui.components.charts.Series
CATEGORY_COLUMN, COLOR_COLUMN, colorColumn, DATA_COLUMN, dataColumn, LABEL_COLUMN, labelColumn, MARKER_SIZE, MARKER_TYPE, param, parentChart
Fields inherited from interface com.jbstrap.ui.components.charts.AdvancedMarker
MARKER_FILL_COLOR, MARKER_LINE_COLOR, MARKER_LINE_WIDTH, SHOW_MARKER
Fields inherited from interface com.jbstrap.ui.components.charts.ColorizedSeries
COLOR
-
Constructor Summary
ConstructorDescriptionLineSeries
(String title) Creates a series object to be displayed on a line chart.LineSeries
(String title, String dataColumn) Creates a series object to be displayed on a line chart. -
Method Summary
Modifier and TypeMethodDescriptionstatic LineSeries
fromSeries
(Series series) Creates a line series object based on an other Series object.Gets the chart’s line type.Gets the dash arrayint
Gets the chart’s line width.setCurveType
(CurveType type) Sets the line chart’s line type.setDashArray
(String dashArray) Sets the line dash type.setLineWidth
(int lineWidth) Sets the chart’s line width.Methods inherited from class com.jbstrap.ui.components.charts.AxesBaseSeries
isShowCategoryValueTangent, isShowSeriesValueTangent, setShowCategoryValueTangent, setShowSeriesValueTangent
Methods inherited from class com.jbstrap.ui.components.charts.Series
addData, addData, addData, addData, clear, getColorColumn, getData, getDataColumn, getLabelColumn, getMarker, getMarkerSize, getMarkerType, getParams, getTitle, getValues, isEmpty, refreshMarker, removeDataByCategory, removeDataByIndex, setColorColumn, setDataColumn, setLabelColumn, setMarkerSize, setMarkerType, setParams, setParentChart
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jbstrap.ui.components.charts.AdvancedMarker
getMarkerFillColor, getMarkerLineColor, getMarkerLineWidth, isShowMarker, setMarkerFillColor, setMarkerLineColor, setMarkerLineWidth, setShowMarker
Methods inherited from interface com.jbstrap.ui.components.charts.ColorizedSeries
getColor, setColor
-
Field Details
-
CURVE_TYPE
- See Also:
-
DASH_ARRAY
- See Also:
-
LINE_WIDTH
- See Also:
-
-
Constructor Details
-
LineSeries
Creates a series object to be displayed on a line chart.- Parameters:
title
- Series title (required)- Throws:
NullPointerException
- Thrown if the specified series name isnull
-
LineSeries
Creates a series object to be displayed on a line chart.- Parameters:
title
- Series title (required)dataColumn
- The name of the data column that contains the displayed series in the DataDescriptor- Throws:
NullPointerException
- Thrown if the specified series name isnull
-
-
Method Details
-
setCurveType
Sets the line chart’s line type. By default, the line chart is displayed with a smoothed lineCurveType.SMOOTH
setting.- Parameters:
type
- Line type setting Available types are listed in the enumCurveType
. Ifnull
is specified, the chart’s line is displayed by default as a smoothed line.- Returns:
- Series object
-
getCurveType
Gets the chart’s line type.- Returns:
- Chart line type
-
setLineWidth
Sets the chart’s line width. The default line width setting is 3 pixels.- Parameters:
lineWidth
- Line chart width in pixels- Returns:
- Series object
-
getLineWidth
public int getLineWidth()Gets the chart’s line width.- Returns:
- Chart line width in pixels
-
setDashArray
Sets the line dash type. The method requires a number sequence (unlimited number of items) as parameter. The first item always determines the line section length, whereas the second item represents a space between two line sections. E.g. [20,20] means that a 20-pixel line section is followed by 20 pixels of space, thereby creating a dashed line.- Parameters:
dashArray
- The number sequence in the String format- Returns:
- Series object
-
getDashArray
Gets the dash array- Returns:
- The dash arra or
null
if not set
-
fromSeries
Creates a line series object based on an other Series object.- Parameters:
series
- The series object used to create the line series All of the specified series object’s settings are taken over by the line series. If the specified series does not have the attributes necessary for the line series, the line series is created using default values.- Returns:
- The created line series object
-