Jump to content
Software FX Community

making a 3D Oblique Bar Chart


Recommended Posts

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,


Link to comment
Share on other sites

@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. 

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...