Jump to content
Software FX Community

Legend lines disappearing for Custom Legend Items when rendering with .NET


Recommended Posts

I have attached an example VS2005 project to duplicate this issue.

We have a web application where we chart various data points and then add custom grid lines for each occurrence of an alarm. Each type of alarm has a different name but each alarm type can have a custom grid line for each occurrence shown at specific date times. This can result in multiple custom grid lines with the same name. When we display the legend ChartFX automatically adds a legend item for every custom grid line (See the example without the "Custom Gridlines" checkbox checked). For our application, we should only show one legend item for each type of alarm.

We did not find an easy method to hide the duplicate named legend items for the custom grid lines. As far as we can tell, ChartFX displays all of the legend items for the custom grid lines or none of them. The following code hides all of the legend items for the custom grid lines (this code executes in the example when the "Custom Gridlines" checkbox is checked).

ChartFX.WebForms.LegendItemAttributes legendItem = new ChartFX.WebForms.LegendItemAttributes();legendItem.Visible = false;chartTrends.LegendBox.ItemAttributes[chartTrends.AxisX.CustomGridLines] = legendItem;

To get a legend item displayed for each type of alarm we added a custom legend item for each alarm type with the following code.

ChartFX.WebForms.CustomLegendItem legendPressureAlarm = new ChartFX.WebForms.CustomLegendItem();legendPressureAlarm.ShowLine = true;legendPressureAlarm.MarkerShape = ChartFX.WebForms.MarkerShape.None;legendPressureAlarm.Text = "Pressure Alarm";legendPressureAlarm.Color = chartTrends.Series[0].Color;legendPressureAlarm.Attributes.Line.Style = System.Drawing.Drawing2D.DashStyle.Dot;legendPressureAlarm.Attributes.Line.Width = 2;chartTrends.LegendBox.CustomItems.Add(legendPressureAlarm);

This works great in Png and Png Interactive (AJAX) rendering modes. We get the exact results that we need. We get a dotted line with about 5 dots and then the Alarm type text. In the .NET rendering mode it does not display the same as the other two rendering modes. The text is displayed but we do not see the dotted line.

  1. Is there a better method to hide the duplicate legend items for the custom grid lines when they are added automatically by ChartFX? Can each duplicate legend line be hidden as the custom grid lines are added?
  2. Is there a better method to get the functionality we need?
  3. When I add custom legend items why does the .NET rendering mode only show the text and not the line? Png and Png Interactive (AJAX) both show the line and the text. Can this problem be fixed?

Thank you.

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

This particular bug is not a high priority so it will not prompt a Service Pack on its own.

We release service packs when there is either a crucial bug/security issue we find or after a number of low level bugs get fixed. We don't have many bugs fixed in the current HotFix so there is no immediate plans for releasing a Service Pack.

 You can always get the HotFix from support.

Link to comment
Share on other sites

  • 3 weeks later...

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.

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...