Package com.storedobject.svg.chart
Class LinePlot
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidbuild()Build the plot SVG.protected StringgridLine(double y) Generate the SVG for a grid line.voidsetAxisColor(String axisColor) Set the color for the axes.voidsetGridLineColor(String gridLineColor) Set the color for the grid lines.voidsetLeftGap(int leftGap) Set the left gap for the plot.voidsetPlotColor(String plotColor) Set the color for the plot line.voidsetShowGridLines(boolean showGridLines) Set whether to show grid lines.Methods inherited from class com.storedobject.svg.chart.Chart
addValue, addValue, colorize, compute, extraContent, getValues, isBuilt, setLabelName, setUnit, setValueName, tagMethods inherited from class com.storedobject.svg.Node
attributes, copy, createDocument, equals, escapeXml, flipHorizontally, flipHorizontallyAroundOrigin, flipVertically, flipVerticallyAroundOrigin, getCoordinates, getId, getMargin, getSvg, hashCode, id, ID, IDValue, innerContent, moveTo, moveTo, rotate, rotateAround, rotateAround, rotateAroundCenter, scale, scale, scaleHeightTo, scaleTo, scaleWidthTo, styles, toString, toString, transform, translate, translate
-
Constructor Details
-
LinePlot
Constructor.- Parameters:
values- The data values to be plotted.tickStart- The starting value for Y-axis ticks.tickStep- The step value between Y-axis ticks.tickCount- The number of ticks on the Y-axis.
-
-
Method Details
-
setShowGridLines
public void setShowGridLines(boolean showGridLines) Set whether to show grid lines.- Parameters:
showGridLines- True to show grid lines.
-
setAxisColor
Set the color for the axes.- Parameters:
axisColor- Color string.
-
setGridLineColor
Set the color for the grid lines.- Parameters:
gridLineColor- Color string.
-
setPlotColor
Set the color for the plot line.- Parameters:
plotColor- Color string.
-
setLeftGap
public void setLeftGap(int leftGap) Set the left gap for the plot. The default value is 40. You may increase it if the labels are too long.- Parameters:
leftGap- Left gap.
-
build
-
gridLine
Generate the SVG for a grid line.- Parameters:
y- Y coordinate of the grid line.- Returns:
- SVG string for the grid line.
-