@@ -11,6 +11,8 @@ import {HelpIcon} from '../../ui/HelpIcon.jsx';
1111import { ToolbarButton } from '../../ui/ToolbarButton.jsx' ;
1212
1313import * as ChartsCntlr from '../ChartsCntlr.js' ;
14+ import { isPlotly } from '../ChartUtil.js' ;
15+ import { downloadChart } from '../ui/PlotlyWrapper.jsx' ;
1416import { HistogramOptions } from '../ui/HistogramOptions.jsx' ;
1517import { Histogram } from '../ui/Histogram.jsx' ;
1618import { getChartProperties , updateOnStoreChange , FilterEditorWrapper } from './TblView.jsx' ;
@@ -19,6 +21,7 @@ import OUTLINE_EXPAND from 'html/images/icons-2014/24x24_ExpandArrowsWhiteOutlin
1921import SETTINGS from 'html/images/icons-2014/24x24_GearsNEW.png' ;
2022import CLEAR_FILTERS from 'html/images/icons-2014/24x24_FilterOff_Circle.png' ;
2123import FILTER from 'html/images/icons-2014/24x24_Filter.png' ;
24+ import SAVE from 'html/images/icons-2014/24x24_Save.png' ;
2225import LOADING from 'html/images/gxt/loading.gif' ;
2326
2427export const HISTOGRAM_TBLVIEW = {
@@ -33,7 +36,7 @@ export const HISTOGRAM_TBLVIEW = {
3336
3437
3538function Chart ( props ) {
36- const { chartId, tblId, chartData, widthPx, heightPx, eventCallback } = props ;
39+ const { chartId, tblId, chartData, widthPx, heightPx} = props ;
3740 if ( ! TblUtil . isFullyLoaded ( tblId ) || ! chartData || ! heightPx || ! widthPx ) {
3841 return ( < div /> ) ;
3942 }
@@ -72,7 +75,6 @@ function Chart(props) {
7275 xAxis = { xAxis }
7376 yAxis = { yAxis }
7477 xUnit = { unit }
75- eventCallback = { eventCallback }
7678 chartId = { chartId }
7779
7880 />
@@ -133,6 +135,7 @@ Options.propTypes = {
133135 optionsKey : PropTypes . string
134136} ;
135137
138+
136139function Toolbar ( { chartId, expandable, expandedMode, toggleOptions} ) {
137140 const { tableModel, help_id} = getChartProperties ( chartId ) ;
138141 return (
@@ -150,6 +153,10 @@ function Toolbar({chartId, expandable, expandedMode, toggleOptions}) {
150153 visible = { true }
151154 badgeCount = { TblUtil . getFilterCount ( tableModel ) }
152155 onClick = { ( ) => toggleOptions ( 'filters' ) } />
156+ { isPlotly ( ) && < img className = 'PanelToolbar__button'
157+ title = 'Download the chart as a PNG image'
158+ src = { SAVE }
159+ onClick = { ( ) => downloadChart ( chartId ) } /> }
153160 < img className = 'PanelToolbar__button'
154161 title = 'Chart options and tools'
155162 src = { SETTINGS }
0 commit comments