diff --git a/src/visualizations/config/adapters/dhis_highcharts/subtitle/index.js b/src/visualizations/config/adapters/dhis_highcharts/subtitle/index.js index 585842325..9d2dc1bc7 100644 --- a/src/visualizations/config/adapters/dhis_highcharts/subtitle/index.js +++ b/src/visualizations/config/adapters/dhis_highcharts/subtitle/index.js @@ -50,8 +50,11 @@ export default function (series, layout, metaData, dashboard) { } // DHIS2-578: allow for optional custom subtitle - if (isString(layout.subtitle)) { - subtitle.text = layout.subtitle + const customSubtitle = + (layout.subtitle && layout.displaySubtitle) || layout.subtitle + + if (isString(customSubtitle) && customSubtitle.length) { + subtitle.text = customSubtitle } else { const filterTitle = getFilterText(layout.filters, metaData) diff --git a/src/visualizations/config/adapters/dhis_highcharts/title/index.js b/src/visualizations/config/adapters/dhis_highcharts/title/index.js index 3a42cb5f7..e4e4f1a4a 100644 --- a/src/visualizations/config/adapters/dhis_highcharts/title/index.js +++ b/src/visualizations/config/adapters/dhis_highcharts/title/index.js @@ -55,8 +55,10 @@ export default function (layout, metaData, dashboard) { return title } - if (isString(layout.title) && layout.title.length) { - title.text = layout.title + const customTitle = (layout.title && layout.displayTitle) || layout.title + + if (isString(customTitle) && customTitle.length) { + title.text = customTitle } else { switch (layout.type) { case VIS_TYPE_GAUGE: