Page 1 of 1

Aspect Ratios of Pie charts on wide format monitors

Posted: Tue Dec 12, 2006 4:27 pm
by 9082339
Pie charts on wide screen format screens are displayed as ellipses for certain screen resolution even when I use the property (.asPie.Circled = True). For example 800x600 = "pie ok"; 1024x600 = "elliptical pie"; 1024x768 = "pie ok"; 1280x768 = "elliptical pie".

I can send screenshots if needed.

Thanks for your help.

Using TeeChart Pro v6.0.0.5

Posted: Mon Dec 18, 2006 9:47 am
by 9082339
Dear Steema Support,

Could you please respond to my question?

Thanks

Posted: Mon Dec 18, 2006 11:25 am
by 9082339
I have now tested the problem on other wide format monitors and the result is the same, the pie chart does not appear as a circle, it is elliptical. For example the Dell 24 inch (2407WFP) Monitor, HP Notebook Pavilion zd7000 and Sony Vaio PCG-TR5MP. Would you like me to send some screen shots? Have you been able to reproduce the problem in-house?

Posted: Thu Dec 21, 2006 10:31 am
by 9082339
Dear Steema Support,

Have you identified what the problem is? Is it a bug? If so when can we expect it fixed?

Posted: Thu Dec 21, 2006 10:42 am
by narcis
Dear psc,

This is not currently supported as Circled property seems not to consider the screen resolution ratio to draw itself properly. We have added your request to our wish-list to be considered for inclusion in future releases.

In the meantime, the only way I can think of is manually setting pie's XRadius and YRadius (TChart1.Series(0).asPie.XRadius and TChart1.Series(0).asPie.YRadius) properties according to the screen resolution.

Posted: Thu Dec 21, 2006 10:47 am
by 9082339
Would it be possible for to provide a code sample for this? I am resizing the form so it is not obvious what the radius should be.

Thanks.

Posted: Thu Dec 21, 2006 12:19 pm
by narcis
Hi psc,

You can modify pie radius using something like the code below and then apply screen resolution as told in one of those pages:

http://www.freevbcode.com/ShowCode.asp? ... NoBox=True
http://www.newton.dep.anl.gov/askasci/comp99/CS029.htm

Code: Select all

Private Sub Form_Load()
    TChart1.Series(0).FillSampleValues 5
    TChart1.Series(0).asPie.Circled = False
End Sub

Private Sub Form_Resize()
    Me.TChart1.Width = Me.Width
    Me.TChart1.Height = Me.Height
    TChart1.Environment.InternalRepaint
End Sub

Private Sub TChart1_OnAfterDraw()
    
    With TChart1.Series(0).asPie
        
        If .XRadius < .YRadius Then
            .YRadius = .XRadius
        Else
            .XRadius = .YRadius
        End If
    End With
    
End Sub

Posted: Thu Dec 21, 2006 1:26 pm
by 9082339
Hi Narcis,

That example does not work. It seems every time you set the radius in the event the chart seems to draw itself again as an ellipsce and resets the radius resulting in the chart getting smaller and smaller till it dissapears. The behaviour on a "non wide screen monitor" is fine and the pie only dissappears on a wide format monitor.

Posted: Thu Dec 21, 2006 4:12 pm
by narcis
Hi psc,

That's why you should add support for wide screen resolution here as shown in one of the websites I posted.