bug(charts): Chart's legend values not updating after clearing filters applied to chart
After defining a custom merge function in Issues Analytics's apolloProvider
, I noticed that the chart's legend values were not being updated after applying filters to the chart then clearing them.
Screen Recording 2023-12-15 at 5.52.59 PM.mov
I dug a little deeper and found that the chart's seriesInfo
computed property is not being updated, so stale data is being passed down to the ChartLegend
. This is possibly due to the chart not being re-rendered since clearing all filters does not result in additional GraphQL queries because the original data was cached, so seriesInfo
has stale data since it depends on the chart instance's compiledOptions
series data.
Although I only referred to GlStackedColumnChart
above, this issue is very likely affecting other chart components that have child ChartLegend
components since most – if not all – of them are passing series data from compiledOptions
down to them.