Measure axis - limit tick values

后端 未结 3 1699
孤街浪徒
孤街浪徒 2021-01-26 02:17

I have chart looking like that:

\"Chart\"

I use measure axis for Y:

y = myChart.addMeasureAxis(         


        
3条回答
  •  借酒劲吻你
    2021-01-26 02:50

    I was also stuck in this issue. Couldn't find how lower the number of 'ticks' on the y-axis. The library doesn't expose any method for that. So, I tinkered with the library to suit my needs. So it's a hack ^_^

    Use the commented version of the library i.e dimple.v1.1.4.js

    Find the line ~338

    if (!this.hidden) {
                    switch (this.chart._axisIndex(this, "y")) {
                    case 0:
                        this._draw = d3.svg.axis()
                            .orient("left")
                            .scale(this._scale)
                            .ticks(5);   <<<<<<<<<------ This wasn't there before
                        break;
                    case 1:
                        this._draw = d3.svg.axis()
                            .orient("right")
                            .scale(this._scale);
                        break;
                    default:
                        break;
                    }
                }
    

    Add the ticks(5) or whatever number you want.

提交回复
热议问题