TChartBook->AddChart() returns NULL
Posted: Mon Feb 01, 2010 2:51 pm
I have a form in which I've placed a TChartBook component Data_Man_ChartBook. However, when I try to add a chart to this component using the following:
TCustomChart* tmp;
//Add a new chart to the Data_Man_ChartBook
Data_Man_ChartBook->AddChart();
Data_Man_ChartBook->ActivePageIndex = Data_Man_ChartBook->PageCount - 1;
tmp = Data_Man_ChartBook->ActiveChart();
tmp returns NULL. Any attempt to reference the chart, for example:
Data_Man_ChartBook->ActiveChart()->View3D = false;
gives an error.
What am I doing wrong?
TCustomChart* tmp;
//Add a new chart to the Data_Man_ChartBook
Data_Man_ChartBook->AddChart();
Data_Man_ChartBook->ActivePageIndex = Data_Man_ChartBook->PageCount - 1;
tmp = Data_Man_ChartBook->ActiveChart();
tmp returns NULL. Any attempt to reference the chart, for example:
Data_Man_ChartBook->ActiveChart()->View3D = false;
gives an error.
What am I doing wrong?