aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/DataVizBox/components/PieChart.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/PieChart.tsx')
-rw-r--r--src/client/views/nodes/DataVizBox/components/PieChart.tsx16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/PieChart.tsx b/src/client/views/nodes/DataVizBox/components/PieChart.tsx
index 4bd476bf3..561f39141 100644
--- a/src/client/views/nodes/DataVizBox/components/PieChart.tsx
+++ b/src/client/views/nodes/DataVizBox/components/PieChart.tsx
@@ -52,7 +52,6 @@ export class PieChart extends React.Component<PieChartProps> {
// organized by specified number percentages/ratios if one column is selected and it contains numbers
// otherwise, assume data is organized by categories
@computed get byCategory() {
- if (this.props.layoutDoc.dataViz_pie_asHistogram==undefined) this.props.layoutDoc.dataViz_pie_asHistogram = false;
return !/\d/.test(this.props.records[0][this.props.axes[0]]) || this.props.layoutDoc.dataViz_pie_asHistogram;
}
// filters all data to just display selected data if brushed (created from an incoming link)
@@ -324,9 +323,9 @@ export class PieChart extends React.Component<PieChartProps> {
};
@action changeHistogramCheckBox = () => {
- this.props.layoutDoc.dataViz_pie_asHistogram = !this.props.layoutDoc.dataViz_pie_asHistogram
- this.drawChart(this._pieChartData, this.width, this.height)
- }
+ this.props.layoutDoc.dataViz_pie_asHistogram = !this.props.layoutDoc.dataViz_pie_asHistogram;
+ this.drawChart(this._pieChartData, this.width, this.height);
+ };
render() {
var titleAccessor: any = '';
@@ -367,13 +366,12 @@ export class PieChart extends React.Component<PieChartProps> {
fillWidth
/>
</div>
- { (this.props.axes.length === 1 && /\d/.test(this.props.records[0][this.props.axes[0]]))?
- <div className={"asHistogram-checkBox"} style={{width: this.props.width}}>
+ {this.props.axes.length === 1 && /\d/.test(this.props.records[0][this.props.axes[0]]) ? (
+ <div className={'asHistogram-checkBox'} style={{ width: this.props.width }}>
<Checkbox color="primary" onChange={this.changeHistogramCheckBox} checked={this.props.layoutDoc.dataViz_pie_asHistogram as boolean} />
Organize data as histogram
- </div>
- : null
- }
+ </div>
+ ) : null}
<div ref={this._piechartRef} />
{selected != 'none' ? (
<div className={'selected-data'}>