arachnode.net
arachnode.net

Reputation: 791

Adding y-axis to CrossFilter examples

How to add the Y-Axis labels?

I adapted the code from here: http://square.github.io/crossfilter/ to my own data - how do I show the counts on the left on the y-axis?

Upvotes: 0

Views: 471

Answers (1)

Anko
Anko

Reputation: 6326

The basic idea is this:

// Create y-axis
var yAxis = d3.svg.axis()
    .orient("left")
    .scale(y);

// Add y-axis.
svg.append("svg:g")
    .call(yAxis);

x is your horizontal scale.
svg is your visualisation's root SVG element (as a selection).

You might want to consult the docs or this example from Mike.

Upvotes: 1

Related Questions