How to show D3 Graph with Year and month on x-axis across different years

徘徊边缘 提交于 2019-12-24 22:16:34

问题


I have created a D3 chart with year column as a number and have worked. But now we need to add the month and so I have added the month for one year as 201701,201702,201703,201704......201712 then the code is working fine as expected.

But when I just include 201611 (Nov 2016) for years list then 2017 year months all overlap.(I understand that it is taking as a number and that's why the number the difference between 201701 and 201611)

This is the screenshot:

I have tried with the changing that x-axis field as date field as now it is parsing as a number but was unsuccessful.

My Code is in : plunker

The binding of Graph is present in the mainscript.js and how to change x-axis as date fields

来源:https://stackoverflow.com/questions/47815204/how-to-show-d3-graph-with-year-and-month-on-x-axis-across-different-years

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!