tChart.Draw in WPF v4 version

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
asupriya
Newbie
Newbie
Posts: 8
Joined: Mon Jun 18, 2012 12:00 am

tChart.Draw in WPF v4 version

Post by asupriya » Wed Jan 02, 2013 5:13 am

We are migrating from V3 to WPF V4 version and having issues with tChart.Draw method. in v3, it used to be a simple .Draw call, but in WPF v4, it needs a Media.DrawingContext. How do I get a drawingContext for my tChart object so that I can pass it to this method?


Any sample code will be of great help.

Thanks

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

Re: tChart.Draw in WPF v4 version

Post by Sandra » Wed Jan 02, 2013 1:24 pm

Hello asupriya,

If you use TeeChartFor.Net WPF version you can achieve the same functionalities as TeeChartFor.Net, but you need know you are working in different canvas and is possible some methods as you have in TeeChartFor.Net there aren't in TeeChartFor.Net WPF, this doesn't mean you don't achieve the same result using other methods. Therefore, if you use TeeChartFor.Net WPF and you want achieve redraw the chart as does method TChart1.Draw() of TeeChartFor.Net you can use tChart1.Chart.Bitmap() method as do in next lines of code:

Code: Select all

public MainWindow()
        {
            InitializeComponent();
            InitializeChart();
        }
  
        Steema.TeeChart.WPF.Styles.Line Series1;
        private void InitializeChart()
        {
            Series1 = new Steema.TeeChart.WPF.Styles.Line(tChart1.Chart);
            Series1.FillSampleValues();
            tChart1.AfterDraw += new Steema.TeeChart.WPF.PaintChartEventHandler(tChart1_AfterDraw);
            BitmapSource bmp = tChart1.Chart.Bitmap(tChart1.Width,tChart1.Height);
        }

        void tChart1_AfterDraw(object sender, Steema.TeeChart.WPF.Drawing.Graphics3D g)
        {
            tChart1.Panel.MarginBottom = 15;
        }
I hope will helps.

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