I actually wanted to populate a fixed date range between two different dates in X-Axis and I wanted to show the Scatter points in that range.
Here is the state :
label: 'Scatter Dataset',
data: {
datasets: typeof this.props.data === 'object' && this.props.data !== null ? this.props.data.datasets: []
},
options: {
scales: {
xAxes: [{
display: true,
type: 'time',
time: {
unit: 'hour',
displayFormats: {
hour: 'DD (HH:mm)'
}
},
distribution: 'series'
}],
yAxes: [{
scaleLabel: {
display: true,
labelString: 'value'
}
}]
},
React chart js 2
<Scatter ref="chart" data={this.state.data} options={this.state.options} style={{padding: 10}} height={80}/>