public class Crosshair extends AbstractConfigurationObject
Configure a crosshair that follows either the mouse pointer or the hovered point. By default, the crosshair is enabled on the X axis and disabled on Y axis.
In
styled mode, the crosshairs are styled in the
.highcharts-crosshair
, .highcharts-crosshair-thin
or .highcharts-xaxis-category
classes.
Constructor and Description |
---|
Crosshair() |
Modifier and Type | Method and Description |
---|---|
String |
getClassName() |
Color |
getColor() |
DashStyle |
getDashStyle() |
CrosshairLabel |
getLabel() |
Boolean |
getSnap() |
Number |
getWidth() |
Number |
getZIndex() |
void |
setClassName(String className)
A class name for the crosshair, especially as a hook for styling.
|
void |
setColor(Color color)
The color of the crosshair.
|
void |
setDashStyle(DashStyle dashStyle)
The dash style for the crosshair.
|
void |
setLabel(CrosshairLabel label)
A label on the axis next to the crosshair.
|
void |
setSnap(Boolean snap)
Whether the crosshair should snap to the point or follow the pointer
independent of points.
|
void |
setWidth(Number width)
The pixel width of the crosshair.
|
void |
setZIndex(Number zIndex)
The Z index of the crosshair.
|
public String getClassName()
setClassName(String)
public void setClassName(String className)
public Color getColor()
setColor(Color)
public void setColor(Color color)
#cccccc
for numeric
and datetime axes, and rgba(204,214,235,0.25)
for category
axes, where the crosshair by default highlights the whole category.public DashStyle getDashStyle()
setDashStyle(DashStyle)
public void setDashStyle(DashStyle dashStyle)
Defaults to: Solid
public Boolean getSnap()
setSnap(Boolean)
public void setSnap(Boolean snap)
Defaults to: true
public Number getWidth()
setWidth(Number)
public void setWidth(Number width)
public Number getZIndex()
setZIndex(Number)
public void setZIndex(Number zIndex)
Defaults to: 2
public CrosshairLabel getLabel()
setLabel(CrosshairLabel)
public void setLabel(CrosshairLabel label)
A label on the axis next to the crosshair.
In styled mode, the label is styled with the
.highcharts-crosshair-label
class.
Copyright © 2024. All rights reserved.