Page 1 of 1

* TeeChart - candle series error *

Posted: Fri Aug 05, 2005 11:47 am
by 9083345
First of all, the previous inquiry about labels re-appearing on exporting has been solved. We found the reason for that.
Thanks.

Now, here is another inquiry.

For "candle" series, there are times when some date data is shown on the bottom axis even if there isn't any data.

For example, there are data only for the date 2005-08-01 and 2005-08-05, the labels which show the date string are shown on the screen for every day between 1st to 5th. ( There should only be two labels on the 1st and the 5th.)

I attached the sample code and the url where you can download a sample program.

Our company is surrounded by the very intense atmosphere. This customer claims that their web site is scheduled to open on next Monday (8th of Aug).Hence, a quick answer is very appreciated.

Many thanks.

Code: Select all

BOOL CTeeFilesView::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) 
{
 
 if (!CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext))
  return FALSE;
 
 //WS_CHILD | WS_VISIBLE
 //Create TeeChart - sized to Client window afterwards with 'OnSize'
 if (!m_Chart1.Create(lpszClassName, 
       "", 
       dwStyle, 
       CRect(0,0,50,50), 
       this, 
       IDC_TCHART1, 
       pContext))
  return FALSE;
 
   m_Chart1.SetVisible(true);
   m_Chart1.GetAspect().SetView3D(FALSE);   
    
   m_Chart1.AddSeries(scCandle);
   m_Chart1.Series(0).GetAsCandle().AddCandle(37988, 5450, 5930, 5420, 5900);
   m_Chart1.Series(0).GetAsCandle().AddCandle(37991, 5760, 6040, 5760, 6000);
      
 
 //Set some cosmetic features
 COleVariant var1(CString ("TeeChart Pro"));
 COleVariant var2(CString ("ActiveX Control"));
 CTitles hd = m_Chart1.GetHeader();
 hd.GetText().Clear();hd.GetText().Add(*(LPCVARIANT)var1);
 hd.GetText().Add(*(LPCVARIANT)var2);
 hd.GetFont().SetBold(true);
 hd.GetFont().SetSize(11);
 m_Chart1.GetPanel().GetGradient().SetVisible(true);
 m_Chart1.GetPanel().GetGradient().SetDirection(gdTopBottom);
 if (m_Chart1.GetCanvas().IsScreenHighColor())
 {
  m_Chart1.GetPanel().GetGradient().SetEndColor(RGB(0,0,131));
  hd.GetFont().SetColor(RGB(255,255,51));
 }
 
 return true;
}
http://m2soft.co.kr/TeeFiles.exe

Posted: Fri Aug 05, 2005 12:20 pm
by Pep
Hi,

Please find below the answers to a similar question to yours but posed in the context of Candle Series and the extraction of weekends.You should be able to apply the same techniques to your situation. These questions and answers came from Steema's ActiveX FAQ on:
http://www.steema.com/support/faq/NewAX/faq_ax.htm

Candle Series
How can I remove weekends on Candle ODBC database Charts?
How can I remove weekends programmatically?

An easy way if you want to preserve the space between the two points is to use the following :
TChart1.Series(0).Marks.Style = smsXValue
TChart1.Axis.Bottom.Labels.Style = talMark

You can also see one example of the "Axis labels no weekend" in the Demo Features project.