Page 1 of 1

Loading Bar chart with lots of data

Posted: Sun Dec 11, 2005 2:50 am
by 6927637
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:

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);
Here is the code I'm using to load the data:

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();

Posted: Tue Dec 13, 2005 12:41 pm
by narcis
Hi Sam,

It works fine here using:

Code: Select all

Private Sub Form_Load()
    TChart1.Series(0).FillSampleValues (2000)
    TChart1.Series(0).PointColor(TChart1.Series(0).Count - 1) = vbBlue
End Sub
and our latest v6.0.0.6 .ocx build. If you want I can send you the .ocx I'm using to see if it works for you.

Posted: Wed Dec 14, 2005 2:17 am
by 6927637
I have tried coloring the last bar as blue, its still does not show.

Please email me your version of OCX. Also let me know how to install and register it.

Thank you,

Posted: Wed Dec 14, 2005 3:08 pm
by narcis
Hi Sam,

I've just sent you our latest v6 .ocx available. Don't forget to unregister the old one and register this one using regsvr32 -u and regsvr32 respectively.