diff --git a/static/app/components/charts/barChart.tsx b/static/app/components/charts/barChart.tsx index d5623f6e5f3998..5951cd35f2e340 100644 --- a/static/app/components/charts/barChart.tsx +++ b/static/app/components/charts/barChart.tsx @@ -81,6 +81,12 @@ export function BarChart({ }, [xAxis]); return ( - + ); } diff --git a/static/app/components/charts/baseChart.tsx b/static/app/components/charts/baseChart.tsx index 6c2b981b77d071..60a1c17fe58677 100644 --- a/static/app/components/charts/baseChart.tsx +++ b/static/app/components/charts/baseChart.tsx @@ -135,6 +135,10 @@ export interface BaseChartProps { * This is to pass series to BaseChart bypassing the wrappers like LineChart, AreaChart etc. */ additionalSeries?: SeriesOption[]; + /** + * Whether animations are enabled for the entire chart. If animations are enabled overall, this will cause ZRender to occasionally attempt to run animations and call `requestAnimationFrame` which might cause UI stutter. + */ + animation?: boolean; /** * If true, ignores height value and auto-scales chart to fit container height. */ @@ -332,6 +336,7 @@ const DEFAULT_Y_AXIS = {}; const DEFAULT_X_AXIS = {}; function BaseChart({ + animation, brush, colors, grid, @@ -564,6 +569,7 @@ function BaseChart({ return { ...options, + animation, useUTC: utc, color: color as string[], grid: Array.isArray(grid) ? grid.map(Grid) : Grid(grid), @@ -580,6 +586,7 @@ function BaseChart({ brush, }; }, [ + animation, chartId, color, resolvedSeries, diff --git a/static/app/views/dashboards/widgetCard/chart.tsx b/static/app/views/dashboards/widgetCard/chart.tsx index ba78c17dc285a8..f15ab842346359 100644 --- a/static/app/views/dashboards/widgetCard/chart.tsx +++ b/static/app/views/dashboards/widgetCard/chart.tsx @@ -303,6 +303,8 @@ function WidgetCardChart(props: WidgetCardChartProps) { }; const chartOptions = { + animation: false, // Turn off all chart animations. This turns off all ZRender hooks that might `requestAnimationFrame` + notMerge: false, // Enable ECharts option merging. Chart components are only re-drawn if they've changed autoHeightResize: shouldResize ?? true, useMultilineDate: true, grid: { @@ -661,7 +663,7 @@ function getChartComponent(chartProps: any, widget: Widget): React.ReactNode { switch (widget.displayType) { case 'bar': - return ; + return ; case 'area': case 'top_n': return ;