noizwaves Posted July 5, 2008 Report Share Posted July 5, 2008 Hi all, I'm trying to plot some 2D data on a chart that looks like the 3D Oblique Bar Chart from http://www.softwarefx.com/sfxGallery/ . Currently i'm having trouble making the graph appear 3D in ChartFX. Has anyone been successful in this, and if so, could provide some code samples? Thanks in advance. Quote Link to comment Share on other sites More sharing options...
VekiPeki Posted July 7, 2008 Report Share Posted July 7, 2008 It should be set up something like this (depending on the version of ChartFx you're using, there might be some differences - following sample is for Client Server COM edition): chart1.Gallery = Cfx62ClientServer.Gallery.Gallery_Bar;chart1.Chart3D = true;chart1.View3D = true;chart1.AngleX = 45;chart1.AngleY = 45;chart1.Cluster = true;chart1.Perspective = 60; This was simply taken from Samples & Resources, and it works as stated. To get those nice transparent colors in COM Client Server edition (I don't know what's the difference with .NET versions), you can mask last byte of your uint32 color to give the level of transparency you want: uint originalColor = (uint)ColorTranslator.ToOle(Color.FromArgb(red, green, blue));chart1.Series[0].Color = (uint)(0x30000000 | originalColor); This is used in Client Server (COM edition) because Color property type is UInt32, not System.Drawing.Color (again, I don't know about .NET). Best regards, Veki Quote Link to comment Share on other sites More sharing options...
noizwaves Posted July 7, 2008 Author Report Share Posted July 7, 2008 @Veki: Thankyou so much for your guidence. Although the WPF Chart attributes are slightly different to the COM edition attibutes, your help guided me to a solution. Here is the minimum XAML code required for my 3D Bar Chart object: <chartFX:Chart Name="chartMain" Gallery="Bar"> <chartFX:Chart.View3D> <chartFX:View3D Cluster="Yes" IsEnabled="true"> <chartFX:View3D.Wall> <chartFX:Wall3DAttributes /> </chartFX:View3D.Wall> </chartFX:View3D> </chartFX:Chart.View3D></chartFX:Chart> Something worth noting is that the XAML fails to render in VS2008 design view for me (When IsEnabled is set to True). I get this following error and stack trace: Object reference not set to an instance of an object. at b6.e() at b6.a(a A_0, Model3DCollection A_1, Model3DCollection A_2) at b6.a(Brush A_0, Double A_1, Double A_2, Matrix3D A_3, Matrix3D A_4) at b6.a(PaintMark A_0, LogicalItemCollection A_1) at cd.a(PaintMark A_0, cn A_1, Double A_2, Double A_3, ap[] A_4, LogicalItemCollection A_5, LogicalItemCollection A_6, Int32 A_7) at cd.a(cn A_0, Double A_1, Double A_2) at cd.d(Double A_0, Double A_1) at cd.a(Double A_0, Double A_1, Boolean A_2) at b6.b(Object A_0, EventArgs A_1) at b6.b.OnRender(DrawingContext drawingContext) at System.Windows.UIElement.Arrange(Rect finalRect) at System.Windows.Controls.Border.ArrangeOverride(Size finalSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at ChartFX.WPF.Controls.SpacingDockPanel.ArrangeOverride(Size finalSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at System.Windows.ContextLayoutManager.UpdateLayout() at System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) at System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork() at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) This is probably due to the beta nature of the software (im using 0.8.3091.27388 version binaries). I do use a fairly exotic development environment, Win XP SP2 in a virtual machine in VMware Fusion 2.0 beta with DirectX disabled. Quote Link to comment Share on other sites More sharing options...
noizwaves Posted July 7, 2008 Author Report Share Posted July 7, 2008 P.S. Although i get the exception (and subsequent failed rendering) in design view, my project still compiles, runs and displays the 3D graph fine. Quote Link to comment Share on other sites More sharing options...
JuanC Posted July 7, 2008 Report Share Posted July 7, 2008 We have fixed this exception although some 3D charts are still not rendering correctly at design time. You can request a hotfix by sending an email to wpf at softwarefx dot com Regards, JuanC Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.