Code: Select all
m_chart.Series(i).Add(series_val, x_axis_label, color);
m_chart.Series(i).GetAsLine();
From Release.txt:
January 2008
TeeChart Pro Activex Control v8
v8.0.0.3 Release
Any clue as to why this is happening?
Thanks,
John G[/code]
Code: Select all
m_chart.Series(i).Add(series_val, x_axis_label, color);
m_chart.Series(i).GetAsLine();
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Code: Select all
CTChartDlgDlg::CTChartDlgDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTChartDlgDlg::IDD, pParent)
, m_chart(0)
{
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
Code: Select all
void CTChartDlgDlg::InitializeTChart()
{
string pre_label("label");
stringstream label;
string pre_series("series");
stringstream series;
unsigned long color;
for(int i=0;i<3;i++) {
m_chart.AddSeries(CTchart1::scPoint);
series.str("");
series << pre_series << "_" << i;
((CSeries)m_chart.Series(i)).SetTitle(series.str().c_str());
for(int j=0;j<10;j++) {
label.str("");
label << pre_label << "_" << j;
color = ((CSeries)m_chart.Series(i)).GetColor();
((CSeries)m_chart.Series(i)).Add(j+i, label.str().c_str(), color);
}
}
// Everything works fine up to here and the chart displays the data points as expected.
// !!! This next call is where the "Invalid class typecast" message is generated.
CLineSeries a_line_series = ((CSeries)m_chart.Series(0)).GetAsLine();
}
Code: Select all
m_chart.AddSeries(0); //line series
m_chart.Series(0).FillSampleValues(5);
CLineSeries series = m_chart.Series(0).GetAsLine();
series.GetLinePen().SetWidth(5);
Code: Select all
println("hello world");
Of course that not, my code was just to check if the same one worked fine on your machine.I don't think that FillSampleValues(5) will do me much good. Are you saying that the code I'm using to populate the graph data is incorrect?