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.tsx11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx
index c6e3b4cd1..e5e3ccd53 100644
--- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx
+++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx
@@ -446,9 +446,9 @@ export class Histogram extends React.Component<HistogramProps> {
this.componentDidMount();
var curSelectedBarName;
var titleAccessor: any='';
- if (this.props.axes.length==2) titleAccessor = StrCast(this.props.layoutDoc['histogram-title-'+this.props.axes[0]+'-'+this.props.axes[1]]);
- else if (this.props.axes.length>0) titleAccessor = StrCast(this.props.layoutDoc['histogram-title-'+this.props.axes[0]]);
- const title = titleAccessor? titleAccessor : this.defaultGraphTitle;
+ if (this.props.axes.length==2) titleAccessor = 'histogram-title-'+this.props.axes[0]+'-'+this.props.axes[1];
+ else if (this.props.axes.length>0) titleAccessor = 'histogram-title-'+this.props.axes[0];
+ if (!this.props.layoutDoc[titleAccessor]) this.props.layoutDoc[titleAccessor] = this.defaultGraphTitle;
var selected: string;
if (this._currSelected){
curSelectedBarName = StrCast(this._currSelected![this.props.axes[0]].replace(/\$/g, '').replace(/\%/g, '').replace(/\</g, ''))
@@ -465,9 +465,8 @@ export class Histogram extends React.Component<HistogramProps> {
<div className="chart-container" >
<div className="graph-title">
<EditableText
- val={title}
- setVal={action(val => {this.props.axes.length>1? this.props.layoutDoc['histogram-title-'+this.props.axes[0]+"-"+this.props.axes[1]] = val as string
- : this.props.layoutDoc['histogram-title-'+this.props.axes[0]] = val as string})}
+ val={StrCast(this.props.layoutDoc[titleAccessor])}
+ setVal={action(val => this.props.layoutDoc[titleAccessor] = val as string)}
color={"black"}
size={Size.LARGE}
fillWidth