I'm working on a scatter plot in d3js which isolates winter months. Is there a quick and easy way to format the x scale such that I do not have a gap in the graph from March to December? I'd prefer the x axis to range from December 21 to March 21:
You can extend your dates to have a year, even if you don't want it shown, assigning the months after July the previous year than the months of the first semester:
var data = [
{date: '2012/12/01', RH: 50, ...},
{date: '2012/12/02', RH: 55, ...},
...
{date: '2013/03/31', RH: 89, ...}
];
And use d3.extent
to set the extents of the date scale. The axis should show a continuous interval between December to March. Regards,
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.