【问题标题】:c3js, keep x axis tick values and remove pointsc3js,保留x轴刻度值并删除点
【发布时间】:2014-12-23 02:08:29
【问题描述】:

我有这张图表,它的 x 轴加载了接近一千个时间序列点。

这些点没有吸引力。

我可以隐藏 x 轴,但我希望日期显示在下方,减去刻度点。

有没有办法在离开时间的同时删除刻度点。 (请忽略 x 轴上的数字,我知道它们是错误的)。

我希望这是一个类别折线图并完全避免时间序列。

代码,为简单起见删除了数据 -

var chart = c3.generate({
        padding: {
            right: 30
        },
        data: {
          x: 'x',
          columns: [
                ['x',1324252800,1324339200],
                ['OECD Crude Oil Price',102.91,105.05]         
          ],
          type: 'line',
          onclick: function (d, element) { console.log("onclick", d, element); },
          onmouseover: function (d) { console.log("onmouseover", d); },
          onmouseout: function (d) { console.log("onmouseout", d); },
          order: null
        },
        point: {
            show: false
        },
        axis: {
          x: {

            //show:false, 
            //I don't want this, I want to see the dates

            type: 'timeseries',
            tick: {
                culling: {
                    max: 3 
                },
                multiline: false
            }
          },
          y: {
            tick: {
                format: function (d) { return  "$ " + d ; }
            }
          }
        },  
      });

提前致谢

【问题讨论】:

    标签: javascript c3.js


    【解决方案1】:

    好吧,哇,我真傻。我以前发现过这个问题的解决方案。

    Here is my answer just a fortnight ago.

    面部护理。

    这是图表现在的样子,具有预期的效果 -

    【讨论】:

    • 这里是另一个例子。在 css 中编辑刻度线 -- .tick line{ opacity: 0; }
    猜你喜欢
    • 1970-01-01
    • 2013-12-23
    • 1970-01-01
    • 1970-01-01
    • 2023-02-05
    • 1970-01-01
    • 2017-12-17
    • 2016-07-28
    • 2020-11-22
    相关资源
    最近更新 更多