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
tChart.Draw in WPF v4 version
Re: tChart.Draw in WPF v4 version
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:
I hope will helps.
Thanks,
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;
}
Thanks,
Best Regards,
Sandra Pazos / 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 |