Skip to content
This repository has been archived by the owner on Jun 25, 2020. It is now read-only.

Commit

Permalink
fix: horizon chart should scroll when overflowing
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Aug 19, 2019
1 parent 8479099 commit 52dc2e3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

.superset-legacy-chart-horizon {
overflow: auto;
position: relative;
}

.superset-legacy-chart-horizon .horizon-row {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import './HorizonChart.css';
const propTypes = {
className: PropTypes.string,
width: PropTypes.number,
height: PropTypes.number,
seriesHeight: PropTypes.number,
data: PropTypes.arrayOf(
PropTypes.shape({
Expand Down Expand Up @@ -60,6 +61,7 @@ class HorizonChart extends React.PureComponent {
const {
className,
width,
height,
data,
seriesHeight,
bands,
Expand All @@ -75,8 +77,9 @@ class HorizonChart extends React.PureComponent {
yDomain = d3Extent(allValues, d => d.y);
}

console.log('SUPER', height);
return (
<div className={`superset-legacy-chart-horizon ${className}`}>
<div className={`superset-legacy-chart-horizon ${className}`} style={{ height: height }}>
{data.map(row => (
<HorizonRow
key={row.key}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
* under the License.
*/
export default function transformProps(chartProps) {
const { width, formData, payload } = chartProps;
const { height, width, formData, payload } = chartProps;
const { horizonColorScale, seriesHeight } = formData;

return {
colorScale: horizonColorScale,
data: payload.data,
seriesHeight: parseInt(seriesHeight, 10),
width,
height,
};
}

0 comments on commit 52dc2e3

Please sign in to comment.