Jump to content
Software FX Community

Remove Section From Legend Box


DustinW

Recommended Posts

I need to place a link on each xaxis label that redirects to another page and to do that I put this code in:


  protected void Chart1_DataBound(object sender, EventArgs e)
  {
  Chart1.AxisX.Sections.Clear();
  for (int i = 1; i < 14; i++)
  {
  AxisSection asec = new AxisSection(i, i, Color.Transparent);
  asec.Text = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(Chart1.AxisX.Labels);
  asec.Link.Url = "charttraffic.aspx?lbl=" + Chart1.AxisX.Labels + "&type=" + ddl_renttype.SelectedValue;
  Chart1.AxisX.Sections.Add(asec);
  }
  }

 

but when I set the text for the AxisSection it appears on the LegendBox and I have not found any way to remove it, other than remove the asec.Text section but in doing that the tooltip just says "From 1 to 1".  Is there anyway to remove the sections from the LegendBox or another way of changing the Tooltip Text?

Link to comment
Share on other sites

  • 1 month later...

Hi DustinW

 

 

Chart FX will add the Axis Sections text automatically to the legend box.  I have found a way to remove them, please check following code.

 

 

LegendItemAttributes lia = new LegendItemAttributes();

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

chart1.LegendBox.ItemAttributes[chart1.AxisX.Sections] = lia;

lia.Visible = false;

 

 

-- Pipon

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