I have a line chart which can be configured to show data from the last month, last 3 months, ... , last 2 years, last 10 years, etc.
In my SQL query I filter the data to return only the last X months and provide this data to the Kendo chart.
I am using ChartAxisBaseUnit.Fit so I can return data over weeks, months, years and the date axis is adjusted accordingly.
It is now March 16th, if I return 6 months of data the chart will show Months (September to March) on the data axis.
The problem is that we are only half way through March so the line drops off as we do not have all the data for that month yet.
What I could do is filter the data in SQL to only return complete months... i.e. filter the data from 1st September to 1st March.
However, if I return data over a longer period of time the chart will automatically show Years on the date axis.
In this case I don't want to show 2017 at all so I want to ignore any data from Jan and Feb 2017 causes.
Hopefully you get the problem... if date axis is showing years, months, weeks then I only want to show data for the last complete year, month, week.
I have seen there is a MaxDateGroups property that can be set to control the number of items shown but that does not really help.
Eventually I want the user to be able to select a custom date range and show a line chart with automatically scaled date axis.
However, I don't want the line chart to suddenly drop down at the end because we are on the first day of the month, etc.
I am hoping I am just missing something simple here and there is some property which I can set?
If not how have other people got around this problem? I would expect this is a common issue.