Hello Matt,
BARMatt wrote:Okay, I've finally stopped dancing long enough to reply. Yeray, you are my hero. I've been fiddling with this off and on for ages, trying to find the right combination of function calls, metrics, and math to do exactly what your snippet does. Thanks a million!
What can I say... I'm really thankful to hear I helped you.
BARMatt wrote:I still get the other problem I described though; setting the ChartRect once results in those values being used every time.Image 1 is what happened when I aligned the plots the first time. Perfect. Image 2 is what happened after I turned off the alignment, resized the window, then aligned again. As you can see, the "After" part of Image 2 put the plots in the same position as the "After" part of Image 1. However, the ChartRect calls in both cases look correct:Image 1:m_topPlot.ChartRect(65, 8, 702, 187);m_midPlot.ChartRect(23, 8, 617, 187);m_btmPlot.ChartRect(23, 8, 716, 187);Image 2:m_topPlot.ChartRect(73, 7, 942, 156);m_midPlot.ChartRect(31, 7, 857, 156);m_btmPlot.ChartRect(31, 7, 956, 156);
I'm afraid I haven't been able to find a solution for this so I've added it to the wish list to be investigated further (TV52015549).
I've seen in TeeProcs, line 1582, there is:
Code: Select all
if CustomChartRect and IsRectEmpty(ICachedChartRect) then
ICachedChartRect:=ChartRect;
If you change the above for the following the initial problem seems fixed:
Code: Select all
if CustomChartRect and (IsRectEmpty(ICachedChartRect) or (not EqualRect(ICachedChartRect, ChartRect))) then
ICachedChartRect:=ChartRect;
However, resizing a chart with a modified ChartRect makes the chart to become smaller and smaller. So they don't seem to be good fixes enough.
Note that the references to TeeProcs.pas make reference to TeeChart VCL sources. As TeeChart ActiveX is a wrapper from the VCL version, as soon as this will be modified in the VCL sources the modification will be inherited in the next ActiveX build.