D3 Chart Component: split out example + index and handle full-width
This commit is contained in:
parent
5f85e75b97
commit
0c7d016629
|
@ -150,7 +150,10 @@ class D3Chart extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={ classNames( 'woocommerce-chart__container', this.props.className ) }>
|
<div
|
||||||
|
className={ classNames( 'woocommerce-chart__container', this.props.className ) }
|
||||||
|
style={ { maxHeight: this.props.height } }
|
||||||
|
>
|
||||||
<D3Base
|
<D3Base
|
||||||
className={ classNames( this.props.className ) }
|
className={ classNames( this.props.className ) }
|
||||||
data={ this.state.allData }
|
data={ this.state.allData }
|
||||||
|
|
|
@ -163,7 +163,7 @@ class WidgetCharts extends Component {
|
||||||
const margin = {
|
const margin = {
|
||||||
bottom: 50,
|
bottom: 50,
|
||||||
left: 50,
|
left: 50,
|
||||||
right: 20,
|
right: 0,
|
||||||
top: 0,
|
top: 0,
|
||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
|
@ -202,8 +202,8 @@ class WidgetCharts extends Component {
|
||||||
height={ 300 }
|
height={ 300 }
|
||||||
margin={ margin }
|
margin={ margin }
|
||||||
orderedKeys={ this.state.orderedKeys }
|
orderedKeys={ this.state.orderedKeys }
|
||||||
type={ 'line' }
|
type={ 'bar' }
|
||||||
width={ chartDirection === 'row' ? 722 : 1042 }
|
width={ chartDirection === 'row' ? 762 : 1082 }
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{ this.state.bodyWidth < WIDE_BREAKPOINT && (
|
{ this.state.bodyWidth < WIDE_BREAKPOINT && (
|
||||||
|
|
Loading…
Reference in New Issue