Jump to content
Software FX Community

AnthonyJones

Members
  • Posts

    7
  • Joined

  • Last visited

AnthonyJones's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Part of our application uses ChartFX to show line graphs which have a horizontal axis showing a measurement of time. The customer needs to be able to highlight a section of the graph with the mouse and have that section expand to fill the visible graph area (e.g. "zoom" to a particular range of dates). I've been asked to post here to find out: a) Is such a thing possible with the ChartFX control? Is there any example code available if so? Thanks in advance.
  2. Apologies for the long delay in replying, I've been away. I have managed to reproduce the problem in this small app. If you click the button to hide the series, then the button to change the chart to a 3D pie, the exception is thrown: Window1.xaml: <Window x:Class="Chart3DTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cfxControls="clr-namespace:ChartFX.WPF;assembly=ChartFX.WPF" Title="Window1" Height="500" Width="500"> <Grid> <StackPanel Orientation="Vertical"> <cfxControls:Chart Name="chartTest" VerticalAlignment="Top" HorizontalAlignment="Center"/> <Button Name="btnHide" Content="Hide series 1" VerticalAlignment="Bottom" HorizontalAlignment="Center"/> <Button Name="btnChange" Content="Change to 3D pie" VerticalAlignment="Bottom" HorizontalAlignment="Center"/> </StackPanel> </Grid> </Window> Window1.xaml.cs: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using ChartFX.WPF; namespace Chart3DTest { /// <summary> /// Interaction logic for Window1.xaml /// </summary> public partial class Window1 : Window { public Window1() { InitializeComponent(); btnChange.Click += new RoutedEventHandler(btnChange_Click); btnHide.Click += new RoutedEventHandler(btnHide_Click); } void btnHide_Click(object sender, RoutedEventArgs e) { chartTest.Series[0].Visibility = Visibility.Hidden; } void btnChange_Click(object sender, RoutedEventArgs e) { chartTest.View3D.IsEnabled = true; chartTest.Gallery = Gallery.Pie; } } } I'm now using 8.0.3565.24914 and the problem still occurs. I noticed that you used Visibility.Collapsed rather than Visibility.Hidden in your example. If I do the same in this app it works fine. What's the difference between Hidden and Collapsed? Thanks, Anthony.
  3. Our application allows the user to change the chart type and appearance from a context menu. If the legend box is visible and the user has unticked one or more series, and the chart type is then changed to a 3D pie (or dougnut or pyramid), then ChartFX.WPF throws the following exception: System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="ChartFX.WPF" StackTrace: at ChartFX.WPF.PlotArea3D.a(PaintMark A_0, LogicalItemCollection A_1) at ChartFX.WPF.Internal.PlotAreaCore.a(PaintMark A_0, AttributesResolver A_1, Double A_2, Double A_3, LogicalItemCollection A_4, LogicalItemCollection A_5, Int32 A_6, Boolean A_7) at ChartFX.WPF.Internal.PlotAreaCore.a(AttributesResolver A_0, Double A_1, Double A_2) at ChartFX.WPF.Internal.PlotAreaCore.a(Double A_0, Double A_1, Boolean A_2) at ChartFX.WPF.Internal.PlotAreaCore.b(Double A_0, Double A_1, Boolean A_2) at ChartFX.WPF.PlotArea3D.c(Object A_0, EventArgs A_1) at ChartFX.WPF.PlotArea3D.Viewport3DRepaint.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 System.Windows.Controls.DockPanel.ArrangeOverride(Size arrangeSize) at ChartFX.WPF.TitlePanel.ArrangeOverride(Size arrangeSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) at System.Windows.Controls.ContentPresenter.ArrangeOverride(Size arrangeSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at ChartFX.WPF.Controls.GridFocus.a(UIElement A_0, Rect A_1, LayoutType A_2) at ChartFX.WPF.Controls.GridFocus.a(Size A_0, LayoutType A_1) at ChartFX.WPF.Controls.GridFocus.ArrangeOverride(Size arrangeSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) at System.Windows.UIElement.Arrange(Rect finalRect) at MS.Internal.Helper.ArrangeElementWithSingleChild(UIElement element, Size arrangeSize) at System.Windows.Controls.ItemsPresenter.ArrangeOverride(Size arrangeSize) at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect) 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 System.Windows.Controls.Control.ArrangeOverride(Size arrangeBounds) 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.AnimatedRenderMessageHandler(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) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.DispatcherOperation.InvokeImpl() at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state) at System.Threading.ExecutionContext.runTryCode(Object userData) at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Windows.Threading.DispatcherOperation.Invoke() at System.Windows.Threading.Dispatcher.ProcessQueue() at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 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) at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter) at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg) at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(Object ignore) at System.Windows.Application.RunInternal(Window window) at System.Windows.Application.Run(Window window) at System.Windows.Application.Run() at OBM_EXE.App.Main() in C:\Users\user\Documents\Projects\Neutrino\Code\OBM\OBM_EXE\obj\Debug\App.g.cs:line 0 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() We are currently using version 8.0.3488.31327. Has this been fixed in a later version? The online updater doesn't offer me anything newer than 8.0.3422.28509. Thanks, Anthony.
  4. So it is! As you guessed, I was looking for it on Intellisense. Upgrading to 3488 and using chart.UnloadVisuals now appears to have fixed the problem - thanks!
  5. Hi, thanks for your update. We have now upgraded to 8.0.3488.31327, but it hasn't made any difference to the memory leak issue. You said to manually invoke the UnloadVisuals method, but the chart object doesn't appear to have an UnloadVisuals method - have I misunderstood?
  6. I've since noticed that the problem occurs when using FileFormat.Bitmap, FileFormat.Jpeg and FileFormat.Png but not when using FileFormat.Xml or FileFormat.XmlTemplate. It occurs regardless of whether the image output is to a memory stream or a file. Has anyone noticed this? Is there a fix for it?
  7. Our application seems to suffer from a memory leak when using the Chart.Export function. I can replicate the problem with the following code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using System.IO; using ChartFX.WPF; namespace WpfApplication1 { /// <summary> /// Interaction logic for Window1.xaml /// </summary> public partial class Window1 : Window { public Window1() { InitializeComponent(); btnTest.Click += new RoutedEventHandler(btnTest_Click); } void btnTest_Click(object sender, RoutedEventArgs e) { for (int i = 0; i < 25; i++) { Chart oTestChart = new Chart(); MemoryStream ms = new MemoryStream(); oTestChart.Export(FileFormat.Png, ms); ms.Close(); oTestChart = null; } GC.Collect(); } } } In this case, each time the button is clicked, the application's memory usage increases significantly and never seems to reduce again. The line "oTestChart.Export(FileFormat.Png, ms);" seems to be the culprit - if I remove it the memory usage doesn't increase. Is there any way of reclaiming the memory once the Export function has been used? We are using ChartFX.WPF.dll version 8.0.3439.25180. Thanks in advance!
×
×
  • Create New...