TeeChart WPF - Cant see text in XAML

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
MVUser6
Newbie
Newbie
Posts: 30
Joined: Wed Jul 11, 2012 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by MVUser6 » Thu Jan 17, 2013 7:13 am

Hi Sandra,

My name is Yuval and I’m the Development manager in iMDsoft.

I need to know when you will release a new version with this fix.
This is a show stopper for us and it can cause a delay in our deliver.

please update me on your versions plans.

Thanks,
Yuval

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by Sandra » Thu Jan 17, 2013 2:44 pm

Hello YuVal,

I inform about the bugs:
Bug number TW16016325: Isn't still fixed.
Feature request number TW16016406: Is already fixed.

I can not provide you an estimate date to published next maintenance release. I recommend you to be aware at this forum, our RSS news feed, twitter and facebook accounts for new release announcements and what's implemented on them.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

MVUser6
Newbie
Newbie
Posts: 30
Joined: Wed Jul 11, 2012 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by MVUser6 » Thu Jan 17, 2013 3:58 pm

Hi Sandra,

I hope that you understand that I can't get this answer.
I need to release new version of our product and I can’t release it with lost functionality because I change teeChart control from winform to WPF.

As I supply to my customers a date release for our HF for them needs, I’m expecting to get it also from you.

Please tell me what I need to do for achieve the information about the following releases.

Thanks,
Yuval

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by Sandra » Thu Jan 17, 2013 4:24 pm

Hello YuVal,

Ok. We are working for send you a preview release in few days with the bug fixed.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by Christopher » Fri Jan 18, 2013 3:58 pm

Hello YuVal,

I'm the developer who is trying to implement export of the DrawText(FormattedText formattedText, Point point) overload you are interested in. However, I have a problem. My problem is that the FormattedText class does not have the necessary properties to adequately fill in the properties of the TextBox class. For example, the TextBox.Foreground property takes a Brush, and the FormattedText class takes a Brush in its constructor, but there seems to be no way to extract the Brush from a runtime instance of FormattedText. Can you see what I mean? Do you have any suggestions on this front?

Many thanks,

Christopher Ireland
http://www.steema.com

MVUser6
Newbie
Newbie
Posts: 30
Joined: Wed Jul 11, 2012 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by MVUser6 » Sun Jan 20, 2013 10:25 am

Hi,
i'm Idan and i'm a developer in iMDSoft.

FormattedText is quite tricky. Once you construct it, you cannot rip some properties from it.
One possible solution is to create a function that gets all the properties that are needed(like brush, flowdirection, text etc.) and draws the text. it can construct the FormattedText internally if you need to use it for another purposes.
you can place this function in Graphics3d or maybe try to add an extension method to DrawingContext.

i also suggest that you use a reflector(for example, ILSpy) to understand how the FormattedText class stores it properties, maybe it will give you another workaround ideas how to determine the brush of FormattedText.

Hope that i helped,
Idan

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by Christopher » Mon Jan 21, 2013 8:20 am

Hi Idan.

Thanks. I think I have an idea how this will be achieved, but I would like to ask your collaboration in the form of a clear example of the use of DrawText that you need.

The workaround is to use the existing Graphics3D.TextOut method. The Brush can be set using the Graphics3D.Font.Brush property (let me know if additions are needed here) and other font characteristics can be set using the Graphics3D.Font property (again, if there's anything missing here, please let me know). In fact, you might like to see if you can get your required output in WPF using the TextOut method in conjunction with these Brush and Font properties, and if you can't that this will also give me a clearer idea of what's missing. Once we have the output correct in WPF using these existing (although maybe modified) Graphics3D members I can then work on getting the XAML export to do the same.

Many thanks!

Christopher Ireland
http://www.steema.com

MVUser6
Newbie
Newbie
Posts: 30
Joined: Wed Jul 11, 2012 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by MVUser6 » Thu Jan 24, 2013 7:44 am

Hi,
It's not a good solution for us.

The original idea was to use TextOut. We had display problems with it.
In our software we use sometimes a lot of text that is shown with small fonts. When using TextOut, the text looks very blurry and unclear.

After a small research i understood that is a known problem in WPF and Microsoft fixed it on FormattedText. The solution for us was to construct FormattedText with TextFormattingMode.Display flag. When choosing this option, all font metric calculations are GDI-Compatible, which are more suitable for displaying small font text.

I've added a screenshot with the two methods.

Idan
Attachments
text_comparison.png
text_comparison.png (13.41 KiB) Viewed 25701 times

Christopher
Guru
Posts: 1603
Joined: Fri Nov 15, 2002 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by Christopher » Fri Jan 25, 2013 3:13 pm

Hello,

Okay, I think I have a solution for you. In the new version of TeeChart.WPF.dll, you will be able to do something similar to this:

Code: Select all

    private void InitializeChart()
    {
      tChart1.Aspect.TextFormattingMode = TextFormattingMode.Ideal;
      tChart1.AfterDraw += tChart1_AfterDraw;
    }

    void tChart1_AfterDraw(object sender, Graphics3D g)
    {
      g.Chart.Aspect.TextFormattingMode = TextFormattingMode.Display;
      g.Font.Brush.Gradient.Visible = true;
      g.Font.Brush.Gradient.StartColor = Colors.Red;
      g.Font.Brush.Gradient.EndColor = Colors.Blue;
      g.Font.Size = 60;
      g.TextOut(10, 10, "Hello New Text");

      g.Chart.Aspect.TextFormattingMode = TextFormattingMode.Ideal;
      g.Font.Brush.Gradient.Visible = true;
      g.Font.Brush.Gradient.StartColor = Colors.Red;
      g.Font.Brush.Gradient.EndColor = Colors.Blue;
      g.Font.Size = 60;
      g.TextOut(10, 110, "Hello New Text");
    }

    private void Button_Click_1(object sender, RoutedEventArgs e)
    {
      tChart1.Export.Image.XAML.Save(@"C:\tmp\chart.xaml");
    }
The Aspect.TextFormattingMode will allow the TextFormattingMode to be set globally, or you can set it for individual texts as in the AfterDraw code. Below is an image of what the XAML looks like (using the VS designer XamlPadX is too old for this property :) -
Screenshot (16).png
Screenshot (16).png (135.67 KiB) Viewed 25684 times
Please be expecting a new TeeChart.WPF.dll to be sent to you via email for testing.

Thank you,

Christopher Ireland
http://www.steema.com

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by Sandra » Mon Jan 28, 2013 10:31 am

Hello,

I have already sent you the TeeChart.Wpf.dll. Please, check it and tell us if works in your end.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

MVUser6
Newbie
Newbie
Posts: 30
Joined: Wed Jul 11, 2012 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by MVUser6 » Sun Feb 10, 2013 3:36 pm

Hi,

Sorry about the delay, i got the DLL and it's seems like the DLL is corrupted.
i cannot reference it in our project(added screenshot). i tried to see it content in the object browser and this is also cannot be done.

it is also strange that the size of the dll is 1.583mb and the original one was 2.998mb.

Thanks,
Idan.
Attachments
cannot_add_ref.png
cannot_add_ref.png (31.58 KiB) Viewed 25686 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by Sandra » Mon Feb 11, 2013 1:14 pm

Hello MVuser6,

Sorry, you are right. I tested it before send you and it worked for me, but seems something has corrupted the assembly. At any rate, the latest version of TeeChartFor.net is published and you can download it in the download costumer page. Please, download last version and tell us if it works for you.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

MVUser6
Newbie
Newbie
Posts: 30
Joined: Wed Jul 11, 2012 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by MVUser6 » Tue Feb 12, 2013 10:33 am

Hi,

Thanks for the version.
i get an exception on the function TeeChart.Graphics3D.TextHeight(string).

The problem is NullReferenceException inside ChartFont.GetDrawingText.
the problem didn't occur before so i believe it related to the change.

Stack Trace:
at Steema.TeeChart.WPF.Drawing.ChartFont.GetDrawingText(String text)
at Steema.TeeChart.WPF.Drawing.Graphics3DWPF.MeasureString(ChartFont f, String text)
at Steema.TeeChart.WPF.Drawing.Graphics3D.TextHeight(ChartFont f, String text).

We need this function for height calculations.
Thanks,
Idan
Attachments
screen1.png
screen1.png (21.24 KiB) Viewed 25678 times

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by Sandra » Wed Feb 13, 2013 2:33 pm

Hello MVUser6,

Thanks for information. I have added your request in bug list report with number [TW16016512]. We will try to fix it to upcoming maintenance releases of TeeChartFor.Net.

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Sandra
Site Admin
Site Admin
Posts: 3132
Joined: Fri Nov 07, 2008 12:00 am

Re: TeeChart WPF - Cant see text in XAML

Post by Sandra » Wed Feb 13, 2013 2:57 pm

Hello MVUser6,

I inform you that the bug number [TW16016512] has already been fixed in the source code and is fixed to upcoming maintenance release of TeeChartFor.net. At the moment, you can use next code as a workaround:

Code: Select all

private void InitializeChart()
    {
      tChart1.Aspect.View3D = false;
      Steema.TeeChart.WPF.Styles.Line line = new
Steema.TeeChart.WPF.Styles.Line(tChart1.Chart);
      line.FillSampleValues();
      tChart1.AfterDraw += tChart1_AfterDraw;
    }

    void tChart1_AfterDraw(object sender,
Steema.TeeChart.WPF.Drawing.Graphics3D g)
    {
      g.Font.Chart = g.Chart;
      g.TextHeight(g.Font, "Hi");
    }
Could you tell us if previous code works in your end?

Thanks,
Best Regards,
Sandra Pazos / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply