From 287601e95e57f51e7f97d38cd8e3266d89ad9cc6 Mon Sep 17 00:00:00 2001 From: stevetracvc <70416691+stevetracvc@users.noreply.github.com> Date: Sun, 3 Oct 2021 08:12:24 -0600 Subject: [PATCH] feat(legacy-plugin-chart-histogram): cumulative histogram option (#1381) * Add a cumulative option to make a cumulative histogram * also add in percentile in the hover popup * fix: add precision to percentile label * fix: formatting ES lint issues --- .../legacy-plugin-chart-histogram/src/Histogram.jsx | 8 ++++++++ .../src/controlPanel.ts | 12 ++++++++++++ .../src/transformProps.js | 2 ++ 3 files changed, 22 insertions(+) diff --git a/superset-frontend/temporary_superset_ui/superset-ui/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx b/superset-frontend/temporary_superset_ui/superset-ui/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx index b727d31012421..b231b0ae6ea6d 100644 --- a/superset-frontend/temporary_superset_ui/superset-ui/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx +++ b/superset-frontend/temporary_superset_ui/superset-ui/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx @@ -38,6 +38,7 @@ const propTypes = { height: PropTypes.number.isRequired, colorScheme: PropTypes.string, normalized: PropTypes.bool, + cumulative: PropTypes.bool, binCount: PropTypes.number, opacity: PropTypes.number, xAxisLabel: PropTypes.string, @@ -49,6 +50,7 @@ const defaultProps = { className: '', colorScheme: '', normalized: false, + cumulative: false, opacity: 1, xAxisLabel: '', yAxisLabel: '', @@ -64,6 +66,7 @@ class CustomHistogram extends React.PureComponent { binCount, colorScheme, normalized, + cumulative, opacity, xAxisLabel, yAxisLabel, @@ -100,6 +103,7 @@ class CustomHistogram extends React.PureComponent { height={parent.height} ariaLabel="Histogram" normalized={normalized} + cumulative={cumulative} binCount={binCount} binType="numeric" margin={{ top: 20, right: 20 }} @@ -116,6 +120,10 @@ class CustomHistogram extends React.PureComponent { {t('cumulative')} {datum.cumulative} +