Mixing out an existing feature

When creating charts in d4 you have two paths you can take. You can either write your chart from scratch where you choose all the features you will need, or use a preexisting chart and mix-in features you want.

In this example we want a column chart without the yAxis, and so we'll just mix it out. d4 expects you to reference a chart's feature by its accessor name, which is defined in the chart's class. d4, also exposes the accessors of a chart using features function. Knowing this we can find our xAxis accessor name like so:


    d4.charts.column().features();
    => ["bars", "barLabels", "xAxis", "yAxis"]
  
Not surprisingly the accessor we are looking for is named yAxis. Now that we know the name we can remove it from our column chart this way:


JavaScript Code