diff --git a/c3.js b/c3.js index 076fb14..6a93d21 100644 --- a/c3.js +++ b/c3.js @@ -989,7 +989,7 @@ .attr("transform", translate.x) .call(__axis_rotated ? yAxis : xAxis) .append("text") - .attr("class", "label") + .attr("class", "-axis-x-label") .attr("x", width) .attr("dy", "-.5em") .style("text-anchor", "end") @@ -1377,7 +1377,7 @@ main.select(".y2.axis").transition().call(yAxis2); // Update label position - main.select(".x.axis text.label").attr("x", width); + main.select(".x.axis .-axis-x-label").attr("x", width); // Update sub domain subY.domain(y.domain()); diff --git a/c3.min.js b/c3.min.js index abb8134..1b53a45 100644 --- a/c3.min.js +++ b/c3.min.js @@ -21,7 +21,7 @@ s(e[c].end)?q[c].end=a[a.length-1].x:z&&(q[c].end=ma(e[c].end));kc=f?function(a) l=D(a[c-1].value,a[c].value);g=b(a[c].x)-b(a[c-1].x);u=d(a[c].value)-d(a[c-1].value);g=Math.sqrt(Math.pow(g,2)+Math.pow(u,2));u=2/g;var t=2*u;for(g=u;1>=g;g+=t)r+=e(a[c-1],a[c],g,u)}return r}function rb(a){var b=k.data.targets=Ia(a),d,c;lc=e.select(ua);if(lc.empty())ga.alert('No bind element found. Check the selector specified by "bindto" and existance of that element. Default "bindto" is "#chart".');else{Q();zb();l.domain(e.extent(a.map(function(a){return a.x})));y.domain(ia("y"));R.domain(ia("y2")); Y.domain(l.domain());Ua.domain(y.domain());Va.domain(R.domain());J.ticks(10>a.length?a.length:10);la.ticks(Vc).outerTickSize(0).tickFormat(Wc);Wa.ticks(Xc).outerTickSize(0).tickFormat(Yc);S=l.domain();F.x(Y);oa&&G.x(l);La=e.select(ua).append("svg").attr("width",q+B+A).attr("height",t+w+X).on("mouseenter",Zc).on("mouseleave",$c);ab=La.append("defs");ab.append("clipPath").attr("id",sb).append("rect").attr("y",w).attr("width",q).attr("height",t-w);ab.append("clipPath").attr("id","xaxis-clip").append("rect").attr("x", -1-B).attr("y",-20).attr("width",V).attr("height",W);ab.append("clipPath").attr("id","yaxis-clip").append("rect").attr("x",-B+1).attr("y",w-1).attr("width",ha).attr("height",eb);g=La.append("g").attr("transform",K.main);x=xa?La.append("g").attr("transform",K.context):null;ya=za?La.append("g").attr("transform",K.legend):null;ca=e.select(ua).style("position","relative").append("div").style("position","absolute").style("width","30%").style("z-index","10").style("visibility","hidden");g.append("g").attr("class", -"x axis").attr("clip-path",f?"":"url(#xaxis-clip)").attr("transform",K.x).call(f?la:J).append("text").attr("class","label").attr("x",q).attr("dy","-.5em").style("text-anchor","end").text(ad);g.append("g").attr("class","y axis").attr("clip-path",f?"url(#yaxis-clip)":"").call(f?J:la).append("text").attr("transform","rotate(-90)").attr("dy","1.2em").attr("dx","-.5em").style("text-anchor","end").text(bd);Jb&&g.append("g").attr("class","y2 axis").attr("transform",K.y2).call(Wa);d=g.append("g").attr("clip-path", +"x axis").attr("clip-path",f?"":"url(#xaxis-clip)").attr("transform",K.x).call(f?la:J).append("text").attr("class","-axis-x-label").attr("x",q).attr("dy","-.5em").style("text-anchor","end").text(ad);g.append("g").attr("class","y axis").attr("clip-path",f?"url(#yaxis-clip)":"").call(f?J:la).append("text").attr("transform","rotate(-90)").attr("dy","1.2em").attr("dx","-.5em").style("text-anchor","end").text(bd);Jb&&g.append("g").attr("class","y2 axis").attr("transform",K.y2).call(Wa);d=g.append("g").attr("clip-path", Ma).attr("class","grid");mc&&d.append("g").attr("class","xgrids");tb&&(c=d.append("g").attr("class","xgrid-lines").selectAll(".xgrid-line").data(tb).enter().append("g").attr("class","xgrid-line"),c.append("line").attr("class",function(a){return""+a["class"]}),c.append("text").attr("class",function(a){return""+a["class"]}).attr("text-anchor","end").attr("transform",f?"":"rotate(-90)").attr("dx",f?0:-w).attr("dy",-6).text(function(a){return a.text}));cd&&d.append("g").attr("class","xgrid-focus").append("line").attr("class", "xgrid-focus").attr("x1",f?0:-10).attr("x2",f?q:-10).attr("y1",f?-10:w).attr("y2",f?-10:t);nc&&d.append("g").attr("class","ygrids");ub&&d.append("g").attr("class","ygrid-lines").selectAll("ygrid-line").data(ub).enter().append("line").attr("class",function(a){return"ygrid-line "+a["class"]});g.append("g").attr("clip-path",Ma).attr("class","regions");g.append("g").attr("clip-path",Ma).attr("class","chart");g.select(".chart").append("g").attr("class","event-rects").style("fill-opacity",0).style("cursor", oa?"ew-resize":null).selectAll(".event-rects").data(a).enter().append("rect").attr("class",function(a,b){return"event-rect event-rect-"+b}).style("cursor",da&&pa?"pointer":null).on("mouseover",function(a,b){if(!bb){var d=k.data.targets.map(function(a){return Cb(a.values[b])}),c,h;if(0