The problem is that, when the graph first appears, the axes are not scaled properly, as shown here:
I have put the code that adjusts the scales AND draws the circles is the chart's AfterDraw event handler:
Code: Select all
void __fastcall TGxGraphPaper::TeeChartAfterDraw(TObject *Sender)
{
if(auto plot = dynamic_pointer_cast<BoundaryElementContourPlot, TeeGraph>(contour_graph)) {
// adjust the axes
plot->MakeIsoAxis(); // THIS CALL ADJUSTS THE AXES
// draw the piles
if(auto analysis = dynamic_pointer_cast<const Repute::BoundaryElementAnalysis>(data))
plot->DrawPileGroup(*analysis.get()); // THIS CALL DRAWS THE CIRCLES
}
}
It is only when I move the mouse over the drawing that the graphs flashes and then displays the CORRECT drawing, without going through AfterDraw a second time.
Can anyone please explain what is happening here? What am I missing?
Thanks in advance.
Andrew Bond