aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2024-05-05 13:59:55 -0400
committersrichman333 <sarah_n_richman@brown.edu>2024-05-05 13:59:55 -0400
commitda26a65b4d0d767ac3ad44dad79cedc195dc918d (patch)
treea52d484e3f616fbd250cea3eeadc3c5f8aa484ea /src
parent0d38f3e9bc4306c9e38decef5497c88c67376a83 (diff)
bug fixed - when piechart has no data
Diffstat (limited to 'src')
-rw-r--r--src/client/views/nodes/DataVizBox/components/PieChart.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/PieChart.tsx b/src/client/views/nodes/DataVizBox/components/PieChart.tsx
index 3819c2f82..5c341e0b4 100644
--- a/src/client/views/nodes/DataVizBox/components/PieChart.tsx
+++ b/src/client/views/nodes/DataVizBox/components/PieChart.tsx
@@ -97,9 +97,9 @@ export class PieChart extends ObservableReactComponent<PieChartProps> {
{ fireImmediately: true }
);
// restore selected slices
- let key = Object.keys(this._pieChartData[0])[0]
var svg = this._piechartSvg;
- if (svg) {
+ if (svg && this._pieChartData[0]) {
+ let key = Object.keys(this._pieChartData[0])[0]
const selectedDataBars = StrListCast(this._props.layoutDoc.dataViz_pie_selectedData)
svg.selectAll('path').attr('class', (d: any) => {
let selected = false;