StackedBar100SeriesDefinition tooltip

2 posts, 0 answers
  1. Jingying Wu
    Jingying Wu avatar
    22 posts
    Member since:
    Jul 2009

    Posted 29 Jul 2009 Link to this post

    I'm using 2 StackedBar100SeriesDefinition, one for pass, one for fail.
    How do i show on the tooltip that the percentage of pass and fail?
  2. Dwight
    Dwight avatar
    475 posts

    Posted 31 Jul 2009 Link to this post

    Hi Jingying Wu,

    Currently, the chart does not support such formatting. Here is a work-around you can use:
    public Page() 
        this.RadChart1.DefaultView.ChartArea.ItemToolTipOpening += new ItemToolTipEventHandler(ChartArea_ItemToolTipOpening); 
    private void ChartArea_ItemToolTipOpening(ItemToolTip2D tooltip, ItemToolTipEventArgs e) 
        DataSeriesCollection series = this.RadChart1.DefaultView.ChartArea.DataSeries; 
        double sum = 0; 
        for (int i = 0; i < series.Count; i++) 
            if (series[i].Count > e.ItemIndex) 
                sum += series[i][e.ItemIndex].YValue; 
        tooltip.Content = string.Format("{0:p2}",e.DataPoint.YValue / sum); 

    Let me know if you need further assistance.

    Kind regards,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top