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

toolTip not updating correctly

2 Answers 49 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 20 Aug 2010, 11:02 PM
I have a drill-down chart that starts as a CandleStick and the toolTip brings up a Line chart.  My problem is that I am pulling my data from a web service, and I am not getting the correct data when I put my mouse over a "candle stick".  On the first try I will get "No Data Series", and no matter what "candle stick" I put my mouse over next I will get the data for the first one I moused over.

private void ChartItemToolTipOpening(ItemToolTip2D tooltip, ItemToolTipEventArgs args)
      {
          ServiceReference1.WebService1SoapClient getDrill = new ServiceReference1.WebService1SoapClient();
          getDrill.drillCompleted += new EventHandler<ServiceReference1.drillCompletedEventArgs>(getDrill_drillCompleted);
          getDrill.drillAsync(args.ItemIndex+1);
 
          chart.Height = 200;
          chart.Width = 300;
          chart.DefaultView.ChartLegend.Visibility = System.Windows.Visibility.Collapsed;
          chart.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Inside;
          chart.DefaultView.ChartTitle.Content = "Detail View";
 
          LineSeriesDefinition LineSer = new LineSeriesDefinition();
          chart.DefaultSeriesDefinition = LineSer;
          chart.ItemsSource = tempChart.ItemsSource;
          tooltip.Content = chart;
      }
void getDrill_drillCompleted(object sender, ServiceReference1.drillCompletedEventArgs e)
       {
           tempChart.ItemsSource = e.Result;
       }

Now, I have tried clearing the tempChart and the chart with a ToolTipClosing event.  I have tried to put a delay on showing the ToolTip to make sure it did not have to do with the amount of time it took to get the data.  I am kind of at a loss, because I have spent way too much time on something like this.

If you have any suggestions, please let me know.
Thanks,

D.

P.S.  I am bad at putting my problems into words, if you don't understand what is going on, let me know and I will try to make it clearer.

2 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 25 Aug 2010, 11:53 AM
Hello Derek,

Could you, please, elaborate a bit more on your specific scenario. From the provided information is it not clear what the difference between chart and tempChart is. Perhaps the reason for not displaying the actual data is because the source is not bound to the correct chart. Another tip would be to check whether args.ItemIndex+1 from this event
getDrill.drillCompleted += new EventHandler<ServiceReference1.drillCompletedEventArgs>(getDrill_drillCompleted);
          getDrill.drillAsync(args.ItemIndex+1);

returns the correct index. Also, in order to verify if the issue is with the data source, you could try connecting it to a grid ( instead of RadChart ) and see if all data is indeed intact, as RadChart simply displays the data that it's bound to.

If you still experience the same problem, it would be very helpful for us if you're able to provide more information or attach a sample application that would help us find more about your specific scenario and provide further assistance.

All the best,
Nikolay
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
Derek
Top achievements
Rank 1
answered on 25 Aug 2010, 02:11 PM
Nikolay,

I was able to figure out my problem.  Calling the getDrill.drillAsync(args.ItemIndex+1) was still running when I attempted to put the information into my chart.  I needed to pull most of the code out of the CharItemToolTipOpening event and move it to the getDrill_DrillCompleted event.  I believe this had to do with the asynchronous call to my web service.

Thank you for your reply.
Tags
Chart
Asked by
Derek
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Derek
Top achievements
Rank 1
Share this question
or