I would try something like:
highlighter:{
show:true,
sizeAdjust:7.5,
useAxesFormatters:true,
formatString:'series.label - x: %s , y: %s'
}
As an example for what i'm trying to do, lets say i'm plotting 3
stocks on the same graph. My series labels (the ones that show in the
legend) could be GM, Ford, and Toyota. I want to be able to mouse over
a point on lets say the Ford line and see a tool tip like:
Ford - x: 2010-03-10 , y: $2.25
For my example with only three lines the colors alone would be enough
to tell apart the lines, but this would be useful in the event that
you have a large number of lines plotted on the same graph. Lets say
10-15 (or more) lines on the same graph colors start to look the same.
It can be hard to distinguish between them. It would be nice to be
able to mouse over the line and tell which one it is.
Good post! I'll just say, that I would like to see exactly this tinggy
too!
Best regards,
--mabra
In the file jqplot.highlighter.js there is a function called
showTooltip. This function is what is called to create the tool tip
that is displayed with hovering over a point on a plot using the
highlighter plug in.
The function takes 3 inputs: plot, series, and neighbor.
series is an object that holds all the information about the series.
This is the one we're interested in. series.label is a string that is
equal to whatever you named the series when setting up the plot. It is
the label that shows up in the legend.
to get my desired effect I just added the line:
str = series.label + ": ";
str += xstr;
I just put that line directly in the case statement that creates the
tool tip for the format i was using (useAxesFormatters=true &
tooltipAxes='xy').
Good tip, thanks!
br--
mabra