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.tsx62
1 files changed, 35 insertions, 27 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/PieChart.tsx b/src/client/views/nodes/DataVizBox/components/PieChart.tsx
index 03c9efdd1..0c54d0a4e 100644
--- a/src/client/views/nodes/DataVizBox/components/PieChart.tsx
+++ b/src/client/views/nodes/DataVizBox/components/PieChart.tsx
@@ -337,36 +337,44 @@ export class PieChart extends React.Component<PieChartProps> {
var sliceColors = StrListCast(this.props.layoutDoc.pieSliceColors).map(each => each.split('::'));
sliceColors.map(each => {if (each[0]==curSelectedSliceName!) selectedSliceColor = each[1]});
- return (
- this.props.axes.length >= 1 ? (
- <div className="chart-container">
- <div className="graph-title">
- <EditableText
- val={StrCast(this.props.layoutDoc[titleAccessor])}
- setVal={undoable (action(val => this.props.layoutDoc[titleAccessor] = val as string), "Change Graph Title")}
- color={"black"}
- size={Size.LARGE}
- fillWidth
- />
- </div>
- <div ref={this._piechartRef} />
- {selected != 'none' ?
- <div className={'selected-data'}>
- Selected: {selected}
- &nbsp; &nbsp;
- <ColorPicker
- tooltip={'Change Slice Color'}
- type={Type.SEC}
- icon={<FaFillDrip/>}
- selectedColor={selectedSliceColor? selectedSliceColor : this.curSliceSelected.attr("fill")}
- setSelectedColor={undoable (color => this.changeSelectedColor(color), "Change Selected Slice Color")}
- size={Size.XSMALL}
+ if (this._piechartData.length>0){
+ return (
+ this.props.axes.length >= 1 ? (
+ <div className="chart-container">
+ <div className="graph-title">
+ <EditableText
+ val={StrCast(this.props.layoutDoc[titleAccessor])}
+ setVal={undoable (action(val => this.props.layoutDoc[titleAccessor] = val as string), "Change Graph Title")}
+ color={"black"}
+ size={Size.LARGE}
+ fillWidth
/>
</div>
- : null}
+ <div ref={this._piechartRef} />
+ {selected != 'none' ?
+ <div className={'selected-data'}>
+ Selected: {selected}
+ &nbsp; &nbsp;
+ <ColorPicker
+ tooltip={'Change Slice Color'}
+ type={Type.SEC}
+ icon={<FaFillDrip/>}
+ selectedColor={selectedSliceColor? selectedSliceColor : this.curSliceSelected.attr("fill")}
+ setSelectedColor={undoable (color => this.changeSelectedColor(color), "Change Selected Slice Color")}
+ size={Size.XSMALL}
+ />
+ </div>
+ : null}
+ </div>
+ ) : <span className="chart-container"> {'first use table view to select a column to graph'}</span>
+ );
+ }
+ else return (
+ // when it is a brushed table and the incoming table doesn't have any rows selected
+ <div className='chart-container'>
+ Selected rows of data from the incoming DataVizBox to display.
</div>
- ) : <span className="chart-container"> {'first use table view to select a column to graph'}</span>
- );
+ )
}
} \ No newline at end of file