Visualization problems with Chart Pie

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
adhoc
Newbie
Newbie
Posts: 3
Joined: Mon Jul 07, 2003 4:00 am
Location: Italy
Contact:

Visualization problems with Chart Pie

Post by adhoc » Fri Feb 13, 2004 10:55 am

Hi from Italy! :wink:

I purchased a licensed TeeChart Pro for Visual Studio .NET.
When I use it in my Web Application, I have a problem with the Pie Chart.
In my ASPX page I see an image chart (created with .Export.Image.PNG.Save method) how this:

Image

but, if I refresh the page, sometime i see this image:

Image

Any idea?
Thanks

PS. I use latest binary version: 9/Feb/2004 1:11 AM, Build 1.1.1499.42325

PPS. forgive my translation.. :)

Marc
Site Admin
Site Admin
Posts: 1265
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Thu Feb 19, 2004 11:12 am

Hello,

I can't see an obvious reason for why this is happening. It may be that the code you're runnning is running more than once and creating 'space' for a 2nd Pie Series that shouldn't be there but that is thus making the first Series narrower.

If you have a code sample that you could post up or send us please do so, it will help us understand more clearly what is happening.

Regards,
Marc Meumann
Steema Support

adhoc
Newbie
Newbie
Posts: 3
Joined: Mon Jul 07, 2003 4:00 am
Location: Italy
Contact:

Post by adhoc » Sat Feb 21, 2004 11:02 am

Hi,
here's my code:

Code: Select all

void CreatePieChart() {
    DataSet ds = new DataSet();
    // populate the dataset ...
    // the dataset contain 1 table with 2 column: "PageName" and "TotView"
    if ( ds.Tables[0].Rows.Count > 0 ) {
        Chart myPieChart = new Chart();
        myPieChart.Aspect.Orthogonal = false;
        myPieChart.Aspect.Elevation = 380;
        myPieChart.Aspect.Rotation = 360;
        myPieChart.Aspect.View3D = true;
        myPieChart.Width = 300;
        myPieChart.Height= 170;
        myPieChart.Aspect.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
        myPieChart.Series.Add(new Steema.TeeChart.Styles.Pie());

        DataTable dt = ds.Tables[0];
        myPieChart.Series[0].YValues.DataMember = dt.Columns["PageName"].ToString();
        myPieChart.Series[0].DataSource = dt;
        myPieChart.Series[0].Marks.Visible = false;
        myPieChart.Series[0].Title = "title";
        myPieChart.Series[0].Depth = 25;
        ((Steema.TeeChart.Styles.Pie) myPieChart.Series[0]).Pen.Visible = false;

        // loop to set colors
        // myPieChart.Series[0].Colors[i] = ... ;

        myPieChart.Header.Text = "";
        myPieChart.Header.Font.Color = Color.White;
        myPieChart.Header.Pen.Visible = false;
        myPieChart.Panel.Color = Color.FromArgb(242, 241, 245);
        myPieChart.Panel.BevelWidth = 0;
        myPieChart.Legend.Visible = false;
        myPieChart.Export.Image.PNG.Save( strTempFileName );
    }
    ds.Clear();
}
strTempFileName is populate with Path.GetTempFileName() method (adding a ".png" extension).

Thanks :)

Marc
Site Admin
Site Admin
Posts: 1265
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Mon Feb 23, 2004 2:39 pm

Hello,

The problem appears to be related to paint order.

If the code is run with a visible Chart then there is no difference in the painted result. What appears to be happening in the case of the non-visible Chart is that the Aspect.Elevation and Rotation isn't set to be painted correctly without the Series being present. We'll take a look at why this might be happening but in the meantime the workaround is quite straightforward:

Place the Aspect lines after the Series add:

Code: Select all

myPieChart.Series.Add(new Steema.TeeChart.Styles.Pie()); 
myPieChart.Aspect.Elevation = 290; 
myPieChart.Aspect.Rotation = 355;
Regards,
Marc Meumann
Steema Support

adhoc
Newbie
Newbie
Posts: 3
Joined: Mon Jul 07, 2003 4:00 am
Location: Italy
Contact:

Post by adhoc » Tue Mar 02, 2004 9:36 am

Thank you very much!
I have resolved this problem.

Bye :)

Post Reply