RadCartesianChart3D by export to image don't show labels

4 posts, 1 answers
  1. Mariia
    Mariia avatar
    3 posts
    Member since:
    Apr 2018

    Posted 09 Apr 2018 Link to this post

    Hello!

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

  2. Answer
    Martin Ivanov
    Admin
    Martin Ivanov avatar
    2240 posts

    Posted 10 Apr 2018 Link to this post

    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.
  3. Mariia
    Mariia avatar
    3 posts
    Member since:
    Apr 2018

    Posted 18 Apr 2018 in reply to Martin Ivanov Link to this post

    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?

  4. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2240 posts

    Posted 18 Apr 2018 Link to this post

    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.
Back to Top