Are .NET fonts and TeeChart fonts incompatible ?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Anthony
Newbie
Newbie
Posts: 35
Joined: Wed Feb 25, 2004 5:00 am
Location: WL| Delft Hydraulics, Holland
Contact:

Are .NET fonts and TeeChart fonts incompatible ?

Post by Anthony » Fri Feb 11, 2005 9:13 am

Hi,

In my application I have my own .NET font dialog, and I want to apply the user-selected font for my axis titles. (kinda shortcut for TeeChart editor).

But I get an error message : cannot convert System.Drawing.Font to Steema.TeeChart.Drawing.ChartFont ???

My code looks like:

Steema.TeeChart.Axis axis;
fontDialog = new FontDialog();
if(fontDialog.ShowDialog() != DialogResult.Cancel )
{
axis.Title.Font = fontDialog.Font;
}
Also an explicit cast does not work here.

Are the .NET and TeeChart fonts incompatible ??

Last question ... in your TeeChart editor, the edited title is changed immediately. How to do that .. simply an tChart1.Invalidate() ?

Thanks a lot.
Antoon Koster
Netherlands

Pep
Site Admin
Site Admin
Posts: 3295
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Wed Feb 16, 2005 5:02 pm

Hi Anthony,
But I get an error message : cannot convert System.Drawing.Font to Steema.TeeChart.Drawing.ChartFont ???
You can't assign the font directly (as you did), because the Font property is "read-only", you must assign is as in the following line :
tChart1.Axes.Bottom.Title.Font.Name = fontDialog1.Font.Name;
Last question ... in your TeeChart editor, the edited title is changed immediately. How to do that .. simply an tChart1.Invalidate() ?
I'm not sure what you refer, changing the text of the title. it should change automatically. Also, doing a Invalidate will repaint the Chart.

Post Reply