I need to set the Font for the header but can't find a SetFont Property for CTitles. I have the following
e.g.
LOGFONT mlf;
mChart->GetHeader().SetFont(mLf)
does not work (there is no SetFont method for CTitles)
Can someone point me in the right direction?
Setting Font for TChart Header
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Best Regards,
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 |
Thanks. SetName() worked for me. Now I want to set the size of the font using the size I get from a CFontDialog but the text on the Chart is very big. I'm using
CFontDialog dlg;
dlg.doModal();
m_Chart->GetHeader().GetFont().SetSize( dlg.GetSize());
I also tried setting the height using the size as follows:
long newSize = m_Chart->GetHeader().GetFont().GetSize() * m_Chart->GetHeader.GetFont().GetPixelsPerInch/72;
m_Chart->GetHeader().GetFont().SetHeight(newSize);
This also produced much larger text than expected...
What property should I be setting?
Thanks
CFontDialog dlg;
dlg.doModal();
m_Chart->GetHeader().GetFont().SetSize( dlg.GetSize());
I also tried setting the height using the size as follows:
long newSize = m_Chart->GetHeader().GetFont().GetSize() * m_Chart->GetHeader.GetFont().GetPixelsPerInch/72;
m_Chart->GetHeader().GetFont().SetHeight(newSize);
This also produced much larger text than expected...
What property should I be setting?
Thanks
Hi nbp,
Here is an example of how you could set the chart's header font size to be shown at the editor:
Here is an example of how you could set the chart's header font size to be shown at the editor:
Code: Select all
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
CClientDC dc(this);
lf.lfHeight = -MulDiv(m_Chart1.GetHeader().GetFont().GetSize(), dc.GetDeviceCaps(LOGPIXELSY), 72);
CFontDialog fdlg(&lf);
fdlg.DoModal();
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |