From 5a1bf41682f641967304c8a7fa7df9b6b343b7b2 Mon Sep 17 00:00:00 2001
From: srichman333 <sarah_n_richman@brown.edu>
Date: Thu, 10 Aug 2023 13:21:10 -0400
Subject: changing selected slice/bar color w different data types bug fix

---
 src/client/views/nodes/DataVizBox/components/PieChart.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'src/client/views/nodes/DataVizBox/components/PieChart.tsx')

diff --git a/src/client/views/nodes/DataVizBox/components/PieChart.tsx b/src/client/views/nodes/DataVizBox/components/PieChart.tsx
index de725209d..03c9efdd1 100644
--- a/src/client/views/nodes/DataVizBox/components/PieChart.tsx
+++ b/src/client/views/nodes/DataVizBox/components/PieChart.tsx
@@ -266,7 +266,7 @@ export class PieChart extends React.Component<PieChartProps> {
                 }
                 var sliceColor;
                 if (dataPoint){
-                    var accessByName = descriptionField? dataPoint[descriptionField] : dataPoint[percentField];
+                    var accessByName = dataPoint[this.props.axes[0]].replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, '');
                     var sliceColors = StrListCast(this.props.layoutDoc.pieSliceColors).map(each => each.split('::'));
                     sliceColors.map(each => {if (each[0]==StrCast(accessByName)) sliceColor = each[1]});
                 }
-- 
cgit v1.2.3-70-g09d2

