Standard Legend Problem

2 posts, 0 answers
  1. Fabrice
    Fabrice avatar
    7 posts
    Member since:
    Apr 2012

    Posted 09 Oct 2013 Link to this post

    I have an Question, about standard Legend for RadChart.

    How can I change it (Color: Blue from Anzahl Gesamt: 438) that’s the Column from my DataTable. I want to have my custom legend but I can’t remove the standard Legend Item


    Can you help me ?


  2. Petar Kirov
    Petar Kirov avatar
    425 posts

    Posted 14 Oct 2013 Link to this post

    Hi Fabrice,

    You can use RadChart's BeforeLayout event to clear the auto-generated legend items and add custom ones. Here's an example:
    this.RadChart1.BeforeLayout += RadChart1_BeforeLayout;
    void RadChart1_BeforeLayout(object sender, EventArgs e)
        this.RadChart1.Legend.AddCustomItemToLegend("Custom legend item 1",
            new Telerik.Charting.Styles.FillStyle(Color.Red, Telerik.Charting.Styles.FillType.Solid), "Ellipse");
        this.RadChart1.Legend.AddCustomItemToLegend("Custom legend item 2",
            new Telerik.Charting.Styles.FillStyle(Color.Blue, Telerik.Charting.Styles.FillType.Solid), "Ellipse");
        this.RadChart1.Legend.AddCustomItemToLegend("Custom legend item 3",
            new Telerik.Charting.Styles.FillStyle(Color.Green, Telerik.Charting.Styles.FillType.Solid), "Ellipse");
        this.RadChart1.Legend.AddCustomItemToLegend("Custom legend item 4",
           new Telerik.Charting.Styles.FillStyle(Color.Orange, Telerik.Charting.Styles.FillType.Solid), "Ellipse");

    Petar Kirov
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  3. DevCraft R3 2016 release webinar banner
Back to Top