c3.js图表​​上的自定义刻度值

时间:2016-05-03 15:21:58

标签: javascript c3.js

我正在尝试使用c3.js创建一个水平条形图,我想将自己的轴名称放在我使用的位置:

tick: {

                        count: 6,
                        format: function () {
                            var label1 = ["[-25 ans]", "[25-29 ans]","[30-34 ans]", "[25-29 ans]","[30-34 ans]","[35-39 ans]"];
                            for (var i in label1){
                                return (label1[i]);
                            }
                        }
                    }

但结果我只得到[-25 ans]所有的滴答声,而在IDE中它表示“for statement not loop”

我做错了吗?我怎么能纠正这个? 感谢

1 个答案:

答案 0 :(得分:2)

您应该使用axis.x.tick.values

WITH ALL_VE_ERRORS AS (    
        SELECT *
        FROM ASN.AN_VALIDATION_ERRORS
        WHERE ...    
    ), FILTER_STATUS AS (    
        SELECT *
        FROM ALL_VE_ERRORS
        WHERE ...    
      )
SELECT UNIT_DISCREPANCY
INTO W_UNIT_DISCREPANCY
FROM FILTER_STATUS 

Example