update changelog, coding style per review

This commit is contained in:
Ron Rennick 2019-02-15 10:37:56 -04:00
parent 86c89e741a
commit 9f911df053
3 changed files with 8 additions and 7 deletions

View File

@ -80,7 +80,7 @@ class DashboardCharts extends Component {
handleTypeToggle( chartType ) {
return () => {
this.setState( { chartType: chartType } );
this.setState( { chartType } );
const userDataFields = {
[ 'dashboard_chart_type' ]: chartType,
};
@ -146,7 +146,7 @@ class DashboardCharts extends Component {
render() {
const { path } = this.props;
const { chartType, hiddenChartKeys, interval } = this.state;
const query = { ...this.props.query, chartType: chartType, interval };
const query = { ...this.props.query, chartType, interval };
return (
<Fragment>
<div className="woocommerce-dashboard__dashboard-charts">

View File

@ -2,6 +2,7 @@
- Chart component: new props `emptyMessage` and `baseValue`. When an empty message is provided, it will be displayed on top of the chart if there are no values different than `baseValue`.
- Chart component: remove d3-array dependency.
- Chart component: fix display when there is no data.
- Chart component: change chart type query parameter to `chartType`.
- Improves display of charts where all values are 0.
- Fix X-axis labels in hourly bar charts.
- New `<Search>` prop named `showClearButton`, that will display a 'Clear' button when the search box contains one or more tags.

View File

@ -420,6 +420,10 @@ Chart.propTypes = {
* `emptyMessage` will be displayed if provided.
*/
baseValue: PropTypes.number,
/**
* Chart type of either `line` or `bar`.
*/
chartType: PropTypes.oneOf( [ 'bar', 'line' ] ),
/**
* An array of data.
*/
@ -491,10 +495,6 @@ Chart.propTypes = {
* A string to use as a title for the tooltip. Takes preference over `tooltipLabelFormat`.
*/
tooltipTitle: PropTypes.string,
/**
* Chart type of either `line` or `bar`.
*/
chartType: PropTypes.oneOf( [ 'bar', 'line' ] ),
/**
* What type of data is to be displayed? Number, Average, String?
*/
@ -515,6 +515,7 @@ Chart.propTypes = {
Chart.defaultProps = {
baseValue: 0,
chartType: 'line',
data: [],
dateParser: '%Y-%m-%dT%H:%M:%S',
interactiveLegend: true,
@ -524,7 +525,6 @@ Chart.defaultProps = {
showHeaderControls: true,
tooltipLabelFormat: '%B %d, %Y',
tooltipValueFormat: ',',
chartType: 'line',
xFormat: '%d',
x2Format: '%b %Y',
yFormat: '$.3s',