Page 1 of 1

(Solved) How to chart 3d in avalonia?

Posted: Mon Jan 29, 2024 2:32 am
by 29097511
Hi, I am very new to Steema products, and came here at the recommendation from Avalonia support team's suggestion :)
My goal is to draw a 3d chart in an Avalonia framework project, but so far I've looked through the tutorials and samples online, and I still don't have a clue how to achieve this. The aspect is null for TCharts in the Avalonia control and I can't find access to The TeeChart Editor tool, can you help me, ty :)

Re: How to chart 3d in avalonia?

Posted: Mon Jan 29, 2024 2:55 am
by 29097511
I try to instantiate a new aspect class with view3d property = true, and it now shows 3d view correctly.

Edit: But how can I rotate the view? The aspect class only has View3D property though.

Edit2: Turn out I am working with the wrong class, the TeeChart.Xaml.Avalonia.TChart is not the same as the class in Tutorials and Documentation class Steema.TeeChart.Avalonia.TChart. So after I get this class from TeeChart.Xaml.Avalonia.TChart.LogicalChildren, I can just use the TChart just like the .Net doc :)

Code: Select all

        var _chart = this.FindControl<TeeChart.Xaml.Avalonia.TChart>("MainChart");
        var SteemaTChart = _chart.GetLogicalChildren().Where(x => x is Steema.TeeChart.Avalonia.TChart).Cast<Steema.TeeChart.Avalonia.TChart>().FirstOrDefault();
        if (SteemaTChart != null) 
        {
            SteemaTChart .Walls.Visible = false;
            SteemaTChart .Aspect.View3D = true;
            SteemaTChart .Aspect.Orthogonal = false;
            SteemaTChart .Aspect.Chart3DPercent = 50;
            SteemaTChart .Aspect.Zoom = 75;
            SteemaTChart .Aspect.Rotation = 290;
            SteemaTChart .Aspect.Elevation = 340;

            SteemaTChart .Tools.Add(typeof(Rotate));
        }

Re: (Solved) How to chart 3d in avalonia?

Posted: Mon Jan 29, 2024 12:33 pm
by Marc
Thank you for the error report and feedback, very useful.

Regards,
Marc Meumann

Re: (Solved) How to chart 3d in avalonia?

Posted: Tue Jan 30, 2024 1:25 am
by 29097511
Np, Marc, it's still quite interesting and a pleasant experience for me to explore the Teechart library. But I would like to make a suggestion to add info related to this topic to the Avalonia samples and tutorials, and this might be useful for other people who bought Avalonia Teechart :) (And Teechart might be the only current library that supports 3d plotting in Avalonia afaik, demonstrating 3d plot might be very helpful in official examples)