Jump to content
Software FX Community

noizwaves

Members
  • Posts

    5
  • Joined

  • Last visited

noizwaves's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thanks Davidam and JuanC, I realised my misdirection with my previous attempts: I was trying to change the properties of the chart from a different thread via Dispatcher.Invoke (one call to Invoke per property to change). Instead, I needed to be calling Invoke on a method inside my UserControl from the different thread. If anyone is having similar problems, reply back and ill post some code samples. Adam
  2. Hi, I'm writing an application that changes the data in a ChartFX chart from another thread. It removes the series from the chart, then adds some new ones. These operations are called from a thread that did not create the chart. Currently i'm using this code to add a series to the chart: private delegate void ChartSeriesAddSafeHandler(Chart ch, SeriesAttributes s); public static void ChartSeriesAddSafe(this Chart ch, SeriesAttributes s) { if (ch.Dispatcher.Thread == Thread.CurrentThread) { ch.Series.Add(s); } else { ch.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Send, new ChartSeriesAddSafeHandler(ChartSeriesAddSafe), ch,s); } } Using similar code to above, i'm able to set a chart's item source, clear the series, and set a series itemsource. However, adding a series to a chart fails with this exception: Exception has been thrown by the target of an invocation.The calling thread cannot access this object because a different thread owns it. I suspect theres some code inside of the chart object that isn't threadsafe. Any recommendations on how to get this working?
  3. 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.
  4. @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.
  5. 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.
×
×
  • Create New...