This is a migrated thread and some comments may be shown as answers.

Generate chart image without displaying the chart

4 Answers 280 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
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?

4 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 11 Apr 2012, 09:02 AM
Hi Brett,

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
Stefan
Telerik team
answered on 03 Mar 2016, 10:57 AM
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
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
Tags
Chart (obsolete as of Q1 2013)
Asked by
Brett Robichaud
Top achievements
Rank 1
Answers by
Ves
Telerik team
Brett Robichaud
Top achievements
Rank 1
Christophe
Top achievements
Rank 1
Stefan
Telerik team
Share this question
or