This project is read-only.

Strange Behaviour on OHLC graph

Mar 1, 2014 at 6:42 PM
I have a OHLC graph, configured in XAML as follows:
<chart:SparrowChart x:Name="PortfolioValueChart" >
    <chart:SparrowChart.YAxis>
    
        <chart:LinearYAxis StringFormat="$0.00"/>
    </chart:SparrowChart.YAxis>

    <chart:SparrowChart.XAxis>
        <chart:DateTimeXAxis  ShowCrossLines="False" 
                                          StringFormat="hh:mm:ss" 
                                          LabelAngle="90" 
                                          Visibility="Visible"/>
    </chart:SparrowChart.XAxis>
    
    <chart:HiLoOpenCloseSeries  Name="Price" 
                                               StrokeThickness="1" 
                                               PointsSource="{Binding dataQueue}" 
                                               XPath="TimeStamp"
                                               OpenPath="Open" 
                                               HighPath="High" 
                                               LowPath="Low" 
                                               ClosePath="Close" />
</chart:SparrowChart>
DataQueue is defined as ObservableCollection<Model>, and Model contains properties named, "Open","High","Low",Close" and "TimeStamp"

When the program starts up, it "back-fills" the ObservableCollection and then successfully displays the graph as shown:

Image

However, then things update. The DataQueue updates by using DataQueue.RemoveAt(0), and then OnPropertyChanged("DataQueue") is called to update the graph.

And I get this:

Image

Clearly what is happening is the x-axis is getting skewed because there's an irregular gap in the data. I've tried adding "Interval="0:1:0" (or variations thereof) to the DateTimeAxis configuration line, to no avail.

Any ideas would be appreciated!