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 Reply Children