aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsrichman333 <sarah_n_richman@brown.edu>2023-08-09 12:58:59 -0400
committersrichman333 <sarah_n_richman@brown.edu>2023-08-09 12:58:59 -0400
commit79a5cddf969a027811a9b7069f8ae8614b825a05 (patch)
tree51a2ffbee1c601a84575fcd4fbb68cbce6f1de4a
parentd70e2a955633734d5c19c2e76efb075ddf33327b (diff)
display clarification for when a string column is given to a LineChart
-rw-r--r--src/client/views/nodes/DataVizBox/components/LineChart.tsx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/LineChart.tsx b/src/client/views/nodes/DataVizBox/components/LineChart.tsx
index 16794886e..053696807 100644
--- a/src/client/views/nodes/DataVizBox/components/LineChart.tsx
+++ b/src/client/views/nodes/DataVizBox/components/LineChart.tsx
@@ -358,7 +358,7 @@ export class LineChart extends React.Component<LineChartProps> {
if (!this.props.layoutDoc[titleAccessor]) this.props.layoutDoc[titleAccessor] = this.defaultGraphTitle;
const selectedPt = this._currSelected ? `x: ${this._currSelected.x} y: ${this._currSelected.y}` : 'none';
return (
- this.props.axes.length >= 2 ? (
+ this.props.axes.length>=2 && /\d/.test(this.props.pairs[0][this.props.axes[0]]) && /\d/.test(this.props.pairs[0][this.props.axes[1]]) ? (
<div className="chart-container" >
<div className="graph-title">
<EditableText
@@ -374,7 +374,7 @@ export class LineChart extends React.Component<LineChartProps> {
<div className={'selected-data'}> {`Selected: ${selectedPt}`}</div>
: null}
</div>
- ) : <span className="chart-container"> {'first use table view to select two axes to plot'}</span>
+ ) : <span className="chart-container"> {'first use table view to select two numerical axes to plot'}</span>
);
}
}