This is my code我有xaxis1,其中包含月份名称:January..December。 我想让evry月值可选,所以我添加了这个函数:
d3.select(".xAxis1") //selecting xAxis1 division
.selectAll(".major") //select all the tiket defined on it
.on("click",clickMe) //applay the function on clik to each value
function clickMe(){alert("I've been clicked!")}
但它不起作用?!!任何想法?
答案 0 :(得分:1)
如果某人需要相同的东西,这个代码: http://vida.io/documents/LD3gAW64tv5yYj3yf
答案 1 :(得分:0)
我对d3js并不擅长,但为什么你没有尝试。
d3.select(".xAxis1") //selecting xAxis1 division
.on("click",clickMe); //applay the function on clik to each value
d3.selectAll(".major") //select all the tiket defined on it
.on("click",clickMe) //applay the function on clik to each value
function clickMe(){alert("I've been clicked!")}
当我看了你的代码时,我认为".xAxis1"
不正确,应该是
".axis1"