diff --git a/airflow/www/views.py b/airflow/www/views.py index 3bf3fb783fe9a..cdee2b9aa5cb0 100644 --- a/airflow/www/views.py +++ b/airflow/www/views.py @@ -431,6 +431,10 @@ class AirflowBaseView(BaseView): # noqa: D101 'macros': macros, } + line_chart_attr = { + 'legend.maxKeyLength': 200, + } + def render_template(self, *args, **kwargs): return super().render_template( *args, @@ -2305,8 +2309,18 @@ def duration(self, session=None): if root: dag = dag.partial_subset(task_ids_or_regex=root, include_upstream=True, include_downstream=False) chart_height = wwwutils.get_chart_height(dag) - chart = nvd3.lineChart(name="lineChart", x_is_date=True, height=chart_height, width="1200") - cum_chart = nvd3.lineChart(name="cumLineChart", x_is_date=True, height=chart_height, width="1200") + chart = nvd3.lineChart( + name="lineChart", + x_is_date=True, + height=chart_height, + chart_attr=self.line_chart_attr + ) + cum_chart = nvd3.lineChart( + name="cumLineChart", + x_is_date=True, + height=chart_height, + chart_attr=self.line_chart_attr + ) y_points = defaultdict(list) x_points = defaultdict(list) @@ -2425,7 +2439,11 @@ def tries(self, session=None): chart_height = wwwutils.get_chart_height(dag) chart = nvd3.lineChart( - name="lineChart", x_is_date=True, y_axis_format='d', height=chart_height, width="1200" + name="lineChart", + x_is_date=True, + y_axis_format='d', + height=chart_height, + chart_attr=self.line_chart_attr ) for task in dag.tasks: @@ -2495,7 +2513,12 @@ def landing_times(self, session=None): dag = dag.partial_subset(task_ids_or_regex=root, include_upstream=True, include_downstream=False) chart_height = wwwutils.get_chart_height(dag) - chart = nvd3.lineChart(name="lineChart", x_is_date=True, height=chart_height, width="1200") + chart = nvd3.lineChart( + name="lineChart", + x_is_date=True, + height=chart_height, + chart_attr=self.line_chart_attr + ) y_points = {} x_points = {} for task in dag.tasks: