Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

WPF graph AxisDateTime crash

Hi,

I use a graph with an XAxisDateTime and without data.

When I set a range < 5s, the graph crash :

"Une exception non gérée du type 'System.OutOfMemoryException' s'est produite dans mscorlib.dll"

 

Here is my code :

 

XAML :

<ni:Graph x:Name="MyGraph" HorizontalAlignment="Left" Height="275" Margin="10,35,0,0" VerticalAlignment="Top" Width="476">
  <ni:Graph.Axes>         
<
ni:AxisDouble x:Name="verticalAxis1" Orientation="Vertical" Label="C" Location="Far"/> <ni:AxisDateTime x:Name="XAxis" Orientation="Horizontal"/>   </ni:Graph.Axes>
</ni:Graph>

 

VB.NET :

 

    Private Sub InitializeGraph()
        MyGraph.PreferIndexData = False
        XAxis.Range = Range.Create(DateTime.Now, DateTime.Now.AddSeconds(1))
    End Sub



 

Thanks for any help.

 O. Daniere.

0 Kudos
Message 1 of 3
(5,300 Views)

Unfortunately, this a known issue with how we calculate divisions, which was discovered after the last Measurement Studio release. To avoid the crash, change the Mode of the MajorDivisions and MinorDivisions of your axes. For example, the XAML below reduces the number of major divisions to three and hides the minor divisions:


    <ni:AxisDateTime Orientation="Horizontal" MinorDivisions="{x:Null}">
        <ni:AxisDateTime.MajorDivisions>
            <ni:RangeLabeledDivisions Mode="Count: 3" />
        </ni:AxisDateTime.MajorDivisions>
    </ni:AxisDateTime>

~ Paul H
0 Kudos
Message 2 of 3
(5,275 Views)

Just wanted to let you know this issue (#452914) was fixed in the Measurement Studio 2015 release.

~ Paul H
0 Kudos
Message 3 of 3
(4,108 Views)