diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2024-01-29 13:15:27 -0500 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2024-01-29 13:15:27 -0500 |
commit | d252886fe97524603ee49e577a535a39f1e664ae (patch) | |
tree | b979ed0b84b104668a03023cc3cec2852f4167f6 /src/client/views/nodes/DataVizBox/components/Histogram.tsx | |
parent | 16c4a0ad4f9c33e6e52241bef8e6b250237226ae (diff) |
show title of selected histogram bars
Diffstat (limited to 'src/client/views/nodes/DataVizBox/components/Histogram.tsx')
-rw-r--r-- | src/client/views/nodes/DataVizBox/components/Histogram.tsx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/client/views/nodes/DataVizBox/components/Histogram.tsx b/src/client/views/nodes/DataVizBox/components/Histogram.tsx index 44e8b97c6..c0e738cfa 100644 --- a/src/client/views/nodes/DataVizBox/components/Histogram.tsx +++ b/src/client/views/nodes/DataVizBox/components/Histogram.tsx @@ -452,6 +452,18 @@ export class Histogram extends ObservableReactComponent<HistogramProps> { : '' ); selected = selected.substring(0, selected.length - 2) + ' }'; + if (this._props.titleCol!="" && (!this._currSelected["frequency"] || this._currSelected["frequency"]<10)){ + selected+= "\n" + this._props.titleCol + ": " + this._tableData.forEach(each => { + if (this._currSelected[this._props.axes[0]]==each[this._props.axes[0]]) { + if (this._props.axes[1]){ + if (this._currSelected[this._props.axes[1]]==each[this._props.axes[1]]) selected+= each[this._props.titleCol] + ", "; + } + else selected+= each[this._props.titleCol] + ", "; + } + }) + selected = selected.slice(0,-1).slice(0,-1); + } } var selectedBarColor; var barColors = StrListCast(this._props.layoutDoc.histogramBarColors).map(each => each.split('::')); |