Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Microsoft .Net & .Net Compact Framework
 QCChart2D and QCChart2D CF (VB and C#)
 Adding multiple ToolTips
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

jasonhullinger

1 Posts

Posted - 03 Oct 2003 :  19:34:46  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07