Class ToolTips
java.lang.Object
java.awt.event.MouseAdapter
org.knowm.xchart.internal.chartpart.ToolTips
- All Implemented Interfaces:
MouseListener,MouseMotionListener,MouseWheelListener,EventListener,ChartPart
Tooltips can be put on all data points or configured to popup like a tooltip from a mouse over.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Chartprivate static final intprivate static final intprivate final Stylerprivate ToolTips.ToolTipprivate final List<ToolTips.ToolTip> Fields inherited from interface org.knowm.xchart.internal.chartpart.ChartPart
SOLID_STROKE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidAdds a data with label with coordinates (xOffset, yOffset).(package private) voidAdds a data (xValue, yValue) with coordinates (xOffset, yOffset).(package private) void(package private) voidAdds a data (xValue, yValue) with geometry defined with shape.voidprivate Stringprivate ToolTips.ToolTipgetSelectedTooltip(int x, int y) voidvoidpaint(Graphics2D g) private voidprivate voidpaintToolTip(Graphics2D g, ToolTips.ToolTip tooltip) Methods inherited from class java.awt.event.MouseAdapter
mouseClicked, mouseDragged, mouseEntered, mouseExited, mousePressed, mouseReleased, mouseWheelMoved
-
Field Details
-
MARGIN
private static final int MARGIN- See Also:
-
MOUSE_MARGIN
private static final int MOUSE_MARGIN- See Also:
-
chart
-
styler
-
toolTipList
-
tooltip
-
-
Constructor Details
-
ToolTips
Constructor- Parameters:
chart-
-
-
Method Details
-
mouseMoved
- Specified by:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin classMouseAdapter
-
getSelectedTooltip
-
getBounds
-
paint
-
paintToolTip
-
paintMultiLineToolTip
-
addData
Adds a data (xValue, yValue) with coordinates (xOffset, yOffset). This point will be highlighted with a circle centering (xOffset, yOffset) -
addData
Adds a data with label with coordinates (xOffset, yOffset). This point will be highlighted with a circle centering (xOffset, yOffset) -
addData
void addData(Shape shape, double xOffset, double yOffset, double width, String xValue, String yValue) Adds a data (xValue, yValue) with geometry defined with shape. This point will be highlighted using the shape -
addData
-
getLabel
-
clearData
public void clearData()
-