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
2085
CategoryDateTimeXAxis Grid Lines Not Drawing
posted

I have set up a XamDataChart in XAML using WPF v15.1.20151.2055 like this:

<Window
        x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ig="http://schemas.infragistics.com/xaml"
 
        Title="MainWindow" Height="300" Width="800">
    <Grid>
        <ig:XamDataChart x:Name="ctrlChart">
            <ig:XamDataChart.Axes>
                <ig:CategoryDateTimeXAxis MajorStroke="Black" VerticalAlignment="Bottom">
                </ig:CategoryDateTimeXAxis>
            </ig:XamDataChart.Axes>
        </ig:XamDataChart>
    </Grid>
</Window>

In this configuration, the grid lines for the x-axis are not displayed.  If I remove the VerticalAlignment setting, then the grid lines are displayed.  This is not causing a specific problem for me to remove this setting, but it took quite a bit of time to figure out this was the issue so I would like to know how this setting is impacting the chart?

Thanks!

  • 34430
    Verified Answer
    Offline posted

    Hello Gary,

    Thank you for your post.

    I have been investigating this issue, and it appears that by setting the VerticalAlignment property of the CategoryDateTimeXAxis, you are also setting the alignment of everything that axis contains, including the chart's gridlines. The gridlines normally have a VerticalAlignment of "Stretch" and their ActualHeight property will be the height of the grid in the chart, which represents the height of the axis they are included in. By aligning the axis vertically to the bottom, these gridline's ActualHeight properties appear to be reduced to approximately 0.5 pixels tall.

    Is there any particular reason you are setting the VerticalAlignment property on the CategoryDateTimeXAxis? I would recommend that if you wish to see gridlines in your XamDataChart, that you leave the axes' VerticalAlignment property to its default value.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

  • 2085
    Offline posted

    I guess that makes sense.  I was originally setting the VerticalAlignment while trying to figure out another issue related to the initial draw of the chart/axis not displaying X-axis tick mark labels until a chart re-size so it was not specifically needed for what I am doing, but I wanted more info on why I got the result I did.

    Thanks!