Other figures to the Legend

Thread is closed for posting
3 posts, 0 answers
  1. Paulo
    Paulo avatar
    56 posts
    Member since:
    Apr 2012

    Posted 25 Jun 2012 Link to this post

     

    I have a graph with 8 series. Four bars and four line series. I need to add a new figure to the legends of line graphics and only them. How do I add new pictures?

    The bars series, I use a rectangle, but the Line series other figure. Figures that do not belong to the list.

    Is posible to add new Figures to a Legend? Is posible?
    Thanks for all.
  2. Paulo
    Paulo avatar
    56 posts
    Member since:
    Apr 2012

    Posted 25 Jun 2012 Link to this post

    I did so and did not work:

    radChart1.Legend.AddCustomItemToLegend("Serie5", new Telerik.Charting.Styles.FillStyle(),"~/App_Themes/Default/Imagens/lupa.png");

    Image does not load.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Peshito
    Admin
    Peshito avatar
    497 posts

    Posted 28 Jun 2012 Link to this post

    Hello,

    Try attaching to chart's BeforeLayout event and then set the picture you'd like to use as a custom figure like this:
    radChart.BeforeLayout += new EventHandler<EventArgs>(radChart_BeforeLayout);
    void radChart_BeforeLayout(object sender, EventArgs e)
        {
            radChart.Legend.Items[0].Marker.Appearance.Figure = "Rectangle";
            radChart.Legend.Items[1].Marker.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Image;
            radChart.Legend.Items[1].Marker.Appearance.FillStyle.FillSettings.BackgroundImage = "C:\\Pictures\\ChartImage.png";
        }
    Using this approach should set a custom image as a legend item marker.

    Hope this helps.

    Kind regards,
    Peshito
    the Telerik team
    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 their blog feed now.
Back to Top