Page 1 of 1

Pie Chart Sizing and Printing Issue

Posted: Wed Feb 01, 2006 3:44 pm
by 9787319
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!

Posted: Thu Feb 02, 2006 12:56 pm
by narcis
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?

Posted: Thu Feb 02, 2006 2:26 pm
by 9787319
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.

Similar...

Posted: Thu Feb 02, 2006 4:58 pm
by 9787319
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"?

Posted: Fri Feb 03, 2006 8:53 am
by narcis
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;				
			}
		}