Completed
Last Updated: 12 Feb 2020 12:01 by ADMIN
Release R1 2020 SP1
TRANSEPT
Created on: 06 Feb 2020 09:19
Category: ChartView
Type: Bug Report
1
RadChartView: Tooltips are not showing correctly when more than one series

When you have BarSeries and LineSeries in RadChartView the problem is that the DataPoint.Presenter is always BarSerries, never LineSeries. 

To workaround, create custom renderer:

this.radChartView1.CreateRenderer += this.RadChartView1_CreateRenderer;
private void RadChartView1_CreateRenderer(object sender, ChartViewCreateRendererEventArgs e)
{
    e.Renderer = new CustomCartesianRenderer(e.Area as CartesianArea);
}

public class CustomCartesianRenderer : CartesianRenderer
{
    public CustomCartesianRenderer(CartesianArea area)
        : base(area)
    { }
    public override DataPoint HitTest(int x, int y)
    {
        for (int i = this.DrawParts.Count - 1; i >= 0; i--)
        {
            DataPoint dataPoint = this.DrawParts[i].HitTest(new Point(x, y));
            if (dataPoint != null)
            {
                return dataPoint;
            }
        }

        return base.HitTest(x, y);
    }
}
Attached Files:
0 comments