javascript - x-area labels on hover -
i need add color xaxis labels when it's hover (like number 19 in picture). saw property later lost it.
need =)
and can set property (z-index) xaxis tick? cause color must white, , can't see color, when z-index less z-index chart's area.
for first question, use shared tooltip , point mouseover
event change corresponding axis label:
plotoptions: { series: { point: { events: { // on mouseover make xaxis label red mouseover: function(){ var xaxis = this.series.chart.xaxis[0]; $(xaxis.ticks[this.x].label.element).css('fill','red'); }, // on mouseout make gray again mouseout: function(){ var xaxis = this.series.chart.xaxis[0]; $(xaxis.ticks[this.x].label.element).css('fill','#606060'); } } } } },
example here.
for second question, z index svg little tricky. doesn't have true zindex can re-order rather it's dictated order in elements drawn. can't see matters, though, because labels drawn on top of chart area (or else wouldn't see them @ all).
Comments
Post a Comment