I had a problem that I just solved for adding multiple tool tips and thought I would share it.
I create as many new SimpleScatterPlot's as needed and name them:
SimpleScatterPlot symLine1 = new SimpleScatterPlot(latLeftcoords, sym1Data, SimpleScatterPlot.SQUARE, symAtt); symLine.SetPlotLabelTemplate(new NumericLabel(1, 1));
then I add the scatter plots BEFORE I add my LinePlot (this gives the scatter plot more precedence for the mousedown event:
test_chart.AddChartObject(symLine);
Then, in my I pass a string[] to my CustomToolTip class and override OnMouseDown as is basically implemented in the documentation.
In OnMouseDown you would say: ChartPlot selectedPlot = GetSelectedPlotObj();
Then after test to make sure it is not null, you get back the NumericPlot:
NumericLabel nl = selectedPlot.GetPlotLabelTemplate();
now simply test what number it is, for instance:
if(nl.NumericFormat == 1)
if it is, set a global string variable from the index of your string[]:
myMessage = messages[1];
Then simple set the text:
stockpanel.SetTextString(myMessage); //where stockpanel = ChartText
Cheers!
~/Jason |