How to Redraw/Save Web Chart with different Style Properties

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
iEnergy
Newbie
Newbie
Posts: 19
Joined: Thu Mar 11, 2010 12:00 am

How to Redraw/Save Web Chart with different Style Properties

Post by iEnergy » Tue Jun 08, 2010 1:19 am

Hi,

I am using TeeChart for ASP.NET. How do I export and save a chart that would have different style properties.

example
First chart to be generated should have width and height of 200 while second chart will have width and height of 1000 and 800.

Code: Select all

                guid = Guid.NewGuid().ToString();
                fileName = guid + ".png";
                largePicFileName = guid + "large" + ".png";

                webChart.Chart.Export.Image.PNG.Save(_chartPath + fileName);

                _webChart.Width = new Unit(1000);
                _webChart.Height = new Unit(800);

                webChart.Chart.Export.Image.PNG.Save(_chartPath + largePicFileName);
The above code does not work and renders the size and with similar to the first saved image.

Thanks

Yeray
Site Admin
Site Admin
Posts: 9614
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: How to Redraw/Save Web Chart with different Style Properties

Post by Yeray » Wed Jun 09, 2010 9:09 am

Hi iEnergy,

I think you are looking for the PNG.Width and PNG.Height properties.
The following seems to work fine here:

Code: Select all

            tChart1.Export.Image.PNG.Width = 200;
            tChart1.Export.Image.PNG.Height = 200;
            tChart1.Export.Image.PNG.Save(@"C:\tmp\test_small.png");

            tChart1.Export.Image.PNG.Width = 1000;
            tChart1.Export.Image.PNG.Height = 800;
            tChart1.Export.Image.PNG.Save(@"C:\tmp\test_big.png");
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

iEnergy
Newbie
Newbie
Posts: 19
Joined: Thu Mar 11, 2010 12:00 am

Re: How to Redraw/Save Web Chart with different Style Properties

Post by iEnergy » Thu Jun 10, 2010 4:49 am

Many Thanks Yeray.

Post Reply