(Solved) How to chart 3d in avalonia?

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
Thomas
Newbie
Newbie
Posts: 4
Joined: Fri Jan 26, 2024 12:00 am

(Solved) How to chart 3d in avalonia?

Post by Thomas » Mon Jan 29, 2024 2:32 am

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 :)
Last edited by Thomas on Mon Jan 29, 2024 8:03 am, edited 1 time in total.

Thomas
Newbie
Newbie
Posts: 4
Joined: Fri Jan 26, 2024 12:00 am

Re: How to chart 3d in avalonia?

Post by Thomas » Mon Jan 29, 2024 2:55 am

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));
        }

Marc
Site Admin
Site Admin
Posts: 1274
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

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

Post by Marc » Mon Jan 29, 2024 12:33 pm

Thank you for the error report and feedback, very useful.

Regards,
Marc Meumann
Steema Support

Thomas
Newbie
Newbie
Posts: 4
Joined: Fri Jan 26, 2024 12:00 am

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

Post by Thomas » Tue Jan 30, 2024 1:25 am

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)

Post Reply