Page 1 of 1

How to Redraw/Save Web Chart with different Style Properties

Posted: Tue Jun 08, 2010 1:19 am
by 15655406
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

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

Posted: Wed Jun 09, 2010 9:09 am
by yeray
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");

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

Posted: Thu Jun 10, 2010 4:49 am
by 15655406
Many Thanks Yeray.