Repository: incubator-airflow
Updated Branches:
  refs/heads/v1-9-test 27068450a -> 70ffa43ad


[AIRFLOW-1432] Charts label for Y axis not visible

The NVD3 charts did _have_ labels on the y-axis
saying the unit (hours,
minutes etc) but they weren't _visible_. nvd3.js
correctly places labels
on the xAxis, but it doesn't correctly space them
on the vertical axis.

Closes #2710 from ashb/AIRFLOW-1432-chart-y-axes

(cherry picked from commit 4d1466b655e21b7756f22b5c2a3937811d0c65cf)
Signed-off-by: Bolke de Bruin <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/70ffa43a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/70ffa43a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/70ffa43a

Branch: refs/heads/v1-9-test
Commit: 70ffa43ad467e0c5ac9f8cca4971af5347c354fd
Parents: 2706845
Author: Ash Berlin-Taylor <[email protected]>
Authored: Sun Oct 22 19:17:43 2017 +0200
Committer: Bolke de Bruin <[email protected]>
Committed: Sun Oct 22 19:18:04 2017 +0200

----------------------------------------------------------------------
 airflow/www/views.py | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/70ffa43a/airflow/www/views.py
----------------------------------------------------------------------
diff --git a/airflow/www/views.py b/airflow/www/views.py
index eb858f1..3f5c654 100644
--- a/airflow/www/views.py
+++ b/airflow/www/views.py
@@ -1437,8 +1437,10 @@ class Airflow(BaseView):
         # update the y Axis on both charts to have the correct time units
         chart.create_y_axis('yAxis', format='.02f', custom_format=False,
                             label='Duration ({})'.format(y_unit))
+        chart.axislist['yAxis']['axisLabelDistance'] = '40'
         cum_chart.create_y_axis('yAxis', format='.02f', custom_format=False,
                                 label='Duration ({})'.format(cum_y_unit))
+        cum_chart.axislist['yAxis']['axisLabelDistance'] = '40'
         for task in dag.tasks:
             if x[task.task_id]:
                 chart.add_serie(name=task.task_id, x=x[task.task_id],
@@ -1587,6 +1589,7 @@ class Airflow(BaseView):
         # update the y Axis to have the correct time units
         chart.create_y_axis('yAxis', format='.02f', custom_format=False,
                             label='Landing Time ({})'.format(y_unit))
+        chart.axislist['yAxis']['axisLabelDistance'] = '40'
         for task in dag.tasks:
             if x[task.task_id]:
                 chart.add_serie(name=task.task_id, x=x[task.task_id],

Reply via email to