Jump to content
Software FX Community

showing correct tooltip when there is a bar and scatter series on one chart


nickm

Recommended Posts

Hi,

I have a combination chart containing 1 bar series and multiple scatter series. When a scatter series marker appears in the same area as the bar the tooltip information for the scatter marker can't be accessed. Only the bar tooltip appears. I have tried senttoback() on the bar series and sendtofront() on the scatter series but it made no difference. Is there a way to make this work?

 

cheers

Nick 

 

Link to comment
Share on other sites

I can't replicate the issue. In a combination chart with bar and scatter, I can see the tooltip of the scatter series as well. 

In a chart with 3 series, I set chart gallery to scatter and the last series to bar gallery.

Chart1.Data.Series = 3;

Chart1.Data.Points = 5;

Chart1.Gallery = Gallery.Scatter;

Chart1.Series[2].Gallery =

Gallery.Bar;

Make sure you have the latest service pack installed:

http://support.softwarefx.com/ProductBase.aspx?Product=CfxNet70

If you still have problems with the latest service pack, please provide some sample code.

Link to comment
Share on other sites

  • 2 weeks later...

The problem I am having is the tooltips for the scatter series do not appear only for points where the scatter series appear within the bar region. outside of that they appear.

I have version 7.0.2697.39876

 The code is below:

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using ChartFX.WebForms.Adornments;

using ChartFX.WebForms.Galleries;

using ChartFX.WebForms.Internal;

using ChartFX.WebForms.Annotation;

using System.Collections;

using System.ComponentModel;

using System.Drawing;

using System.Globalization;

using System.Web;

 

public partial class _Default : System.Web.UI.Page

{

// List<int> aList = new List<int>();

  protected ArrayList maxItems = new ArrayList();

  protected ArrayList mintols = new ArrayList();

  protected ArrayList maxtols = new ArrayList();

  protected ArrayList actuals = new ArrayList();

  protected ArrayList lastactuals = new ArrayList();

 

  protected void Page_Load(object sender, EventArgs e)

  {

 

  PopulateLists();

  Chart3.Points.Clear();

  int testCoiunt = Chart3.Series.Count;

  Chart3.Series[0].Text = "actual";

  Chart3.Series[0].Gallery = ChartFX.WebForms.Gallery.Scatter;

  Chart3.Series[0].Stacked = false;

  Chart3.Series[0].BringToFront();

  Chart3.Series[0].PointLabels.Visible = true;

  Chart3.Series[0].MarkerShape = ChartFX.WebForms.MarkerShape.Diamond;

  Chart3.Series[0].Color = Color.Blue;

  Chart3.Series[0].MarkerSize = 5;

  Chart3.Series[1].Text = "target";

  Chart3.Series[1].Gallery = ChartFX.WebForms.Gallery.Scatter;

  Chart3.Series[1].Stacked = false;

  Chart3.Series[1].MarkerShape = ChartFX.WebForms.MarkerShape.VerticalLine;

  Chart3.Series[1].Color = Color.Black;

  Chart3.Series[1].MarkerSize = 7;

  Chart3.Series[1].BringToFront();

  Chart3.Series[1].PointLabels.Visible = true;

  Chart3.Series[2].Text = "min tolerance";

  Chart3.Series[2].Gallery = ChartFX.WebForms.Gallery.Scatter;

  Chart3.Series[2].Stacked = false;

  Chart3.Series[2].MarkerShape = ChartFX.WebForms.MarkerShape.VerticalLine;

  Chart3.Series[2].Color = Color.DarkGray;

  Chart3.Series[2].MarkerSize =10;  

  Chart3.Series[3].Text = "max tolerance";

  Chart3.Series[3].Gallery = ChartFX.WebForms.Gallery.Scatter;

  Chart3.Series[3].Stacked = false;

  Chart3.Series[3].MarkerShape = ChartFX.WebForms.MarkerShape.VerticalLine;

  Chart3.Series[3].Color = Color.DarkGray;

  Chart3.Series[3].MarkerSize = 10;

  Chart3.Series[4].Text = "tech limit";

  Chart3.Series[4].Gallery = ChartFX.WebForms.Gallery.Scatter;

  Chart3.Series[4].Stacked = false;

  Chart3.Series[4].MarkerShape = ChartFX.WebForms.MarkerShape.VerticalLine;

  Chart3.Series[4].Color = Color.DarkRed;

  Chart3.Series[4].MarkerSize = 10;

  Chart3.Series[4].PointLabels.Visible = true;

 

  Chart3.Series[5].Gallery = ChartFX.WebForms.Gallery.Bar;

  Chart3.Series[5].FillMode = ChartFX.WebForms.FillMode.Gradient;

  Chart3.Series[5].BarShape = ChartFX.WebForms.BarShape.Cylinder;

 

  Chart3.AllSeries.Horizontal = true;

 

  Chart3.AxisX.Labels[0] = "well1";

  Chart3.AxisX.Labels[1] = "well2";

  Chart3.AxisX.Labels[2] = "well3";

  Chart3.AxisX.Labels[3] = "well4";

  Chart3.AxisX.Labels[4] = "well5";

  Chart3.AxisX.Labels[5] = "well6";

  Chart3.AxisX.Labels[6] = "well7";

  Chart3.AxisX.Labels[7] = "well8";

  Chart3.AxisX.Labels[8] = "well9";

  Chart3.AxisX.Labels[9] = "well10";

 

  ChartFX.WebForms.SeriesAttributes series = new ChartFX.WebForms.SeriesAttributes();

  for (int i = 0; i < maxtols.Count; i++)

  {

  int minTol = (int)mintols;

  int maxTol = (int)maxtols;

  int max = (int)maxItems;

  int actual = (int)actuals;

  int lastActual = (int)lastactuals;

  addSeries(series, i, minTol, maxTol, max, actual, lastActual);

  }

  }

private void addSeries(ChartFX.WebForms.SeriesAttributes series, int point, int minTol, int maxTol, int max, int actual, int lastActual)

  {

  int target = minTol + ((maxTol - minTol) / 2);

 

  Chart3.Data[0, point] = actual;

  Chart3.Data[1, point] = target;

  Chart3.Data[2, point] = minTol;

  Chart3.Data[3, point] = maxTol;

  Chart3.Data[4, point] = max;

  Chart3.Data.YFrom[5, point] = minTol;

  Chart3.Data[5, point] = maxTol;

 

  Annotations annots = new Annotations();

  Chart3.Extensions.Add(annots);

  AnnotationArrow arrow = new AnnotationArrow();

 

  if ((actual < minTol) || (actual > maxTol))

  {

  Chart3.Points[5, point].Color = Color.Red;

 

  }

  else

  {

  Chart3.Points[5, point].Color = Color.Green;

 

 

  }

  Chart3.Points[5, point].Color = Color.FromArgb(99, Chart3.Points[5,point].Color);

  Chart3.Points[6, point].Color = Color.FromArgb(99, Chart3.Points[6, point].Color);

 

  arrow.Border.Color = System.Drawing.Color.Blue;

  arrow.Color = System.Drawing.Color.Blue;

 

  if (lastActual > actual)

  {

  arrow.Height = 0;

  arrow.Width = 15;

  arrow.Attach(point + 1, actual + 30);

  }

  else

  {

  arrow.Height = 0;

  arrow.Width = -15;

  arrow.Attach(point + 1, actual - 30);

  }

 

}

  protected void PopulateLists()

  {

  maxItems.Add(12000);

  maxItems.Add(1000);

  maxItems.Add(500);

  maxItems.Add(1200);

  maxItems.Add(740);

  maxItems.Add(1200);

  maxItems.Add(1140);

  maxItems.Add(1150);

  maxItems.Add(1500);

  maxItems.Add(1590);

  mintols.Add(850);

  mintols.Add(250);

  mintols.Add(150);

  mintols.Add(200);

  mintols.Add(250);

  mintols.Add(400);

mintols.Add(200);

mintols.Add(100);

mintols.Add(200);

mintols.Add(250);

  maxtols.Add(852);

  maxtols.Add(550);

  maxtols.Add(300);

  maxtols.Add(300);

  maxtols.Add(500);

  maxtols.Add(1000);

  maxtols.Add(700);

  maxtols.Add(650);

  maxtols.Add(850);

  maxtols.Add(500);

  actuals.Add(150);

  actuals.Add(400);

  actuals.Add(350);

  actuals.Add(220);

  actuals.Add(400);

  actuals.Add(700);

  actuals.Add(400);

  actuals.Add(40);

  actuals.Add(400);

  actuals.Add(1400);

  lastactuals.Add(100);

  lastactuals.Add(300);

  lastactuals.Add(400);

  lastactuals.Add(200);

  lastactuals.Add(300);

  lastactuals.Add(850);

  lastactuals.Add(840);

  lastactuals.Add(810);

  lastactuals.Add(700);

  lastactuals.Add(400);

  }

}

Link to comment
Share on other sites

Tooltips seem to work fine even for points within the bar region. Update to the latest service pack (7.0.2845) and then try.

 Instead of setting the series gallery individually, set the gallery of the chart to scatter and the last series gallery to bar.

Chart1.Gallery = Gallery.Scatter;

Chart1.Series[5].Gallery =

Gallery.Bar;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...