TrackerFormatString not only show X, Y or Value ? or other method ?

Sep 16, 2012 at 7:43 AM
Edited Sep 16, 2012 at 7:49 AM

Hello:

Since OxyPlot no ToolTip feature currently, so I was trying to use TrackerFormatString of LineSeries to show data point information but I failed (I am using Silverlight). for example I have an object like the following:

Class myObj
{
  int x;
  int y;
  double status;   //I need this status show as a status string after calculation by a method when mouse click or hover current point
}

LineSeries only show X, Y, so I tried ScatterSeries (I actually need LineSeries but not ScatterSeries), but ScatterSeries still can not show a method converted string in TrackerFormatString.

So is there any other solution? Am I using wrong way? 

Thanks!

Coordinator
Sep 16, 2012 at 9:37 AM

try adding a public property to your class

public double Status { get { return status; } }

and set the TrackerFormatString of the LineSeries to something like "{Status:0.00}"

I will add an example later. Note that the status values will not be interpolated if you click between points.

Sep 16, 2012 at 3:12 PM
Edited Sep 16, 2012 at 3:27 PM

Thanks! objo.

Waiting for your example...

please note I need to show x, y and status string (currently I only need show 3 data, but maybe more in the future, i mean, is it possible show all object properties using LineSeries? ) on my screen when mouse click or hover. 

and, my status string is not simple like "{Status:0.00}", the status handle method similar like the following code:

public string GetStatusString(double status)
{
   if((status & FLAG_A) == 0)
{
   return "Status A";
} 
else
{
  if(status & FLAG_B) == 0)
      return "Status B";
  else
 {
    switch(AnotherProperty)
{
  case xxx:
     if(stauts & ..)
      return "Status xxx";
     break;
   case xxxx:
      ...
    break;
} 
} 

} 
return "Status Fail"; 
} 

so do you think is it possible to implement using oxyplot LineSeries ?

Thanks!

Sep 16, 2012 at 6:07 PM

Hi objo:

I got it just now!

I did not know I could use  object's property directly like "{Status}" in TrackerFormatString, all existing examples just show "{0}", "{1}", "{2}".....

It is very helpful!  Thank you very much!  OxyPlot is really great!

BTW: I think there is not ONLY me don't know this usage, hope they can get help from this post too.