Constructor and Description |
---|
LineChart()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addLine(Line line)
Adds a line to the chart.
|
void |
addLines(Line... addedLines)
Adds some lines to the chart.
|
Area |
calculateDisplayedArea()
Calculates the displayed area via
getDisplayedArea() or the added lines. |
double |
convertToChartX(double graphX)
Converts a graph coordinate to a chart one.
|
double |
convertToChartY(double graphY)
Converts a graph coordinate to a chart one.
|
double[] |
convertToGraphCoordinates(double chartX,
double chartY)
Converts chart coordinates to a graph ones.
|
double |
convertToGraphX(double chartX)
Converts a chart coordinate to a graph one.
|
double |
convertToGraphY(double chartY)
Converts a chart coordinate to a graph one.
|
LineChart |
displayedArea(Area newDisplayedArea)
Sets the displayed area of this chart, i.e.
|
Area |
getDisplayedArea()
Returns the displayed area of this chart, i.e.
|
XAxis |
getXAxis()
Returns the x axis of this line chart.
|
YAxis |
getYAxis()
Returns the y axis of this line chart.
|
double |
getZoomFactor()
Returns the factor which should be used to zoom the graph area.
|
void |
moveDisplayedAreaByChartCoordinates(double xIncrement,
double yIncrement)
Moves the displayed area of this
Chart by the coordinates used for the
entire chart. |
void |
paintOn(GraphicContext gc,
PaintInstructions instructions)
Paints the current content onto the graphic context.
|
void |
removeLine(Line line)
Removes a line from the chart.
|
void |
removeLines(Line... removedLines)
Removes some lines to the chart.
|
void |
resetDisplayedArea()
Resets the displayed area.
|
void |
setDisplayedArea(Area displayedArea)
Sets the displayed area of this chart, i.e.
|
void |
setZoomFactor(double zoomFactor)
Sets the factor which should be used to zoom the graph area.
|
void |
zoomDisplayedAreaInByChartCoordinates(double chartX,
double chartY)
Zooms the graph area in using the chart's coordinates.
|
void |
zoomDisplayedAreaInByGraphCoordinates(double graphX,
double graphY)
Zooms the graph area in using the graph's coordinates.
|
void |
zoomDisplayedAreaOutByChartCoordinates(double chartX,
double chartY)
Zooms the graph area out using the chart's coordinates.
|
void |
zoomDisplayedAreaOutByGraphCoordinates(double graphX,
double graphY)
Zooms the graph area out using the graph's coordinates.
|
LineChart |
zoomFactor(double newZoomFactor)
Sets the factor which should be used to zoom the graph area.
|
addRefreshListener, backgroundColor, calculateGraphArea, getBackgroundColor, getBorder, getTitle, removeRefreshListener, setBackgroundColor
public void paintOn(GraphicContext gc, PaintInstructions instructions)
Chart
public Area calculateDisplayedArea()
getDisplayedArea()
or the added lines.getDisplayedArea()
,
addLine(Line)
,
addLines(Line[])
public void addLine(Line line)
line
- a line to addpublic void addLines(Line... addedLines)
addedLines
- lines to addpublic void removeLine(Line line)
line
- a line to addpublic void removeLines(Line... removedLines)
removedLines
- lines to addpublic void moveDisplayedAreaByChartCoordinates(double xIncrement, double yIncrement)
Chart
by the coordinates used for the
entire chart. Let's say the chart is painted on an area 1000x1000 pixels, but the
graph only displays something between the coordinates 0 and 1. If you move
100pixels in the chart scale, you only need to move the graph 0.1 points.xIncrement
- the x movementyIncrement
- the y movementIllegalArgumentException
- if graph was never painted beforepublic void zoomDisplayedAreaInByChartCoordinates(double chartX, double chartY)
chartX
- the x coordinate in the chart's coordinate systemchartY
- the y coordinate in the chart's coordinate systemconvertToGraphCoordinates(double, double)
,
convertToGraphX(double)
,
convertToGraphY(double)
,
zoomDisplayedAreaOutByChartCoordinates(double, double)
public void zoomDisplayedAreaInByGraphCoordinates(double graphX, double graphY)
graphX
- the x coordinate in the graph's coordinate systemgraphY
- the y coordinate in the graph's coordinate systemconvertToGraphCoordinates(double, double)
,
convertToGraphX(double)
,
convertToGraphY(double)
,
zoomDisplayedAreaOutByGraphCoordinates(double, double)
public void zoomDisplayedAreaOutByChartCoordinates(double chartX, double chartY)
chartX
- the x coordinate in the chart's coordinate systemchartY
- the y coordinate in the chart's coordinate systemIllegalArgumentException
- if graph was never painted beforeconvertToGraphCoordinates(double, double)
,
convertToGraphX(double)
,
convertToGraphY(double)
,
zoomDisplayedAreaOutByChartCoordinates(double, double)
public void zoomDisplayedAreaOutByGraphCoordinates(double graphX, double graphY)
graphX
- the x coordinate in the graph's coordinate systemgraphY
- the y coordinate in the graph's coordinate systemIllegalArgumentException
- if graph was never painted beforeconvertToGraphCoordinates(double, double)
,
convertToGraphX(double)
,
convertToGraphY(double)
,
zoomDisplayedAreaInByGraphCoordinates(double, double)
public double[] convertToGraphCoordinates(double chartX, double chartY)
chartX
- the x coordinate in the chart's coordinate systemchartY
- the y coordinate in the chart's coordinate systemIllegalArgumentException
- if graph was never painted beforeconvertToGraphX(double)
,
convertToGraphY(double)
public double convertToGraphX(double chartX)
chartX
- the x coordinate in the chart's coordinate systemIllegalArgumentException
- if graph was never painted beforeconvertToGraphCoordinates(double, double)
,
convertToGraphY(double)
public double convertToGraphY(double chartY)
chartY
- the y coordinate in the chart's coordinate systemIllegalArgumentException
- if graph was never painted beforeconvertToGraphCoordinates(double, double)
,
convertToGraphX(double)
public double convertToChartX(double graphX)
graphX
- the x coordinate in the graph's coordinate systemIllegalArgumentException
- if graph was never painted beforeconvertToChartY(double)
public double convertToChartY(double graphY)
graphY
- the y coordinate in the graph's coordinate systemIllegalArgumentException
- if graph was never painted beforeconvertToChartX(double)
public void resetDisplayedArea()
setDisplayedArea(Area)
public Area getDisplayedArea()
null
is used to indicate the value is calculated by questioning the
Line
s.public LineChart displayedArea(Area newDisplayedArea)
null
is used to indicate the value is calculated by questioning the
Line
s.newDisplayedArea
- the displayed areapublic void setDisplayedArea(Area displayedArea)
null
is used to indicate the value is calculated by questioning the
Line
s.displayedArea
- the displayed areapublic double getZoomFactor()
public LineChart zoomFactor(double newZoomFactor)
newZoomFactor
- the zoom factorzoomDisplayedAreaInByChartCoordinates(double, double)
,
zoomDisplayedAreaInByGraphCoordinates(double, double)
,
zoomDisplayedAreaOutByChartCoordinates(double, double)
,
zoomDisplayedAreaOutByGraphCoordinates(double, double)
public void setZoomFactor(double zoomFactor)
zoomFactor
- the zoom factorzoomDisplayedAreaInByChartCoordinates(double, double)
,
zoomDisplayedAreaInByGraphCoordinates(double, double)
,
zoomDisplayedAreaOutByChartCoordinates(double, double)
,
zoomDisplayedAreaOutByGraphCoordinates(double, double)
public XAxis getXAxis()
public YAxis getYAxis()
Copyright © 2020. All rights reserved.