RadChart.Save() does not save charting data

2 posts, 0 answers
  1. xav
    xav avatar
    15 posts
    Member since:
    Jul 2006

    Posted 27 Dec 2013 Link to this post

    I am using an older version of the RadControls (2011.3.1115.40). I would like to save the charts to jpeg format. I have a button on the form which invokes the following event: 

            protected void btnSaveChar_OnClick(object sender, EventArgs e)
            {
                RadChart1.Save(Server.MapPath("~/files/chart.jpg"), System.Drawing.Imaging.ImageFormat.Jpeg); 
            }

    This definitely saves the chart, but its a blank chart with the label "There is no or empty series". What do I need to do to save the chart as it is displayed on the webform? 

    Thanks! 
  2. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 30 Dec 2013 Link to this post

    Hello Xav,

    Thank you for writing.

    I tested the method you are using but there were no issues on my side. The chart was saved to the image with all the data inside it. I tested the case in both bound and unbound mode. An alternative approach you can try is the DrawToBitmap method. This method is inherited from Control and can be used for any control, here is how use it:
    Bitmap bmp = new Bitmap(this.radChart1.Width, this.radChart1.Height);
    this.radChart1.DrawToBitmap(bmp, new Rectangle(0, 0, bmp.Width, bmp.Height));
    bmp.Save(@"C:\chart.jpg");

    If this does not work as well, I would kindly ask you to send me your project or an example where you are able to reproduce this behavior so I can investigate the issue further.

    I hope this will be useful. Should you have further questions, I would be glad to help.

    Regards,
    Ivan Petrov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top