Loading Bar chart with lots of data
Posted: Sun Dec 11, 2005 2:50 am
I have created two grahs on a same chart. The top one is a price chart (OHLC) and the bottom is the volume (BAR chart). when I load the chart with 500 sets of data I don't have any problems, however when I load it with more that 1500 set of data the last volume bar does not dispay !!!
I codeing in C++ and I'm using the version 6.0.0.6
Here is the code I used to create my bar chart:
Here is the code I'm using to load the data:
I codeing in C++ and I'm using the version 6.0.0.6
Here is the code I used to create my bar chart:
Code: Select all
m_cTChart.AddSeries(scBar);
m_cTChart.Series(VOL_SER).SetHorizontalAxis(aBottomAxis);
m_cTChart.Series(VOL_SER).SetVerticalAxisCustom(0);
m_cTChart.Series(VOL_SER).GetMarks().SetVisible(false);
m_cTChart.Series(VOL_SER).GetAsBar().SetBarWidth(0);
m_cTChart.Series(VOL_SER).GetAsBar().SetBarWidthPercent(100);
m_cTChart.Series(VOL_SER).GetPen().SetWidth(0);
m_cTChart.Series(VOL_SER).GetPen().SetStyle(psClear);
m_cTChart.Series(VOL_SER).GetPen().SetVisible(true);
m_cTChart.Series(VOL_SER).GetPen().SetEndStyle(esFlat);
Code: Select all
while( !rs.IsEOF( ) )
{
for( int rowCount = 0;
rowCount < (int)rs.GetRowsFetched();
rowCount++ )
{
m_cTChart.Series(PRICE_SER).GetAsCandle().AddCandle(rowCount+j,
rs.m_Open_blk[rowCount],
rs.m_High_blk[rowCount],
rs.m_Low_blk[rowCount],
rs.m_Close_blk[rowCount] );
m_cTChart.Series(VOL_SER).Add( rs.m_Volume_blk[rowCount]/100.0 , "");
// Date value MM/DD/YYYY
t.clear();
t.setTime(rs.m_Date_blk[rowCount], YYYYMMDD);
m_cTChart.Series(1).SetPointLabel(rowCount+j,
t.toString(MM_DD_YY,/").c_str() );
chg = rs.m_Close_blk[rowCount] - close;
open = rs.m_Open_blk[rowCount];
high = rs.m_High_blk[rowCount];
low = rs.m_Low_blk[rowCount];
close = rs.m_Close_blk[rowCount];
}
j += 2000;
rs.MoveNext( );
}
rs.Close();