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. Image for the cookie policy date
close icon

Generate a Jpeg Graph without WindowsForm

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


1 Reply

VK Vijayabharathi K Syncfusion Team July 28, 2010 06:09 AM UTC

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



Loader.
Live Chat Icon For mobile
Up arrow icon