1

是否可以在 d3 堆积面积图中传递 x 轴的字符串值。我尝试了两种方法来为 xAxis 传递字符串值,

1) chart.xAxis.tickFormat(function(d) {

            var dx = data[0].values[d] && data[0].values[d].x || 0;
  if (dx)
                return dx;    
            else 
                return '';

        });    


2) and also changed the .x(function(d){
return d[0];
})

第二条语句返回字符串值,但在绘制 xAxis 刻度时不可见并引发错误

在stackedAreaChart.js

selection.each(函数(数据){

4

0 回答 0