Profile Picture

Setting URL for the whole chart control

Posted By Nivedita Swaminathan 15 Years Ago
Author
Message
Nivedita Swaminathan
cry Posted 15 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Last Active: 15 Years Ago
Posts: 1, Visits: 1
Can you please help me on setting the url for the whole bar chart.

I have used a barchart and i could set the url for each series in the chart. Now there is a requirement that whole chart needs to be assigned a url. Could you please help me .

bob milanov
Posted 15 Years Ago
View Quick Profile
Supreme Being

Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)Supreme Being (152 reputation)

Group: Forum Members
Last Active: 6 Months Ago
Posts: 153, Visits: 11

Hi Nivedita,

In order to apply a tooltip to a chart (and all it's children) you can use a dom tree enumerator. It will basically traverse all elements contained in the chart - that is walls, axes, series etc. The following code snippet snow how to accomplish this:

using Nevron.Filters;
using Nevron.Dom;
using Nevron.GraphicsCore;
using Nevron.Chart;
using Nevron.Chart.WinForm;

...

private void Form1_Load(object sender, EventArgs e)
{
  NChart chart = nChartControl1.Charts[0];
  NBarSeries bar = new NBarSeries();
  bar.Values.Add(10);
  bar.Values.Add(20);
  bar.Values.Add(30);
  chart.Series.Add(bar);

  ApplyInteractivity(chart, new NInteractivityStyle("Some Tooltip"));
  nChartControl1.Controller.Tools.Add(
new NTooltipTool());
}

public void ApplyInteractivity(NChart chart, NInteractivityStyle interactivity)
{
  // enumerate all panels
  NNodeTreeEnumerator enumerator = new NNodeTreeEnumerator((INNodeContainer)chart, new NInstanceOfTypeFilter(typeof(NChartElement)), -1, TreeTraversalOrder.BreadthFirst);

  while (enumerator.MoveNext())
  {
    NChartElement element = enumerator.Current as NChartElement;
    if (element == null)
      continue;

    INAttributeContainer attributeContainer = element as INAttributeContainer;
    if (attributeContainer == null)
      continue;

    INAttribute attribute = attributeContainer.GetAttributeByName("InteractivityStyle");
    if (attribute != null)
    {
     attributeContainer.SetAttributeByName(
"InteractivityStyle", (INAttribute)interactivity.Clone());
    }
  }
}

Hope this helps - let me know if you meet any problems.

Best regards,
Bob





Similar Topics


Reading This Topic