This question is locked. New answers and comments are not allowed.

Brett Robichaud
Top achievements
Rank 1
Brett Robichaud
asked on 07 Apr 2012, 01:20 AM
I'm using RadChart v2011.3.11.1219 with a .Net 4.0 WinForms app using VS 2010 sp1. In this app I am displaying a couple of charts, but I am wondering if it is possible to generate a line chart and save it to png without ever displaying the chart?
How would I go about doing that?
How would I go about doing that?
4 Answers, 1 is accepted
0
Hi Brett,
Here is a small example:
RadChart is never added to the form, but it is only used to generate the output image. You can find a more complex example of creating RadChart in code here. Once you have it configured and populated, you can call the Save method to export the chart to an image.
Best regards,
Ves
the Telerik team
Here is a small example:
public
MyForm()
{
InitializeComponent();
RadChart chart =
new
RadChart();
chart.DefaultType = Telerik.Charting.ChartSeriesType.Line;
chart.DataSource =
new
double
[] {2,3,4,3,4,3,4,5};
chart.DataBind();
chart.Save(
"C:\\mychart.png"
);
}
RadChart is never added to the form, but it is only used to generate the output image. You can find a more complex example of creating RadChart in code here. Once you have it configured and populated, you can call the Save method to export the chart to an image.
Best regards,
Ves
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0

Brett Robichaud
Top achievements
Rank 1
answered on 11 Apr 2012, 09:07 PM
Doh! That is about as simple as it gets. Thank you Ves!
0

Christophe
Top achievements
Rank 1
answered on 03 Mar 2016, 10:44 AM
Hi,
Is there a way to do this with the new RadHtmlChart for Asp.Net ?
Or should I use the "obsolete" RadChart if I want to generate the image without displaying the chart ?
Regards,
0
Hello Christophe,
concerns UI for WinForms. Please address your question in the ASP.NET AJAX forums to get proper advice: http://www.telerik.com/forums/aspnet-ajax
Regards,
Stefan
Telerik
concerns UI for WinForms. Please address your question in the ASP.NET AJAX forums to get proper advice: http://www.telerik.com/forums/aspnet-ajax
Regards,
Stefan
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items