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
30
Skip weekends in xamDataChart, CategoryDateTimeXAxis
posted

Hello,

I am using xamDataChart for both WPF and Silverlight to display financial stocks history data. A distinguish feature of stocks data is that meaningful values do present on weekdays and no data is present for weekends. Other dates can have no data too for instance it is the stock is closed on public holidays. One of my requirements is put away any dates which have no data from the chart surface so that it would not occupy space that can be used by other data points. This approach assumes that a distance between data points is exactly 1 day (24 hours) in common except of the edge of each week.

Please notice how the dates are being displayed in the above screenshot. It shows June 3, and then June 6, skipping the 4th and 5th, and so it does for June 10 and June 14 skipping the 11th, 12th and 13th and so forth. And the distance between data points is exactly one day.

I am looking into having similar functionality in xamDataChart. I played around the CategoryDateTimeXAxis enough to have a feeling in that I can make the labels to skip the weekends by applying conditional formatting however it is not the same because the time series would still occupy the space. My another thought is to override GetScaledValue method in a way so that it would return the same scaled value for any point between Friday and Monday for instance.

My concern is if the above approach would ever affect the behavior time series so it would skip the weekends in a way that the requirement states.

Please let me know if hiding weekends functionality is possible to achieve using xamDataChart. I would appreciate if you provide any code snippets that would be very helpful.

Thanks!

Alexander

Parents
No Data
Reply
  • 30692
    Verified Answer
    Offline posted

    Hi,

    This is a backlog feature for the CategoryDateTimeXAxis, but isnt present currently. It will currently always make the intervening time take up space.

    One option that you have currently, if you want each data point to be displayed an equal space from the last, is to use the CategoryXAxis instead of the CategoryDateTimeXAxis, and just don't include data for any days that should be skipped. This will result in each datapoint appearing an equal space form the previous, and no gaps where days have been skipped. If you assign the date property to the label of the CategoryXAxis you will see dates (which you can format as you like) on the x axis.

    Does that help? Or does it not meet some of your requirements? You could submit a feature request for the date skipping for the CategoryDateTimeXAxis, to be sure that we've logged your interest in the feature, but as I said, I believe it may already on the backlog.

    -Graham

Children