【问题标题】:Labels on an ExtJS4 Time-AxisExtJS4 时间轴上的标签
【发布时间】:2013-03-30 17:41:15
【问题描述】:

我有一个底部时间轴,定义如下:

{
  "title":"Date",
  "description":"",
  "position":"bottom",
  "type":"Time",
  "fields":["date"],
  "dateFormat":"d.m.Y"
}

但所有标签都是“NaN.NaN.0NaN”

当我查看商店时,日期字段是具有正确值的普通 Date 对象。 但是当我查看 Axis 的 drawLabel 函数时,me.labels 没有对象,所以什么都没有被绘制。

【问题讨论】:

    标签: javascript extjs extjs4 date-formatting extjs-chart


    【解决方案1】:

    我有时间轴的渲染器:

    getDateRenderer: function(v) {
        return Ext.util.Format.date(v, 'd.m.Y');
    }
    

    在这里设置它:

    this.chart.axes.items[2].label.renderer = this.getDateRenderer;
    

    【讨论】:

      猜你喜欢
      • 2012-04-24
      • 2021-10-11
      • 2016-02-18
      • 1970-01-01
      • 1970-01-01
      • 2011-01-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多