From 129fc61ad54df4b21e8ac253d1431142e0d7ebe7 Mon Sep 17 00:00:00 2001 From: psuslick <31072678+psuslick@users.noreply.github.com> Date: Thu, 15 Apr 2021 18:53:17 -0400 Subject: [PATCH] Added app builder configuration for "show legend" to toggle display of chart legend To address concerns which were raised in issue #39 (https://github.com/SalesforceLabs/LightningWebChartJS/issues/39) this feature adds an ability for the app builder to toggle display of the legend on or off. --- .../default/lwc/chartBuilder/chartBuilder.html | 3 ++- .../default/lwc/chartBuilder/chartBuilder.js | 5 ++++- .../lwc/chartBuilder/chartBuilder.js-meta.xml | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/force-app/main/default/lwc/chartBuilder/chartBuilder.html b/force-app/main/default/lwc/chartBuilder/chartBuilder.html index daa8759e..48b9097a 100644 --- a/force-app/main/default/lwc/chartBuilder/chartBuilder.html +++ b/force-app/main/default/lwc/chartBuilder/chartBuilder.html @@ -31,6 +31,7 @@ @@ -67,4 +68,4 @@

- + \ No newline at end of file diff --git a/force-app/main/default/lwc/chartBuilder/chartBuilder.js b/force-app/main/default/lwc/chartBuilder/chartBuilder.js index 928b5535..35605ab1 100644 --- a/force-app/main/default/lwc/chartBuilder/chartBuilder.js +++ b/force-app/main/default/lwc/chartBuilder/chartBuilder.js @@ -41,6 +41,9 @@ export default class ChartBuilder extends LightningElement { @api legendPosition; + @api + showLegend; + @api colorPalette = 'default'; @@ -261,4 +264,4 @@ export default class ChartBuilder extends LightningElement { static FAKE_ID = 'xxxxxxxxxxxxxxx'; static SOQL_DATA_PROVIDER_APEX_TYPE = 'SOQLDataProvider'; static DEFAULT_CSS_CLASS = 'slds-card slds-p-around_small'; -} +} \ No newline at end of file diff --git a/force-app/main/default/lwc/chartBuilder/chartBuilder.js-meta.xml b/force-app/main/default/lwc/chartBuilder/chartBuilder.js-meta.xml index 75d495f9..5331c313 100644 --- a/force-app/main/default/lwc/chartBuilder/chartBuilder.js-meta.xml +++ b/force-app/main/default/lwc/chartBuilder/chartBuilder.js-meta.xml @@ -49,6 +49,14 @@ type="String" datasource="top,bottom,right,left" /> + +