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

fix: horizon chart should scroll when overflowing #180

Merged
merged 3 commits into from
Nov 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 All @@ -47,6 +48,7 @@ const propTypes = {
const defaultProps = {
className: '',
width: 800,
height: 600,
seriesHeight: 20,
bands: Math.floor(DEFAULT_COLORS.length / 2),
colors: DEFAULT_COLORS,
Expand All @@ -60,6 +62,7 @@ class HorizonChart extends React.PureComponent {
const {
className,
width,
height,
data,
seriesHeight,
bands,
Expand All @@ -76,7 +79,7 @@ class HorizonChart extends React.PureComponent {
}

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

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