Advanced Axis Configuration

The style and configuration of each axis created by d3plus-plot can be overridden using the .xConfig( ) and .yConfig( ) methods, which act as a pass-through to each axis’ .config( ) method. Using the same data as in the getting started example:

var data = [
  {id: "alpha", x: 4, y:  7},
  {id: "beta",  x: 5, y:  2},
  {id: "gamma", x: 6, y: 13}
];

We can completely remove the y-axis and modify the x-axis like so:

new d3plus.Plot()
  .data(data)
  .groupBy("id")
  .yConfig({
    barConfig: {"stroke-width": 0},
    title: false,
    ticks: []
  })
  .xConfig({
    labels: [4, 5, 6],
    ticks: [4, 4.5, 5, 5.5, 6],
    title: "Interval"
  })
  .render();