We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Generate a Jpeg Graph without WindowsForm

Thread ID:

Created:

Updated:

Platform:

Replies:

95687 Jul 25,2010 11:37 PM Jul 28,2010 02:09 AM ASP.NET Web Forms (Classic) 1
loading
Tags: Chart
Yannick Nabrin
Asked On July 25, 2010 11:37 PM

Hello all,

I try to generate a simple graph directly in Jpeg (file format doesn't matter in fact) without using a windows form, but actually I'm not able to do it, and I can't find examples online.

Do you have an idea or an example to suggest me?

Thanks you in advance for all

Yann


Vijayabharathi K [Syncfusion]
Replied On July 28, 2010 02:09 AM

Hi Yann,

Thank you for using Syncfusion product.

You can generate a simple graph directly in jpeg using Console Application. The ChartSeries can be used to add the Points in Chart. You can then save the Chart as Image using “SaveImage” method. Please find the code snippet below to achieve this.

[C#]


static void Main(string[] args)
{
ChartControl obj =new ChartControl();
ChartSeries series = obj.Model.NewSeries("Series");
series.Text = series.Name;

Console.WriteLine("Generated a Chart directly in Jpeg Format");

series.Points.Add(1, 400);
series.Points.Add(2, 385);
series.Points.Add(3, 412);
series.Points.Add(4, 467);
series.Points.Add(5, 478);
series.Points.Add(6, 397);
series.Points.Add(7, 355);
series.Points.Add(8, 456);
series.Points.Add(9, 409);

series.Type = ChartSeriesType.Column;
obj.Series.Add(series);

obj.SaveImage("simple.jpg");
System.Diagnostics.Process.Start("simple.jpg");

}


Also, to make your work easier I have created a simple sample and it can be downloaded from the link below.

SimplejpgGraph1829016681.zip

Please let me know if you have concerns

Regards,
Vijayabharathi K



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;