This is a migrated thread and some comments may be shown as answers.

[Solved] ChartArea.ItemClick

9 Answers 132 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Natália
Top achievements
Rank 1
Natália asked on 16 Aug 2010, 06:49 PM
Hi,

Can I create a window like a graph showing a tooltip when you click a point RadChart?

Thanks ...

9 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 19 Aug 2010, 07:51 AM
Hello Natália,

To see more information along the lines of the requested functionality, please refer to the following example:

http://demos.telerik.com/silverlight/#Chart/DrillDown

I hope this gets you started properly.

All the best,
Yavor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Natália
Top achievements
Rank 1
answered on 19 Aug 2010, 01:14 PM

Hello,

I can not access the link.
My browser displays the following error:

Detalhes dos erros da página da Web

Agente de Usuário: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)
Carimbo de data/hora: Thu, 19 Aug 2010 12:11:05 UTC

Mensagem: Unhandled Error in Silverlight 2 Application Object reference not set to an instance of an object.   em Telerik.Windows.QuickStart.SilverlightDeploymentManager.LoadAssemblyInDomain(Stream resultStram)
   em Telerik.Windows.QuickStart.SilverlightDeploymentManager.<>c__DisplayClass17.<LoadAssembly>b__16()
   em Telerik.Windows.QuickStart.LoaderService.ThreadSafeCallBack(Action callback)
   em Telerik.Windows.QuickStart.SilverlightDeploymentManager.LoadAssembly(Stream xapStream, String assemblyName)
   em Telerik.Windows.QuickStart.SilverlightDeploymentManager.<>c__DisplayClassf.<DownLoadRefAssemblies>b__c(OpenReadCompletedEventArgs e)
   em Telerik.Windows.QuickStart.SilverlightDeploymentManager.<>c__DisplayClass12.<StartDownload>b__11(Object sender, OpenReadCompletedEventArgs e)
   em System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e)
   em System.Net.WebClient.OpenReadOperationCompleted(Object arg)
Linha: 1 Caractere: 1 Código: 0
URI: http://demos.telerik.com/silverlight/

The page hangs in the introduction.
It may be lack of any requirement on my machine?

Must be like a Pop up

Thank you! 


0
Yavor
Telerik team
answered on 23 Aug 2010, 08:08 AM
Hello Natália,

Can you please revisit the page, and confirm whether the exception persists, or you are able to access the example as expected. It may have been a temporary issue, since the page is working as expected on my end.

Kind regards,
Yavor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Natália
Top achievements
Rank 1
answered on 23 Aug 2010, 12:31 PM
Ok ..
I can now access.

However, I would like the chart to be viewed in another window.

Thanks
...
0
Yavor
Telerik team
answered on 24 Aug 2010, 07:14 AM
Hi Natália,

The additional data is shown in a tooltip - can you please specify if you need this to be in a separate window, or if you have another behavior in mind. Any additional information will help me better address the question at hand.

Sincerely yours,
Yavor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Natália
Top achievements
Rank 1
answered on 24 Aug 2010, 02:45 PM
Hello

I need it in a separate window.
Where I can insert buttons to export the contents, for example.

Thanks
0
Yavor
Telerik team
answered on 26 Aug 2010, 08:24 AM
Hi Natália,

Most of the logic in the example to which I referred previously, is handled in the following method:

private void ChartItemToolTipOpening(ItemToolTip2D tooltip, ItemToolTipEventArgs args)
       {
           RadChart chart = new RadChart();
           chart.Height = 200;
           chart.Width = 300;
           chart.DefaultView.ChartLegend.Visibility = System.Windows.Visibility.Collapsed;
           chart.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Inside;
           string axisItemLabel = RadChart1.DefaultView.ChartArea.AxisX.TickPoints[args.ItemIndex].Label;
           chart.DefaultView.ChartTitle.Content = string.Format("Quarterly Preview: {0}", axisItemLabel);
           chart.DefaultView.ChartArea.AxisY.DefaultLabelFormat = "C";
           DataSeries series = new DataSeries();
           series.Definition = new LineSeriesDefinition();
           series.Definition.ShowItemLabels = false;
           SeriesExtensions.FillWithSampleData(series, 4, (int)args.DataPoint.YValue);
           string[] quarters = new string[] { "Q1", "Q2", "Q3", "Q4" };
           for (int i = 0; i < chart.DefaultView.ChartArea.AxisX.TickPoints.Count; i++)
               series[i].XCategory = quarters[i];
           for (int i = 0; i < series.Count; i++)
               quarterlyRevenues[i] = series[i].YValue;
           chart.DefaultView.ChartArea.DataSeries.Add(series);
           tooltip.Content = chart;
       }

Essentially, instead of showing a tooltip with the data, you can open a window:

http://demos.telerik.com/silverlight/#Window/Silverlight/PopupManager

which can contain additional information on the chart.
I hope this gets you started properly.

Greetings,
Yavor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Natália
Top achievements
Rank 1
answered on 26 Aug 2010, 01:13 PM
Thanks Yavor,

It is possible another chart within that window?
0
Yavor
Telerik team
answered on 31 Aug 2010, 11:37 AM
Hi Natália,

Indeed, you can dynamically create the control:

http://www.telerik.com/help/aspnet-ajax/stylingelements.html

and add it to another container. Let me know if any specific issues arise.

Kind regards,
Yavor
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Chart
Asked by
Natália
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Natália
Top achievements
Rank 1
Share this question
or