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
665
CategoryDateTimeXAxis grid lines
posted

Hi there

 

I have a simple XamDataChart with showing one series of data - a list of Date/Value pairs. The Date property ranges from 0:00 to 23:00 in one hour increment.

 

X Axis is CategoryDateTimeXAxis and Y Axis is NumericYAxis.

 

I need the gridlines to be at exactly one hour interval so I set Interval property of CategoryDateTimeXAxis to "1:0:0" If I use LineSeries or AreaSeries to replresent my data everything is fine. I have MajorStroke at exactly one hour interval starting from 0:00 value. However if I use StackedColumn series the gridlines are shifted by approx. - 0:36. I assume it is because column has a non-zero width and as the centre of the column corresponds to value of Date property the left border of the column is offset by a number of pixels equivalent to 36 minutes.

 

How can I make vertical grid lines appear right in the centre of the column and the X Axis labels to be exact value of Date field of my data?

 

I have attached a small project to demonstrate the issue.

 

Thank you

 

Boris

 

WpfApplication1.zip
  • 30945
    Verified Answer
    Offline posted

    Hello Boris,

     

    Thank you for your reply. I have been looking into the appearance that you are trying to achieve and I can suggest using the MinimumValue and MaximumValue properties of the CategoryDateTimeXAxis. You can set the MinimumValue to 0:00 and the MaximumValue to 0:00 of the next day and by doing so, the Columns will be centered to the vertical lines. I have modified the sample application that you have attached, in order to show how you can implement this approach.

     

    Please let me know if you need any further assistance on the matter.

     

    Sincerely,                        

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

    WpfApplication1_1.zip