RadCartesianChart3D -> SeriesProvider

1 Answer 39 Views
Chart ChartView3D
Chris
Top achievements
Rank 1
Iron
Chris asked on 17 Jul 2023, 01:43 PM | edited on 17 Jul 2023, 03:39 PM

Hi,

I am trying to implement a RadCartesianChart3D, but am missing the SeriesProvider Property to be able to bind view models and dynamically create series.. The Telerik package reference is Telerik.UI.for.WPF.NetCore.Xaml (2021.2.615). Was this property not implemented at that time? If so, how do I overcome this?

Example of what Id like to implement:


<telerik:RadCartesianChart3D x:Name="chart">        
        <!--...-->
        <telerik:RadCartesianChart3D.SeriesProvider>
            <telerik:ChartSeriesProvider3D Source="{Binding SeriesData}">
                <telerik:XyzSeries3DDescriptor XValuePath="Year" YValuePath="Industry" ZValuePath="Revenue" ItemsSourcePath="Data">
                    <telerik:XyzSeries3DDescriptor.Style>
                        <Style TargetType="telerik:BarSeries3D" BasedOn="{StaticResource BarSeries3DStyle}" />
                    </telerik:XyzSeries3DDescriptor.Style>
                </telerik:XyzSeries3DDescriptor>
            </telerik:ChartSeriesProvider3D>
        </telerik:RadCartesianChart3D.SeriesProvider>
    </telerik:RadCartesianChart3D>

 

Edit: This feature seems to have been implemented in WPF R2 2022 and I do not have the option to upgrade the Telerik package. Is there a workaround for this?

 

Thanks in advance,

Chris

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 17 Jul 2023, 02:55 PM

Hello Chris,

Indeed, the SeriesProvider feature for RadChartView3D was introduced back in R2 2022. In case you don't have access to that (or later) version, you can use the approach shown in the attached project. I hope that helps.

Regards,
Martin Ivanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Chris
Top achievements
Rank 1
Iron
commented on 17 Jul 2023, 07:18 PM | edited

Hi Martin,

 

thanks for the info and the example. I found a workaround myself before you answered by implementing a behavior bound to my view model collection of data. When overriding OnAttached I set the Series Collection of the 3dChart by iterating through my view model collection and creating appropriate series. Another issue I stumbled upon while using a SurfaceType is this:

Any idea why the surface is not drawn correctly? The MaterialSelector and the SurfaceSeriesColorizer are taken from the Telerik "First Look" example available in the "WPF Controls Examples" App from the Windows store. The series are build up like this and the displayed values are correct - only the surface is missing:

Martin Ivanov
Telerik team
commented on 18 Jul 2023, 06:47 AM

Your setup is probably correct, but I guess the data is not structured as expected. The chart uses a fixed algorithm for triangulating the surface, which expects the data to be ordered in a table-like layout. If you provide a different layout, you may end up with bad surface as in your example. 

My suggestions here are to try re-order your data, in order to resemble a table, or you implement your own triangulation algorithm. The second option requires some knowledge on how the triangles/polygons in the WPF 3D engine are defined and  how to apply the new setup. Basically, you can provide a list of indices. Each index is the index of a point in the 3D space. Each 3 consecutive indices in the collection form a polygon. You can iterate your data points, create a new collection of indices based on your needs and data, and then apply these using the TriangleIndices property of the SurfaceSeries3D. Also, you can find a runnable example that shows that API here.

Chris
Top achievements
Rank 1
Iron
commented on 18 Jul 2023, 08:27 AM

Thanks for the info! I will check that out and get it woroking somehow :-)
Tags
Chart ChartView3D
Asked by
Chris
Top achievements
Rank 1
Iron
Answers by
Martin Ivanov
Telerik team
Share this question
or