I am using apex chart (Area chart) to display data entered into a system daily. The data is aggregated by day - 1 to show data entered each day. I want to display the data so that users can see a graph depicting data entered over the past 10 days e.g. Aug 22, Aug 23, Aug 24 …to the current date (Sept 02) on the x-axis. The issue I am having is that, my graph is showing all data entered since January as shown in the screenshot attached. How do I implement this?
You’ll need to add conditions to your data search to only look for data >= the date range start and < the date range end. My example is a little different than yours, but it should give you a good idea of how to set it up. See below:
Depending on the length of the date range, you may want to use the groupby: function and group your data in intervals like 1 day or 1 month. For the groupby: setup you’ll want to set the start date equal to the start of your date range, and then check “Do not skip empty groups” and set the end date as the end of your date range. See below:
Thanks for the great insights. Do I also have to do group by:…on the series category? I tried but it only changed slightly. Also, I want to set the chart to display data from a date range by default, say Date A to Date B, without having to filter it on a date input, any thoughts on how to set this up? I tried Do a search for…constraint…Date<current date/time:+days 10 but it didn’t work.
This topic was automatically closed after 70 days. New replies are no longer allowed.