I finally got access to a computer where I can allow ActiveX controls (sort of) and after installing the hotfix, the problem with the DataView is still there.
However I managed to better identify it. There were two separate issues:
The checkbox that toggled the dataview on and off was changing its visibility from Visible to Hidden. Using Collapsed instead of Hidden fixed the visual corruption which ocurred when hiding the chart and making it visible again. My bad
In order to provide zoom functionality, I allow the user to select the ranges of the axis, implemented by slicing the data array. This works fine with the Chart itself, but the dataview dissapears when shrinking the ranges and throws an OutOfBounds exception
System.Windows.Data Error: 16 : Cannot get 'Data' value (type 'IEnumerable') from '' (type 'ItemsSourceHolder'). BindingExpression:Path=Data; DataItem='ItemsSourceHolder' (HashCode=49594800); target element is 'DataGridItems' (Name=''); target property is 'ItemsSource' (type 'IEnumerable') TargetInvocationException:'System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.ThrowHelper.ThrowArgumentOutOfRangeException() at System.Collections.Generic.List`1.get_Item(Int32 index) at ChartFX.WPF.Internal.AmbientCollection`1.get_Item(Int32 index) at ChartFX.WPF.SeriesField.DefaultHeader(PaintInfo paintInfo, Object& content, DataTemplate& dataTemplate) at ChartFX.WPF.DataGridItems.RenderHeaders(PaintInfo paintInfo) at ChartFX.WPF.DataGridItems.BuildItemsSource(Object obj, IEnumerator enumerator, Int32 count, Int32& rows) at ChartFX.WPF.DataView.ChartFX.WPF.Internal.ILogicalItemsBuilder.Build() at ChartFX.WPF.Internal.ItemsSourceHolder.get_Data() --- End of inner exception stack trace --- at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) at System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index) at MS.Internal.Data.PropertyPathWorker.GetValue(Object item, Int32 level) at MS.Internal.Data.PropertyPathWorker.RawValue(Int32 k)'
The actual project is a bit more complex and uses in-house developed frameworks, so I am afraid it is not feasible to extract a self-contained example without investing a significant amount of time. Hopefully the stack trace above can be useful to identify the issue.
In case it helps, here is the XAML I use to declare the chart:
<cfx:Chart Grid.RowSpan="2" x:Name="chart1" Gallery="Surface" Palette="{x:Static cfx:Palettes.Litmus}" ItemsSource="{Binding Points.Value}"> <cfx:Chart.Resources> </cfx:Chart.Resources> <cfx:Chart.DataTransforms> <cfxData:CrosstabTransform RowPath="X" ColumnPath="Y" ValuePath="Z"/> </cfx:Chart.DataTransforms> <cfx:Chart.Titles> <cfx:Title> <TextBlock FontSize="14" Foreground="#FFCCCCCC" Text="{Binding Path=Name}" Margin="0 20 0 0"/> </cfx:Title> </cfx:Chart.Titles> <cfx:Chart.View3D> <cfx:View3D IsEnabled="True"/> </cfx:Chart.View3D> <cfx:Chart.AllSeries> <cfx:AllSeriesAttributes> <cfx:AllSeriesAttributes.GalleryAttributes> <cfxGalleries:Surface ShowScaleInLegend="False" ShowContourLines="False" ShowPointsGridlines="False" ShowSeriesGridlines="False"/> </cfx:AllSeriesAttributes.GalleryAttributes> </cfx:AllSeriesAttributes> </cfx:Chart.AllSeries> <cfx:Chart.Series> <cfx:SeriesAttributes Fill="{StaticResource MyBlueGradient}"/> </cfx:Chart.Series> <cfx:Chart.DataView > <cfx:DataView Visibility="{Binding ElementName=Vol, Path=DataContext.DataVisibility.Value}" MaxHeight="150" /> </cfx:Chart.DataView> <cfx:Chart.AxisX> <cfx:Axis> <cfx:Axis.Title> <cfx:Title Content="X Axis"/> </cfx:Axis.Title> </cfx:Axis> </cfx:Chart.AxisX> <cfx:Chart.AxisY> <cfx:Axis> <cfx:Axis.Title> <cfx:Title Content="Y Axis" /> </cfx:Axis.Title> </cfx:Axis> </cfx:Chart.AxisY> </cfx:Chart>