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

3D Stacked Bar Series

10 Answers 187 Views
ChartView3D
This is a migrated thread and some comments may be shown as answers.
Châu Thịnh
Top achievements
Rank 1
Châu Thịnh asked on 12 Jul 2018, 08:17 AM

Hi, we are developing a product which supposed to have 3D Stacked Bar Series. But I haven't found any documents for this type of chart in both of your documents and examples. I'm not sure your products supporting for this Chart.
Please tell me if you have any suggestions.

Thanks and best regards.

Harry

10 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 12 Jul 2018, 12:05 PM
Hello Harry

The RadChartView3D suite doesn't provide stacking mechanism for its series visualizations. However, there is a feature request for introducing such feature. You can find it logged in our feedback portal where you can track its status.

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
Accepted
Martin Ivanov
Telerik team
answered on 12 Jul 2018, 01:27 PM
Hello Harry,

I've prepared a small example showing a possible approach to achieve stacked bars visualization using the BarSeries3D with MaterialSelector and MeshGeometry3D. I hope this helps.

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
Châu Thịnh
Top achievements
Rank 1
answered on 13 Jul 2018, 07:35 AM

Hi Martin Ivanov,

Thank you very much for your support. I used your example and it worked.

0
Châu Thịnh
Top achievements
Rank 1
answered on 14 Jul 2018, 05:29 AM

Hi Martin Ivanov,

There is one more problem. Does your library support MouseClickEvent() on column of BarSeries3D? Concretely, we need to show more information by clicking on particular column. (Ex: Opening new ImageWindow).

Do you have any suggestions?

Thank for your helps.

 

0
Accepted
Martin Ivanov
Telerik team
answered on 16 Jul 2018, 07:00 AM
Hello Châu,

RadChartView3D doesn't expose an API that allows you to subscribe directly to a mouse click event of the bars (columns) but you can use the WPF native API to get the clicked element. For example:
this.chart.AddHandler(RadCartesianChart3D.MouseLeftButtonDownEvent, new MouseButtonEventHandler(Chart_MouseLeftButtonDown), true); 
//-----------------
private void Chart_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
    Viewport3D viewport = ChildrenOfTypeExtensions.FindChildByType<Viewport3D>(this.chart);
    Point position = e.GetPosition(this.chart);
    Visual3D visualHit = HitTest(viewport, position);
     
    if (visualHit != null)
    {
        RadRect3D radLayoutSlot = GetLayoutSlot(visualHit);
 
        foreach (BarSeries3D series in this.chart.Series)
        {
            foreach (XyzDataPoint3D dp in series.DataPoints)
            {
                if (dp.LayoutSlot.Equals(radLayoutSlot))
                {
                    var dataItem = (MyPlotInfo)dp.DataItem;
                    return;
                }
            }
        }
    }
}
 
private Visual3D HitTest(Viewport3D viewport, Point position)
{
    Visual3D visualHit = null;
 
    HitTestResultCallback callback = result =>
    {
        RayMeshGeometry3DHitTestResult rayMeshResult = result as RayMeshGeometry3DHitTestResult;
        visualHit = rayMeshResult.VisualHit;
        return HitTestResultBehavior.Stop;
    };
    VisualTreeHelper.HitTest(viewport, null, callback, new PointHitTestParameters(position));
 
    return visualHit;
}
I also attached a small examples showing this approach. I hope it helps.

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
Châu Thịnh
Top achievements
Rank 1
answered on 18 Jul 2018, 03:35 AM

Hi Martin Ivanov,

Thanks for your helps. I used your example and it worked for us. 
Could you help me with one more issue. We need to make the grid line inside the 3D chart. You will be more clear with the picture I attached.
Is that possible to make it like that?

Thanks and best regards,
Harry

0
Châu Thịnh
Top achievements
Rank 1
answered on 18 Jul 2018, 03:52 AM
I used your example with 3D Stacked Series. You will see that the bars now look curved in the corner compared to 3D Seires (the bar filled with one brush color). If I need to make it more sharpness in the corner. Are there any ways to improve this? I also attached the picture.

Thank for your help.
0
Martin Ivanov
Telerik team
answered on 18 Jul 2018, 12:33 PM
Hello Harry,

The 3D chart doesn't support grid lines inside of the plot area. You can get a similar effect by adding a new BarSeries3D with custom geometry that shows a wireframe. Here is a blog post on how to create a 3D wireframe in WPF. Maybe you can use this information to create a custom geometry and apply it to the DefaultVisualGeometry of the series.

About the curved bars, this effect appears because of the custom geometry applied. It is quite simple compared to the default geometry of the series and the light is reflected differently from the surface. In order to alter this and get an effect similar to the one in the default bars you will need to alter the custom MeshGeometry3D. You can read how the geometry works in the MSDN article related to 3D in WPF. For example you can use the Normals or the Positions collections of the mesh object.

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
Châu Thịnh
Top achievements
Rank 1
answered on 20 Jul 2018, 03:22 AM

Hi Martin Ivanov, 

I've get into this trouble. Sometimes the axes of 3D Bar Chart somehow is stuck (the picture I've attached). Do you have any ideas for this problem. 

Thanks for your helps.

0
Martin Ivanov
Telerik team
answered on 20 Jul 2018, 11:22 AM
Hello Harry,

This is curious. We haven't seen this issue. May I ask you to open a new support ticket from your telerik.com account and send a runnable project showing the issue? This way someone can test it and investigate what happens. Alternatively, you can try reproducing this in the project I've attached few replies back and let me know what was modified in order to reproduce the issue.

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
Châu Thịnh
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Châu Thịnh
Top achievements
Rank 1
Share this question
or