Sunday 15 June 2014

d3.js - nvd3: remove y-axis tick labels from discrete bar chart -


I am trying to delete y-axis tick labels from discrete bar chart in nvd3.

I have already been seen in the nvd3 source, but can not find a clear function that I can change, can anyone tell me in the solution?

Update: Code

  function conversion (value1, value2, chart_name, value3) {value3 = typeof value3! == 'undefined'? Value 3: 'no_header'; Var chart = nv.models.discreteBarChart () .x (function (d) {return d.label;}) .y (function (d) {return d.value;}) .staggerLabels (true) .tooltips (false) .showValues ​​(true); Var a = []; Var f = [{value: []}]; Get D3.csv ("../../ csv / master.csv") (function (error, rows) {if (error) {console.log (error); loadError ("Oh, oh, this data set Is missing ... go to (var i = 0; i & lt; rows.length; i ++) & lt; a href = '/' & gt; to start back & lt; / a & Gt; (Var [i]);} console.log (a [0]. Archive); (key of key = 0; key & lt; a.length; key ++) {var b = a [key] ; For (var c b) {if (c! = "Agency" & amp; c; = "division" & amp; c; c; = "pod") {var d = b [c]; [Key] [c] = + D;}} console.log (a [0] .changes);} {var e = $ .grep (a, function (v) {return v.division == {{division | Safe}};}); var k = $ .grep (e, function (v) {return v .agency == {{Agency | Secure}};}) [0]; console.log (k.division);} hold (typewriter) {loadError ("Oh Oh, we could not find this combination agency and division I & lt; a href = '/ pitchview' & gt; Go back to the selection menu & lt; / a & gt; "); return;} if (k. agency ()) (if ( G == value1 || G == value2 || G == value 3) {var h = {"label": g, "value": of [g]}; F [0] .values.push (h); }} D3.select ('#' + Chart_Name + 'SVG') .Det (F). Transcision () Duration (500). Call (chart) nv.utils.windowResize (chart.update); Return chart; } And {loadError ("Oh Oh, we could not find this combination of agency & amp; division. & Lt; a href = '/ pitchview' & gt; select menu & lt; / a & gt;");} } Try going back; } 

There is a variable in the nvd3 discrete barfunction which removes the y axis To delete it (including the label), use it in your code:

  .showAxis (false)   

Similar variables for the X-axis is present.

No comments:

Post a Comment