Currently if a user tries to show a costs chart that includes part of a billing cycle and that cycle has over budget switch offs later than the chart displays, the chart breaks. This prevents interacting with the chart (hover effects and toggling datasets) and leads to incorrect compute unit totals being shown.
This is due to the backend giving all over budget switch offs for that cycle, and no checks in the front end that the switch offs it tries to render are within the chart's date range.
This PR therefore changes the backend logic to only provide over budget switch offs within the chart's actual date range, and adds some front end checks to prevent trying to render a switch off out of range.
Currently if a user tries to show a costs chart that includes part of a billing cycle and that cycle has over budget switch offs later than the chart displays, the chart breaks. This prevents interacting with the chart (hover effects and toggling datasets) and leads to incorrect compute unit totals being shown.
This is due to the backend giving all over budget switch offs for that cycle, and no checks in the front end that the switch offs it tries to render are within the chart's date range.
This PR therefore changes the backend logic to only provide over budget switch offs within the chart's actual date range, and adds some front end checks to prevent trying to render a switch off out of range.