Why get a wrong Pie Chart ?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Nov 25, 2003 9:35 pm

You should do a repaint before the Chart is saved. You can use the Invalidate method :

tChart.Invalidate();
tChart.Chart.Export.Image.PNG.Save("C:\\test.png");

Josep Lluis Jorge
http://support.steema.com

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Nov 26, 2003 12:29 pm

Using the following code works fine (use Series.Add to add the Series to the Chart) :

Code: Select all

			Steema.TeeChart.Chart tChart = new Steema.TeeChart.Chart(); 
			tChart.Width = 600; 
			tChart.Height= 400; 
			tChart.Header.Visible = false; 
			tChart.Panel.Gradient.Visible = true; 
			tChart.Series.Clear(); 
			tChart.Legend.ResizeChart = true; 
			tChart.Legend.Symbol.Squared = true;  

			Steema.TeeChart.Styles.Pie tPie = new Steema.TeeChart.Styles.Pie(); 
			tChart.Series.Add(tPie);
//			Steema.TeeChart.Styles.Series tSeries = tChart.Series[0]; 
			tPie.PercentFormat = "###0%"; 
			tPie.CustomXRadius = 0; 
			tPie.CustomYRadius = 0; 

			tPie.Marks.Transparent = true; 
			tPie.ShowInLegend = true; 
			tChart.Legend.TextStyle = Steema.TeeChart.LegendTextStyles.Plain; 
			tPie.Marks.Style = Steema.TeeChart.Styles.MarksStyles.LabelPercent; 

			tPie.FillSampleValues(10); 
			tChart.Invalidate();  
			tChart.Chart.Export.Image.PNG.Save("C:\\test.png"); 

Josep Lluis Jorge
http://support.steema.com

Post Reply