aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/components/Histogram.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/Histogram.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/components/Histogram.tsx14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx
index b574a0062..02f1ddbbb 100644
--- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx
+++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx
@@ -394,21 +394,11 @@ export class Histogram extends React.Component<HistogramProps> {
@action changeSelectedColor = (color: string) => {
this.curBarSelected.attr("fill", color);
var barName = StrCast(this._currSelected[this.props.axes[0]].replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, ''))
- // this.props.layoutDoc['histogramBarColors-'+barName] = color;
const barColors = Cast(this.props.layoutDoc.histogramBarColors, listSpec("string"), null);
- barColors.map(each => { if (each.split('::')[0] == barName) barColors.splice(barColors.indexOf(each)) });
+ barColors.map(each => { if (each.split('::')[0] == barName) barColors.splice(barColors.indexOf(each), 1) });
barColors.push(StrCast(barName + '::' + color));
};
-
- @action changeDefaultColor = (color: string) => {
- const defaultColorBars = this._histogramSvg!.selectAll('.histogram-bar').filter((d: any) => {
- if (this.props.layoutDoc['histogramBarColors-'+d[0]]) return false;
- else return true;
- })
- defaultColorBars.attr("fill", color);
- this.props.layoutDoc.defaultHistogramColor = color;
- };
render() {
var curSelectedBarName;
@@ -451,7 +441,7 @@ export class Histogram extends React.Component<HistogramProps> {
type={Type.SEC}
icon={<FaFillDrip/>}
selectedColor={StrCast(this.props.layoutDoc.defaultHistogramColor)}
- setSelectedColor={color => this.changeDefaultColor(color)}
+ setSelectedColor={color => this.props.layoutDoc.defaultHistogramColor = color}
size={Size.XSMALL}
/>
&nbsp;