d3 / d3-scale

Encodings that map abstract data to visual representation.
https://d3js.org/d3-scale
ISC License
1.59k stars 286 forks source link

TypeError: scale.domain is not a function #251

Closed ponytony closed 3 years ago

ponytony commented 3 years ago

my code:

       const y = d3.scaleLinear()
                .domain([0, 600])
                .range([this.height - this.margin.top, this.margin.top])
                .ticks(1)
        g.attr('transform', `translate(${this.margin.left}, 0)`)
                .call(d3.axisLeft(y))

if i add 'ticks(1)', console would report the error version of d3 is 7.0.0,

ponytony commented 3 years ago

image