Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
70
FinancialPriceSeries and ColumnSeries DataPoints does not match
posted

Hello,
i've created two XamDataCharts to display financial data. In the FinancialPriceSeries the first candle is rendered on the first line of Y-Axis, but in the ColumnSeries the first column is rendered between first and second column of Y-Axis. Below is a picture to discribe what I mean:

Now, my question is: which setting I have to set, to get the described behaviour?

It would also be nice if the first and last candle is not cutted.

Thanks in advance and best regards

 

Below is my code to find a possible error in my settings:

<ig:XamDataChart DataContext="{Binding Path=CandleList}"
                    DefaultInteraction="DragPan"
                    HorizontalZoomable="True"
                    HorizontalZoombarVisibility="Visible"
                    VerticalZoomable="False"
                    VerticalZoombarVisibility="Hidden"
                    Grid.Row="6" Grid.Column="0" Grid.ColumnSpan="4">
    <ig:SyncManager.SyncSettings>
        <ig:SyncSettings SyncChannel="syncGroup" SynchronizeVertically="True" />
    </ig:SyncManager.SyncSettings>
    <ig:XamDataChart.Axes>
        <ig:CategoryXAxis x:Name="candleXAxis" ItemsSource="{Binding}" Label="{}{Timestamp}">
            <ig:CategoryXAxis.LabelSettings>
                <ig:AxisLabelSettings Location="OutsideBottom" />
            </ig:CategoryXAxis.LabelSettings>
        </ig:CategoryXAxis>
        <ig:NumericYAxis x:Name="candleYAxis">
            <ig:NumericYAxis.LabelSettings>
                <ig:AxisLabelSettings Location="OutsideLeft" Extent="50" />
            </ig:NumericYAxis.LabelSettings>
        </ig:NumericYAxis>
    </ig:XamDataChart.Axes>
    <ig:XamDataChart.Series>
        <ig:FinancialPriceSeries
            DisplayType="Candlestick"
            ItemsSource="{Binding}"
            OpenMemberPath="Open"
            HighMemberPath="High"
            LowMemberPath="Low"
            CloseMemberPath="Close"
            VolumeMemberPath="Volume"
            XAxis="{Binding ElementName=candleXAxis}"
            YAxis="{Binding ElementName=candleYAxis}" />
    </ig:XamDataChart.Series>
</ig:XamDataChart>

<ig:XamDataChart DataContext="{Binding Path=CandleList}"
                    DefaultInteraction="DragPan"
                    HorizontalZoomable="True"
                    HorizontalZoombarVisibility="Hidden"
                    VerticalZoomable="False"
                    VerticalZoombarVisibility="Hidden"
                    Grid.Row="7" Grid.Column="0" Grid.ColumnSpan="4">
    <ig:SyncManager.SyncSettings>
        <ig:SyncSettings SyncChannel="syncGroup" SynchronizeVertically="True" />
    </ig:SyncManager.SyncSettings>
    <ig:XamDataChart.Axes>
        <ig:CategoryXAxis x:Name="volumeXAxis" ItemsSource="{Binding}" Label="{}{Timestamp}">
            <ig:CategoryXAxis.LabelSettings>
                <ig:AxisLabelSettings Visibility="Hidden" />
            </ig:CategoryXAxis.LabelSettings>
        </ig:CategoryXAxis>
        <ig:NumericYAxis x:Name="volumeYAxis">
            <ig:NumericYAxis.LabelSettings>
                <ig:AxisLabelSettings Location="OutsideBottom" Extent="50" />
            </ig:NumericYAxis.LabelSettings>
        </ig:NumericYAxis>
    </ig:XamDataChart.Axes>
    <ig:XamDataChart.Series>
        <ig:ColumnSeries
            ItemsSource="{Binding}"
            ValueMemberPath="Volume"
            XAxis="{Binding ElementName=volumeXAxis}"
            YAxis="{Binding ElementName=volumeYAxis}"
            Margin="5" />
    </ig:XamDataChart.Series>
</ig:XamDataChart>

Parents
  • 30692
    Verified Answer
    Offline posted

    To align the columns with items in a different series, you should have them share the x axis from the other chart. Change their XAxis binding to read:

    XAxis="{Binding ElementName=candleXAxis}"

    Alternatively, you could put the same candlestick series in the lower chart but hide it. Its the act of sharing an axis between these two series that have different alignment rules that make them coordinate with each other.

    Hope this helps!

    -Graham

Reply Children