Extjs图表问题

时间:2013-06-11 12:12:11

标签: extjs charts extjs4 extjs-chart

我的数据:

data: [
        [1990,"USA",66,"Canada",53],
        [1992,"USA",66,"Canada",53],
        [1994,"USA",66,"Canada",53],
        [1996,"USA",66,"Canada",53],
        [1998,"USA",66,"Canada",53],
        [2000,"USA",66,"Canada",53],
        [2002,"USA",66,"Canada",53],
        [2004,"USA",66,"Canada",53],
        [2006,"USA",81,"Canada",67],
        [2008,"USA",83,"Canada",46],
        [2010,"USA",61,"Canada",45],
        [2012,"USA",67,"Canada",53],
        [2014,"USA",68,"Canada",43],
        [2016,"USA",68,"Canada",43],
        [2018,"USA",68,"Canada",43],
        [2020,"USA",68,"Canada",43],
        [2022,"USA",67,"Canada",53],
        [2024,"USA",68,"Canada",43],
        [2026,"USA",68,"Canada",43],
        [2028,"USA",68,"Canada",43],
        [2030,"USA",68,"Canada",43],
        [2032,"USA",67,"Canada",53],
        [2034,"USA",68,"Canada",43],
        [2036,"USA",68,"Canada",43],
        [2038,"USA",68,"Canada",43],
        [2040,"USA",68,"Canada",43],
        [2042,"USA",67,"Canada",53],
        [2044,"USA",68,"Canada",43],
        [2046,"USA",68,"Canada",43],
        [2048,"USA",68,"Canada",43],
        [2050,"USA",68,"Canada",43]
    ]

在X轴上我显示年份。这是小提琴:fiddle
Myproblem:

  无论如何,他们可以显示[1990'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''谢谢。谢谢。

1 个答案:

答案 0 :(得分:0)

您可以配置斧头labelrenderer,以便为您不想显示的年份值返回空值:

{
    type: "Category",
    position: "bottom",
    minorTickSteps: 4,
    majorTickSteps: 5,
    maximum:50,
    minimum:0,
    fields: ["year"],
    title: "Year",

    label: {
        renderer: function(v) {
            return v % 10 === 0 ? v : '';
        }
    }
}