Pie Chart Sizing and Printing Issue

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
ssundoro
Newbie
Newbie
Posts: 10
Joined: Wed Jun 22, 2005 4:00 am
Contact:

Pie Chart Sizing and Printing Issue

Post by ssundoro » Wed Feb 01, 2006 3:44 pm

1. I'm having a small but annoying problem. I can't seem to turn off the label
for a pie chart - longer labels squishes the pie (because the Web Chart is
set to a certain width).

For example, the labels "Test" or "Approved" is fine, and the pie is a perfect circle.
But longer column labels like "Approved by Manager" squiches the pie - it
looks like an oval.

What property do I need to set?

Pie pie1 = new Steema.TeeChart.Styles.Pie(WebChart1.Chart);
pie1.YValues.DataMember = dt.Columns["Counter"].ToString();
pie1.LabelMember = dt.Columns[0].ToString();
pie1.ColorEach=true;
pie1.DataSource = dt;



2. Teecharts will not print....I get a red X on the print job. Is there
anything I have to do to enable printing?

My TempChart property is "Session"


Thanks in advance!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Feb 02, 2006 12:56 pm

Hello,
1. I'm having a small but annoying problem. I can't seem to turn off the label
for a pie chart - longer labels squishes the pie (because the Web Chart is
set to a certain width).

For example, the labels "Test" or "Approved" is fine, and the pie is a perfect circle.
But longer column labels like "Approved by Manager" squiches the pie - it
looks like an oval.

What property do I need to set?

Pie pie1 = new Steema.TeeChart.Styles.Pie(WebChart1.Chart);
pie1.YValues.DataMember = dt.Columns["Counter"].ToString();
pie1.LabelMember = dt.Columns[0].ToString();
pie1.ColorEach=true;
pie1.DataSource = dt;
You have a couple of options to solve that:

1) Setting pie1.Circled property to true.
2) Making series marks having multiple lines if they have a blank space using the OnGetSeriesMark event.

Here you have an example using both options:

Code: Select all

		private void Page_Load(object sender, System.EventArgs e)
		{
			Steema.TeeChart.Styles.Pie pie1 = new Steema.TeeChart.Styles.Pie(WebChart1.Chart); 

			pie1.Circled=true;
			
			pie1.Add(5,"Approved");
			pie1.Add(7,"Tested");
			pie1.Add(3,"Approved by Manager");
			pie1.Add(8,"Pending");

			pie1.GetSeriesMark+=new Steema.TeeChart.Styles.Series.GetSeriesMarkEventHandler(pie1_GetSeriesMark);			
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
			this.Load += new System.EventHandler(this.Page_Load);

		}
		#endregion

		private void pie1_GetSeriesMark(Steema.TeeChart.Styles.Series series, Steema.TeeChart.Styles.GetSeriesMarkEventArgs e)
		{
			string MultiLineStr = e.MarkText.Replace(" ","\n");
			e.MarkText = MultiLineStr;
		}
2. Teecharts will not print....I get a red X on the print job. Is there
anything I have to do to enable printing?

My TempChart property is "Session"
Do you also get a "red X" when doing a print previews? Do you have the WebChart in the browser as an image so that you can click it with the right-mouse button and, for example, print it?
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

ssundoro
Newbie
Newbie
Posts: 10
Joined: Wed Jun 22, 2005 4:00 am
Contact:

Post by ssundoro » Thu Feb 02, 2006 2:26 pm

Yes, I get the red X on print previews as well. Isn't that weird? And it IS an image.

Maybe it is my browser. I will check on another box.

Thanks again for your help Narcis.

ssundoro
Newbie
Newbie
Posts: 10
Joined: Wed Jun 22, 2005 4:00 am
Contact:

Similar...

Post by ssundoro » Thu Feb 02, 2006 4:58 pm

I'd like to do the same (convert "test label" to "test"<carriage return>"label") to the column labels, I'm sure it's possible.

Would I be accessing "GetXorizAxis"?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Fri Feb 03, 2006 8:53 am

Hi,

No, you need to use the OnGetAxisLabel event as done here:

Code: Select all

		private void WebChart1_GetAxisLabel(object sender, Steema.TeeChart.GetAxisLabelEventArgs e)
		{
			if (sender=WebChart1.Chart.Axes.Bottom)
			{
				string MultiLineStr = e.LabelText.Replace(" ","\n");
				e.LabelText = MultiLineStr;				
			}
		}
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply