Browse Source

Fix y tick format - #36

pull/38/merge 0.1.11
Masayuki Tanaka 11 years ago
parent
commit
c5f21ae2da
  1. 4
      c3.js
  2. 8
      c3.min.js

4
c3.js

@ -89,7 +89,7 @@
__axis_y_center = getConfig(['axis', 'y', 'center'], null),
__axis_y_label = getConfig(['axis', 'y', 'label'], null),
__axis_y_inner = getConfig(['axis', 'y', 'inner'], false),
__axis_y_tick_format = getConfig(['axis', 'y', 'tick', 'format'], function (d) { return d; }),
__axis_y_tick_format = getConfig(['axis', 'y', 'tick', 'format'], null),
__axis_y_padding = getConfig(['axis', 'y', 'padding'], null),
__axis_y_ticks = getConfig(['axis', 'y', 'ticks'], 10),
__axis_y2_show = getConfig(['axis', 'y2', 'show'], false),
@ -99,7 +99,7 @@
// not used
// __axis_y2_label = getConfig(['axis', 'y2', 'text'], null),
__axis_y2_inner = getConfig(['axis', 'y2', 'inner'], false),
__axis_y2_tick_format = getConfig(['axis', 'y2', 'tick', 'format'], function (d) { return d; }),
__axis_y2_tick_format = getConfig(['axis', 'y2', 'tick', 'format'], null),
__axis_y2_padding = getConfig(['axis', 'y2', 'padding'], null),
__axis_y2_ticks = getConfig(['axis', 'y2', 'ticks'], 10),
__axis_rotated = getConfig(['axis', 'rotated'], false);

8
c3.min.js vendored

@ -69,10 +69,10 @@ function(){return oa/2-9}).attr("width",10).attr("height",10);d.append("text").t
function(a,b){return e+Za*b+14})}function $a(a){return t(a)?".target-"+a:".target"}function lc(a){return Gc(a.id)}function mc(a){return"data"in a&&Gc(a.data.id)}var k={data:{}},qb={},da="_expanded_",ma="_selected_",ic="_included_",wa=g(["bindto"],"#chart"),Ja=g(["size","width"],null),Gb=g(["size","height"],null),bb=g(["padding","left"],null),db=g(["padding","right"],null),sa=g(["zoom","enabled"],!1),sd=g(["zoom","extent"],null),we=g(["zoom","privileged"],!1),qe=g(["onenter"],function(){}),re=g(["onleave"],
function(){}),Ce=g(["transition","duration"],350);if(!("data"in ea))throw Error("data is required in config");var qa=g(["data","x"],null),ba=g(["data","xs"],null),Vb=g(["data","x_format"],"%Y-%m-%d"),Wd=g(["data","id_converter"],function(a){return a}),Oa=g(["data","names"],{}),w=g(["data","groups"],[]),vc=g(["data","axes"],{}),Ec=g(["data","type"],null),A=g(["data","types"],{}),td=g(["data","regions"],{}),Ke=g(["data","colors"],{}),ka=g(["data","selection","enabled"],!1),ta=g(["data","selection",
"grouped"],!1),la=g(["data","selection","isselectable"],function(){return!0}),Ca=g(["subchart","show"],!1),Bb=Ca?g(["subchart","size","height"],60):0,Le=g(["color","pattern"],null),Ea=g(["legend","show"],!0),Za=g(["legend","item","width"],80),Je=g(["legend","item","onclick"],function(){}),ud=g(["axis","x","type"],"indexed"),La=g(["axis","x","categories"],[]),Cd=g(["axis","x","tick","centered"],!1),mb=g(["axis","x","tick","format"],null),vb=g(["axis","x","default"],null),se=g(["axis","x","label"],
null),Md=g(["axis","y","max"],null),Kd=g(["axis","y","min"],null),Od=g(["axis","y","center"],null),te=g(["axis","y","label"],null),cb=g(["axis","y","inner"],!1),hd=g(["axis","y","tick","format"],function(a){return a}),Ma=g(["axis","y","padding"],null),ne=g(["axis","y","ticks"],10),Cb=g(["axis","y2","show"],!1),Ld=g(["axis","y2","max"],null),Jd=g(["axis","y2","min"],null),Nd=g(["axis","y2","center"],null),eb=g(["axis","y2","inner"],!1),pe=g(["axis","y2","tick","format"],function(a){return a}),Na=g(["axis",
"y2","padding"],null),oe=g(["axis","y2","ticks"],10),h=g(["axis","rotated"],!1),id=g(["grid","x","show"],!1),De=g(["grid","x","type"],"tick"),cc=g(["grid","x","lines"],null),jd=g(["grid","y","show"],!1),dc=g(["grid","y","lines"],null),$b=g(["point","show"],!0)?g(["point","r"],2.5):0,ue=g(["point","focus","line","enabled"],!0),ec=g(["point","focus","expand","enabled"],!0),fc=g(["point","focus","expand","r"],ec?4:$b),Va=g(["point","focus","select","r"],8),Be=g(["point","onclick"],function(){}),je=g(["point",
"onselected"],function(){}),ke=g(["point","onunselected"],function(){}),Fd=g(["arc","label","format"],function(a,b){return(100*b).toFixed(1)+"%"}),ve=g(["arc","title"],""),P=g(["regions"],[]),Tc=g(["tooltip","enabled"],!0),Uc=g(["tooltip","contents"],function(a){var b="<table class='-tooltip'><tr><th colspan='2'>"+qc()(a[0].x)+"</th></tr>",c,d,e;for(c=0;c<a.length;c++)if(a[c]&&(a[c].value||0===a[c].value)){d="-";if(a[c].value||0===a[c].value)d=hd((Math.round(100*a[c].value)/100).toFixed(2));e=a[c].name;
b+="<tr class='-tooltip-name-"+a[c].id+"'><td class='name'><span style='background-color:"+N(a[c].id)+"'></span>"+e+"</td><td class='value'>"+d+"</td></tr>"}return b+"</table>"}),xe=g(["tooltip","init","show"],!1),Fa=g(["tooltip","init","x"],0),ld=g(["tooltip","init","position"],{top:"0px",left:"50px"}),bc=wa.replace("#","")+"-clip",Wa="url(#"+bc+")",D="timeseries"===ud,ja="categorized"===ud,Rb=!D&&(qa||ba),hc=null,Xa=!1,gc=!1,oa=Ea?40:0,N=function(a,b){var c=[],d=null!==b?b:"#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf".split(" ");
null),Md=g(["axis","y","max"],null),Kd=g(["axis","y","min"],null),Od=g(["axis","y","center"],null),te=g(["axis","y","label"],null),cb=g(["axis","y","inner"],!1),hd=g(["axis","y","tick","format"],null),Ma=g(["axis","y","padding"],null),ne=g(["axis","y","ticks"],10),Cb=g(["axis","y2","show"],!1),Ld=g(["axis","y2","max"],null),Jd=g(["axis","y2","min"],null),Nd=g(["axis","y2","center"],null),eb=g(["axis","y2","inner"],!1),pe=g(["axis","y2","tick","format"],null),Na=g(["axis","y2","padding"],null),oe=
g(["axis","y2","ticks"],10),h=g(["axis","rotated"],!1),id=g(["grid","x","show"],!1),De=g(["grid","x","type"],"tick"),cc=g(["grid","x","lines"],null),jd=g(["grid","y","show"],!1),dc=g(["grid","y","lines"],null),$b=g(["point","show"],!0)?g(["point","r"],2.5):0,ue=g(["point","focus","line","enabled"],!0),ec=g(["point","focus","expand","enabled"],!0),fc=g(["point","focus","expand","r"],ec?4:$b),Va=g(["point","focus","select","r"],8),Be=g(["point","onclick"],function(){}),je=g(["point","onselected"],function(){}),
ke=g(["point","onunselected"],function(){}),Fd=g(["arc","label","format"],function(a,b){return(100*b).toFixed(1)+"%"}),ve=g(["arc","title"],""),P=g(["regions"],[]),Tc=g(["tooltip","enabled"],!0),Uc=g(["tooltip","contents"],function(a){var b="<table class='-tooltip'><tr><th colspan='2'>"+qc()(a[0].x)+"</th></tr>",c,d,e;for(c=0;c<a.length;c++)if(a[c]&&(a[c].value||0===a[c].value)){d="-";if(a[c].value||0===a[c].value)d=hd((Math.round(100*a[c].value)/100).toFixed(2));e=a[c].name;b+="<tr class='-tooltip-name-"+
a[c].id+"'><td class='name'><span style='background-color:"+N(a[c].id)+"'></span>"+e+"</td><td class='value'>"+d+"</td></tr>"}return b+"</table>"}),xe=g(["tooltip","init","show"],!1),Fa=g(["tooltip","init","x"],0),ld=g(["tooltip","init","position"],{top:"0px",left:"50px"}),bc=wa.replace("#","")+"-clip",Wa="url(#"+bc+")",D="timeseries"===ud,ja="categorized"===ud,Rb=!D&&(qa||ba),hc=null,Xa=!1,gc=!1,oa=Ea?40:0,N=function(a,b){var c=[],d=null!==b?b:"#1f77b4 #ff7f0e #2ca02c #d62728 #9467bd #8c564b #e377c2 #7f7f7f #bcbd22 #17becf".split(" ");
return function(b){if(b in a)return a[b];-1===c.indexOf(b)&&c.push(b);return d[c.indexOf(b)%d.length]}}(Ke,Le),Dd=function(){var a=[[e.time.format("%Y/%-m/%-d"),function(){return!0}],[e.time.format("%-m/%-d"),function(a){return a.getMonth()}],[e.time.format("%-m/%-d"),function(a){return 1!==a.getDate()}],[e.time.format("%-m/%-d"),function(a){return a.getDay()&&1!==a.getDate()}],[e.time.format("%I %p"),function(a){return a.getHours()}],[e.time.format("%I:%M"),function(a){return a.getMinutes()}],[e.time.format(":%S"),
function(a){return a.getSeconds()}],[e.time.format(".%L"),function(a){return a.getMilliseconds()}]];return function(b){for(var c=a.length-1,d=a[c];!d[1](b);)d=a[--c];return d[0](b)}}(),r,Db,s,fb,Ab,va,Ka,Eb,Fb,lb,tc,uc,Nb,Hb,Ib,Jb,Kb,Lb,Mb,m,z,aa,U,ib,jb,J,ya,kb,hb,yd=h?"left":"bottom",zd=h?cb?"top":"bottom":cb?"right":"left",Ad=h?eb?"bottom":"top":eb?"left":"right",Bd=h?"left":"bottom",L={main:function(){return"translate("+C+","+q+")"},context:function(){return"translate("+Ha+","+Ga+")"},legend:function(){return"translate("+
oc+","+nc+")"},y2:function(){return"translate("+(h?0:r)+","+(h?10:0)+")"},x:function(){return"translate(0,"+s+")"},subx:function(){return"translate(0,"+(h?0:fb)+")"},arc:function(){return"translate("+r/2+","+s/2+")"}},sc=40,rc=20;Nb=e.layout.pie().value(function(a){return a.values.reduce(function(a,c){return a+c.value},0)});var Ee=function(){var a=e.svg.line().x(h?function(a){return v(a.id)(a.value)}:za).y(h?za:function(a){return v(a.id)(a.value)});return function(b){var c=Xb(b.values),d;if(Ub(b))return Xc(b)?

Loading…
Cancel
Save