public class Tooltips extends Object implements HasAnimation
Modifier | Constructor and Description |
---|---|
protected |
Tooltips(ConfigurationOptions options)
Builds the object storing the chart instance and the root options element.
|
Modifier and Type | Method and Description |
---|---|
AnimationContainer |
getAnimationContainer()
Returns an animation container instance to use in the default methods of this interface.
|
IsColor |
getBackgroundColor()
Returns the background color of the tooltip.
|
String |
getBackgroundColorAsString()
Returns the background color of the tooltip.
|
TextAlign |
getBodyAlign()
Returns the body alignment.
|
IsColor |
getBodyColor()
Returns the body font color.
|
String |
getBodyColorAsString()
Returns the body font color as string.
|
Font |
getBodyFont()
Returns the body font element.
|
int |
getBodySpacing()
Returns the spacing to add to top and bottom of each tooltip item.
|
IsColor |
getBorderColor()
Returns the color of the border.
|
String |
getBorderColorAsString()
Returns the color of the border.
|
int |
getBorderWidth()
Returns the size of the border.
|
int |
getBoxHeight()
Returns the height of the colored box if displayColors is
true .. |
int |
getBoxWidth()
Returns the width of the colored box if displayColors is
true .. |
TooltipsCallbacks |
getCallbacks()
Returns the object where all tooltips callbacks are stored.
|
int |
getCaretPadding()
Returns the extra distance to move the end of the tooltip arrow away from the tooltip point.
|
int |
getCaretSize()
Returns the size of the tooltip arrow, in pixels.
|
IsChart |
getChart()
Returns the chart instance
|
protected ExtendedOptions |
getConfiguration()
Returns the configuration element.
|
int |
getCornerRadius()
Returns the radius of tooltip corner curves.
|
Set<Event> |
getEvents()
Returns the browser events that the tooltip should listen to.
|
TooltipExternalCallback |
getExternalCallback()
Returns the user external callback instance.
|
TooltipFilterCallback |
getFilterCallback()
Returns the user filter callback instance.
|
TextAlign |
getFooterAlign()
Returns the footer alignment.
|
IsColor |
getFooterColor()
Returns the footer font color.
|
String |
getFooterColorAsString()
Returns the footer font color as string.
|
Font |
getFooterFont()
Returns the footer font element.
|
int |
getFooterMarginTop()
Returns the margin to add before drawing the footer.
|
int |
getFooterSpacing()
Returns the spacing to add to top and bottom of each footer line.
|
TooltipItemSortCallback |
getItemSortCallback()
Returns the user item sort callback instance.
|
InteractionMode |
getMode()
Returns which elements appear in the tooltip.
|
IsColor |
getMultiKeyBackground()
Returns the color to draw behind the colored boxes when multiple items are in the tooltip.
|
String |
getMultiKeyBackgroundAsString()
Returns the color to draw behind the colored boxes when multiple items are in the tooltip.
|
protected ConfigurationOptions |
getOptions()
Returns the configuration options.
|
Padding |
getPadding()
Returns the object where all tooltips padding is stored.
|
IsTooltipPosition |
getPosition()
Returns the mode for positioning the tooltip.
|
TextDirection |
getTextDirection()
Returns the text direction of the tooltip that will force the text direction on the canvas for rendering the tooltip, regardless of the CSS specified on the canvas.
|
TextAlign |
getTitleAlign()
Returns the title alignment.
|
IsColor |
getTitleColor()
Returns the title font color.
|
String |
getTitleColorAsString()
Returns the title font color as string.
|
Font |
getTitleFont()
Returns the title font element.
|
int |
getTitleMarginBottom()
Returns the margin to add on bottom of title section.
|
int |
getTitleSpacing()
Returns the spacing to add to top and bottom of each title line.
|
TooltipAlign |
getXAlign()
Returns the alignment of the tooltip caret in the X direction.
|
TooltipAlign |
getYAlign()
Returns the alignment of the tooltip caret in the Y direction.
|
boolean |
isDisplayColors()
If true, color boxes are shown in the tooltip.
|
boolean |
isEnabled()
Returns if tooltips are enabled.
|
boolean |
isIntersect()
if true, the tooltip mode applies only when the mouse position intersects with an element.
|
boolean |
isRtl()
Returns
true for rendering the tooltips from right to left. |
boolean |
isUsePointStyle()
Returns if to use the corresponding point style (from data set options) instead of color boxes (size is based on the minimum value between boxWidth and boxHeight).
|
void |
setBackgroundColor(IsColor backgroundColor)
Sets the background color of the tooltip.
|
void |
setBackgroundColor(String backgroundColor)
Sets the background color of the tooltip.
|
void |
setBodyAlign(TextAlign align)
Sets the body alignment.
|
void |
setBodyColor(IsColor color)
Sets the body font color.
|
void |
setBodyColor(String color)
Sets the body font color.
|
void |
setBodySpacing(int bodySpacing)
Sets the spacing to add to top and bottom of each tooltip item.
|
void |
setBorderColor(IsColor borderColor)
Sets the color of the border.
|
void |
setBorderColor(String borderColor)
Sets the color of the border.
|
void |
setBorderWidth(int borderWidth)
Sets the size of the border.
|
void |
setBoxHeight(int boxHeight)
Sets the height of the colored box if displayColors is
true .. |
void |
setBoxWidth(int boxWidth)
Sets the width of of the colored box if displayColors is
true .. |
void |
setCaretPadding(int caretPadding)
Sets the extra distance to move the end of the tooltip arrow away from the tooltip point.
|
void |
setCaretSize(int caretSize)
Sets the size of the tooltip arrow, in pixels.
|
void |
setCornerRadius(int cornerRadius)
Sets the radius of tooltip corner curves.
|
void |
setDisplayColors(boolean displayColors)
If true, color boxes are shown in the tooltip.
|
void |
setEnabled(boolean enabled)
Sets if tooltips are enabled.
|
void |
setEvents(Event... events)
Sets the browser events that the tooltip should listen to.
|
void |
setExternalCallback(TooltipExternalCallback externalCallback)
Sets the user external callback instance.
|
void |
setFilterCallback(TooltipFilterCallback filterCallback)
Sets the user filter callback instance.
|
void |
setFooterAlign(TextAlign align)
Sets the footer alignment.
|
void |
setFooterColor(IsColor color)
Sets the footer font color.
|
void |
setFooterColor(String color)
Sets the footer font color.
|
void |
setFooterMarginTop(int footerMarginTop)
Sets the margin to add before drawing the footer.
|
void |
setFooterSpacing(int footerSpacing)
Sets the spacing to add to top and bottom of each footer line.
|
void |
setIntersect(boolean intersect)
if true, the tooltip mode applies only when the mouse position intersects with an element.
|
void |
setItemSortCallback(TooltipItemSortCallback itemSortCallback)
Sets the user item sort callback instance.
|
void |
setMode(InteractionMode mode)
Sets which elements appear in the tooltip.
|
void |
setMultiKeyBackground(IsColor multiKeyBackground)
Sets the color to draw behind the colored boxes when multiple items are in the tooltip.
|
void |
setMultiKeyBackground(String multiKeyBackground)
Sets the color to draw behind the colored boxes when multiple items are in the tooltip.
|
void |
setPosition(IsTooltipPosition position)
Sets the mode for positioning the tooltip.
|
void |
setRtl(boolean rtl)
Sets
true for rendering the tooltips from right to left. |
void |
setTextDirection(TextDirection textDirection)
Sets the text direction of the tooltip that will force the text direction on the canvas for rendering the tooltip, regardless of the CSS specified on the canvas.
|
void |
setTitleAlign(TextAlign align)
Sets the title alignment.
|
void |
setTitleColor(IsColor color)
Sets the title font color.
|
void |
setTitleColor(String color)
Sets the title font color.
|
void |
setTitleMarginBottom(int titleMarginBottom)
Sets the margin to add on bottom of title section.
|
void |
setTitleSpacing(int titleSpacing)
Sets the spacing to add to top and bottom of each title line.
|
void |
setUsePointStyle(boolean usePointStyle)
Sets if to use the corresponding point style (from data set options) instead of color boxes (size is based on the minimum value between boxWidth and boxHeight).
|
void |
setXAlign(TooltipAlign align)
Sets the alignment of the tooltip caret in the X direction.
|
void |
setYAlign(TooltipAlign align)
Sets the alignment of the tooltip caret in the Y direction.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAnimation, getAnimations, getTransitions, isAnimationEnabled, setAnimationEnabled
protected Tooltips(ConfigurationOptions options)
options
- root options element.public AnimationContainer getAnimationContainer()
HasAnimation
getAnimationContainer
in interface HasAnimation
public final TooltipsCallbacks getCallbacks()
public final Padding getPadding()
public void setEnabled(boolean enabled)
enabled
- if tooltips are enabled.public boolean isEnabled()
public void setEvents(Event... events)
events
- the browser events that the tooltip should listen to.public Set<Event> getEvents()
public void setMode(InteractionMode mode)
mode
- which elements appear in the tooltip.public InteractionMode getMode()
public void setIntersect(boolean intersect)
intersect
- if true, the tooltip mode applies only when the mouse position intersects with an element. If false, the mode will be applied at all times.public boolean isIntersect()
public void setPosition(IsTooltipPosition position)
position
- the mode for positioning the tooltip.public IsTooltipPosition getPosition()
public void setBackgroundColor(IsColor backgroundColor)
backgroundColor
- background color of the tooltip.public void setBackgroundColor(String backgroundColor)
backgroundColor
- background color of the tooltip.public String getBackgroundColorAsString()
public IsColor getBackgroundColor()
public Font getTitleFont()
public void setTitleColor(IsColor color)
color
- title font color.public void setTitleColor(String color)
color
- title font color.public String getTitleColorAsString()
public IsColor getTitleColor()
public void setTitleAlign(TextAlign align)
align
- title alignment.public TextAlign getTitleAlign()
public void setTitleSpacing(int titleSpacing)
titleSpacing
- spacing to add to top and bottom of each title line.public int getTitleSpacing()
public void setTitleMarginBottom(int titleMarginBottom)
titleMarginBottom
- margin to add on bottom of title section.public int getTitleMarginBottom()
public Font getBodyFont()
public void setBodyColor(IsColor color)
color
- body font color.public void setBodyColor(String color)
color
- body font color.public String getBodyColorAsString()
public IsColor getBodyColor()
public void setBodyAlign(TextAlign align)
align
- body alignment.public TextAlign getBodyAlign()
public void setBodySpacing(int bodySpacing)
bodySpacing
- spacing to add to top and bottom of each tooltip item.public int getBodySpacing()
public Font getFooterFont()
public void setFooterColor(IsColor color)
color
- footer font color.public void setFooterColor(String color)
color
- footer font color.public String getFooterColorAsString()
public IsColor getFooterColor()
public void setFooterAlign(TextAlign align)
align
- footer alignment.public TextAlign getFooterAlign()
public void setFooterSpacing(int footerSpacing)
footerSpacing
- spacing to add to top and bottom of each footer line.public int getFooterSpacing()
public void setFooterMarginTop(int footerMarginTop)
footerMarginTop
- margin to add before drawing the footer.public int getFooterMarginTop()
public void setCaretPadding(int caretPadding)
caretPadding
- extra distance to move the end of the tooltip arrow away from the tooltip point.public int getCaretPadding()
public void setCaretSize(int caretSize)
caretSize
- size of the tooltip arrow, in pixels.public int getCaretSize()
public void setCornerRadius(int cornerRadius)
cornerRadius
- radius of tooltip corner curves.public int getCornerRadius()
public void setMultiKeyBackground(IsColor multiKeyBackground)
multiKeyBackground
- color to draw behind the colored boxes when multiple items are in the tooltip.public void setMultiKeyBackground(String multiKeyBackground)
multiKeyBackground
- color to draw behind the colored boxes when multiple items are in the tooltip.public String getMultiKeyBackgroundAsString()
public IsColor getMultiKeyBackground()
public void setDisplayColors(boolean displayColors)
displayColors
- if true, color boxes are shown in the tooltip.public boolean isDisplayColors()
public void setBorderColor(IsColor borderColor)
borderColor
- color of the border.public void setBorderColor(String borderColor)
borderColor
- color of the border.public String getBorderColorAsString()
public IsColor getBorderColor()
public void setBorderWidth(int borderWidth)
borderWidth
- size of the border.public int getBorderWidth()
public void setBoxWidth(int boxWidth)
true
..boxWidth
- width of colored box.public int getBoxWidth()
true
..public void setBoxHeight(int boxHeight)
true
..boxHeight
- width of colored box.public int getBoxHeight()
true
..public void setRtl(boolean rtl)
true
for rendering the tooltips from right to left.rtl
- true
for rendering the tooltips from right to leftpublic boolean isRtl()
true
for rendering the tooltips from right to left.true
for rendering the tooltips from right to left.public void setTextDirection(TextDirection textDirection)
textDirection
- the text direction of the tooltip.public TextDirection getTextDirection()
public void setUsePointStyle(boolean usePointStyle)
usePointStyle
- true
if to use the corresponding point style (from data set options) instead of color boxes (size is based on the minimum value between
boxWidth and boxHeight)public boolean isUsePointStyle()
true
if to use the corresponding point style (from data set options) instead of color boxes (size is based on the minimum value between boxWidth and
boxHeight)public void setXAlign(TooltipAlign align)
align
- the alignment of the tooltip caret in the X direction.public TooltipAlign getXAlign()
public void setYAlign(TooltipAlign align)
align
- the alignment of the tooltip caret in the Y direction.public TooltipAlign getYAlign()
public TooltipExternalCallback getExternalCallback()
public void setExternalCallback(TooltipExternalCallback externalCallback)
externalCallback
- the user external callback instancepublic TooltipItemSortCallback getItemSortCallback()
public void setItemSortCallback(TooltipItemSortCallback itemSortCallback)
itemSortCallback
- the user item sort callback instancepublic TooltipFilterCallback getFilterCallback()
public void setFilterCallback(TooltipFilterCallback filterCallback)
filterCallback
- the user filter callback instanceprotected final ConfigurationOptions getOptions()
protected final ExtendedOptions getConfiguration()
public final IsChart getChart()