Preventing tooltip data from being added to the axis

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Jens Ramlow
Newbie
Newbie
Posts: 13
Joined: Fri Sep 22, 2017 12:00 am
Location: Berlin, Germany

Preventing tooltip data from being added to the axis

Post by Jens Ramlow » Tue Oct 17, 2017 9:14 am

Hello Steema team,

I'm using Steema's TeeChart.WPF.

The chart I'm implementing contains three Series from TeeChart.WPF.Styles.Line and TeeChart.WPF.Styles.Points.

For the points I make use of adding tooltip information by using

Code: Select all

C#
Steema.TeeChart.WPF.Tools.MarksTip MarksTip_Points_Values = new Steema.TeeChart.WPF.Tools.MarksTip(MainChart.Chart)
{
   Series = ChartPoints_Values
};
I'm adding values to the serie by using the overloaded function

Code: Select all

C#
ChartPoints_Values.Add((int) viewRowStation.Row["ID"], (double) viewRowValues.Row["Value"], string.Format("Tooltip information... {0}: {1} | {2}", value, value, value), PointColor);
where you may see the tooltip information is a more or less complex tupel.

But whenever a point is added, the tooltip text will be shown on the corresponding X-axis.
(see picture where "Station 9" is getting overlayed from information)
Unbenannt.PNG
overlay on the X-Axis with information from tooltip
Unbenannt.PNG (11.37 KiB) Viewed 8047 times
How can I prevent the tooltips from being shown on an axis?

Additional curiosity I cannot resolve is seen in the two more pictures, attached.
Zoomed into the (same) chart - there are no tooltip information over the axis labels.
The same chart moved a bit to the right with panning, so the third point comes into the visible chart area - voilá tooltip information over the axis label.
:?:

Thank you.
Best, Jens
Attachments
one point more - with tooltips.PNG
zoomed into the chart - panned to the right: tooltip information arise
one point more - with tooltips.PNG (20.54 KiB) Viewed 8049 times
zoomed - no tooltips.PNG
zoomed into the chart - no tooltip information over
zoomed - no tooltips.PNG (5.74 KiB) Viewed 8044 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: Preventing tooltip data from being added to the axis

Post by Christopher » Tue Oct 17, 2017 3:11 pm

Hello Jens,

I'm having difficulty reproducing this one here (in a straight WPF app). I'm trying to do so with code such as the following:

Code: Select all

    Points series;
    Random rnd = new Random();

    private void InitializeChart()
    {
      series = new Points(tChart1.Chart);

      for (int i = 0; i < 10; i++)
      {
        double val = rnd.Next(0, 500);
        series.Add(i, val, i.ToString());
        //series.Add(i, val);
      }

      tChart1.Axes.Bottom.Labels.Angle = 90;
      MarksTip tool = new MarksTip(tChart1.Chart);
      tool.Style = MarksStyles.LabelValue;
      tool.Series = series;
      tChart1.Panel.MarginBottom = 20;
      tChart1.MouseMove += TChart1_MouseMove;
    }

    private double oldY = -1;
    private void TChart1_MouseMove(object sender, MouseEventArgs e)
    {
      int index = series.Clicked(e.GetPosition(tChart1));

      if(index > -1)
      {
        double x = series.XValues[index];
        double y = series.YValues[index];

        if(oldY != y)
        {
          series.Add(x, y, "this is a label");
          oldY = y;
        }
      }
    }
however, using neither of the series.Add() lines can I reproduce your problem (in this case adding in new points when mouse-overing old ones). Could you please modify the above code in some way so I can reproduce your problem here?
Best Regards,
Christopher Ireland / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Instructions - How to post in this forum

Jens Ramlow
Newbie
Newbie
Posts: 13
Joined: Fri Sep 22, 2017 12:00 am
Location: Berlin, Germany

Re: Preventing tooltip data from being added to the axis

Post by Jens Ramlow » Wed Oct 18, 2017 7:55 am

Hello Christopher,

Thank you for diving into the problem.
Occasionally, since implementing your hint from topic "Displaying every label on X-Axis" the effect is not longer available.

Code: Select all

foreach (DataRowView viewRowStation in viewStationTable)
//Create labels for stations on X_Axis
{
   Steema.TeeChart.WPF.AxisLabelItem item = MainChart.Axes.Bottom.Labels.Items.Add((int) viewRowStation.Row["StationID"], (string) viewRowStation.Row["StationName"]);
}
Probably there were a difficult mix of series, points, marks and lables TeeChart had to calculate for the X-axis labeling. With a manually added set of labels the calculation may freed up from this.
So, no need for further investigation here.

Yours, Jens

Post Reply