ChartControl.Draw and ChartControl.DrawThumbnail not showing titles or legend

Hi

I have a column chart which has a couple of title lines and a legend box. I've written some code to FTP the image of the chart periodically. The bitmap that is created by ChartControl.Draw and/pr ChartControl.DrawThumbnail (I've tried both) only contains the actual chart area it does not contain the titles or the legend. How do I get the bitmap to include the titles and legend? (version 7.303.0.20)

3 Replies

VV Venkata Vijayaraj B Syncfusion Team September 25, 2009 10:45 AM UTC

Hi Matt,

Please use the below code to save the whole Chart with Title and Legend in bmp format.

//Filename with the location where you want to save the image.
string fileName = Application.StartupPath + "\\ExportChart";
string exportFileName = fileName + ".bmp";

//Saving chartImage.
chartControl1.SaveImage(exportFileName);

Let me know if this meets your requirement.

Regards,
Venkat.


MD Matthew Daniels September 25, 2009 12:23 PM UTC

Hi Venkat

That looks like it will just save an exact copy of the chart - but I need to be able to specify the dimensions of the bitmap. Eg. my chart might be 640x480 pixels in size, but I might just want a thumbnail of 200 pixels wide.


VV Venkata Vijayaraj B Syncfusion Team September 28, 2009 11:02 AM UTC

Hi Matt,

Sorry for the delay in responding.

We are not having support to mention the size of the image while saving Chart using SaveImage method, but this can be

done by using the following workaround.

Size currSize = chartControl1.Size;
chartControl1.Size = new Size(200, 200); // mention here the desired size.
chartControl1.SaveImage("MyChart.bmp");
chartControl1.Size = currSize;

Please let me know if this helps.

Regards,
Venkat.

Loader.
Up arrow icon