This is a migrated thread and some comments may be shown as answers.

RadCartesianChart3D by export to image don't show labels

3 Answers 151 Views
ChartView3D
This is a migrated thread and some comments may be shown as answers.
Mariia
Top achievements
Rank 1
Mariia asked on 09 Apr 2018, 01:28 PM

Hello!

I'm troubled, by export to image RadCartesianChart3D, don't display labels, is this a common problem?

3 Answers, 1 is accepted

Sort by
0
Accepted
Martin Ivanov
Telerik team
answered on 10 Apr 2018, 09:01 AM
Hello Mariia,

Can you share a bit more information on your scenario? Some runnable code showing the chart's setup and exporting code would be helpful.

Also, keep in mind that the reported behavior could be observed if you try to export the chart when its hidden or not added in the visual tree. This happens because the labels are not generated until the chart becomes visible. In this case you can consider opening a new window with the chart and exporting it after this. Here is a small code example showing this approach. Can you please give it a try and let me know how it goes?
var chart = new RadCartesianChart3D();
chart.Width = 1000;
chart.Height = 600;
// some chart settings and populating with series and data here
  
var w = new Window();
w.WindowStyle = WindowStyle.None;
w.Height = 0;
w.Width = 0;
w.Content = chart;
w.Loaded += (s, e) =>
{
    using (Stream stream = new FileStream("../../test.png", FileMode.Create))
    {
        Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(
            chart, stream, new System.Windows.Media.Imaging.PngBitmapEncoder());
    }
    w.Close();
};
  
w.Show();

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Mariia
Top achievements
Rank 1
answered on 18 Apr 2018, 07:57 AM

Thank you very much. It has helped me!

However, opening windows with charts takes a lot of time. I need to display 3 RadCartesianChart3Ds from RadTabControl in the Report. To do this, I first export them to image, then save them to dbml, and then display them in a report. No idea how to speed up this process?

0
Martin Ivanov
Telerik team
answered on 18 Apr 2018, 10:29 AM
Hello Mariia,

I am afraid that at this point I cannot suggest you an alternative solution that would help you to boost the process. However, I logged an item in our internal backlog for altering the chart's logic so that the labels can be also exported when the chart is not added in the visual tree. I also updated your Telerik points.

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ChartView3D
Asked by
Mariia
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Mariia
Top achievements
Rank 1
Share this question
or