Chart width

TeeChart for ActiveX, COM and ASP
Post Reply
Ninj
Newbie
Newbie
Posts: 17
Joined: Wed Jun 16, 2004 4:00 am
Location: Singapore

Chart width

Post by Ninj » Mon Jul 12, 2004 8:27 am

Hi,

I have been trying to coordinate the width of two charts. Chart A have the legend on, while Chart B don't.
I need to change the width of Chart B so that it will look like both Chart A and B have the same width, but without the legend(for chart B).
I have been trying to resize Chart B through this code:

TChartB.Width = TChartA.Width - (LegendRect * TwipsPerPixelY)

where LegendRect is the width of the legend rectangle.

However, I noticed that even after I step through this line, the width of the chart doesn't change (even if the return value of ChartA width and legend rect width is different from the original ChartB width). ChartB retains its old width.

Am I doing this correctly or is there any other way to change the width of the chart.

Thanks

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

Post by Pep » Mon Jul 12, 2004 11:14 am

Hi,

what are you trying to change , the panel or the ChartRect width ?
In case you want o have the same ChartRect for both Chart then the best thing you can do is align them using the Chart Margins, for example set the same right margind for both Charts :
tChart1.Panel.MarginRight = 10
tChart2.Panel.MarginRight = 10 + LegendRect

Post Reply