Extend chart component to accept layouts
@@ -2,10 +2,13 @@ import * as React from 'react';
import * as Plotly from 'plotly.js';
+import { ChartTypes } from '../../models/chart';
import PlotlyChart from './plotlyChart';
interface Props {
data: Plotly.PlotData[];
+ layout: Plotly.Layout;
+ chartType: ChartTypes;
title?: string;
}
@@ -14,21 +17,7 @@ export default class Chart extends React.Component<Props, {}> {
return (
<PlotlyChart
data={this.props.data}
- layout={
- {
- title: this.props.title,
- autosize: true,
- titlefont: {size: 13},
- margin: {
- l: 50,
- r: 20,
- b: 50,
- t: 20,
- },
- showlegend: true,
- legend: {orientation: 'h'}
- }
- }
+ layout={this.props.layout}
config={{displayModeBar: false}}
/>
);
