Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
extjs中时间轴的labelrenderer_Extjs_Charts - Fatal编程技术网

extjs中时间轴的labelrenderer

extjs中时间轴的labelrenderer,extjs,charts,Extjs,Charts,注: 这是一个交叉柱,位于: 因为我在那里没有得到答案,所以我在这里问 任何决定回答此帖子的人都可以先查看论坛,以确定问题是否得到了回答。:) 下面是我的核心代码,可以制作柱状图来显示我网站的访问者和字节,但是我发现我无法处理xAxis的标签 visitAndBytesStore = new Ext.data.JsonStore( { fields : [ {

注: 这是一个交叉柱,位于:

因为我在那里没有得到答案,所以我在这里问

任何决定回答此帖子的人都可以先查看论坛,以确定问题是否得到了回答。:)

下面是我的核心代码,可以制作柱状图来显示我网站的访问者和字节,但是我发现我无法处理xAxis的标签

        visitAndBytesStore = new Ext.data.JsonStore(
        {
            fields :
            [
            {
                name : 'time',
                type : 'string'
//             dateFormat : 'Y-m-d H:i:s'
                    }, 'visits', 'bytes' ]
        });


        var visitAndBytesData =
        [{"time" : "2010-09-17 16:24:06","visits" : "23","bytes" : "4545"},
        {"time" : "2010-09-17 02:23:33","visits" : "3233","bytes" : "3232"},
        {"time" : "2010-09-17 16:23:52","visits" : "456","bytes" : "3242342"},
        {"time" : "2010-09-17 15:23:52","visits" : "6456","bytes" : "2314252"} ];


        visitAndByteChart = new Ext.chart.ColumnChart(
        {
            store : visitAndBytesStore,
            xField : 'time',
            // xAxis : new Ext.chart.TimeAxis(
            // {
            // title : 'time',
            // displayName : 'time',
            // labelRenderer : function(dd)
            // {
            // // return dd.format("m-d")+"\n"+dd.format("H:i");
            // return "";
            // }
            // }),
            yAxis : new Ext.chart.NumericAxis(
            {
                displayName : 'Visits',
                labelRenderer : Ext.util.Format.numberRenderer('0,0')
            }),
            series :
            [
            {
                type : 'column',
                displayName : 'Bytes',
                yField : 'bytes',
                style :
                {
                    color : 0x99BBE8
                }
            },
            {
                type : 'line',
                displayName : 'Visits',
                yField : 'visits',
                style :
                {
                    mode : 'stretch',
                    color : 0x15428B
                }
            } ]
        });

        visitorAndBytesChartPanel = new Ext.Panel(
        {
            iconCls : 'chart',
            title : '&nbsp',
            frame : true,
            renderTo : 'bytes',
            autoWidth : true,
            height : 300,
            layout : 'fit',
            items : visitAndByteChart

        });
如上所示,如果我使用“时间”字段的“字符串”格式,我无法处理图表中时间标签的格式,它们的值太长(2010-09-20 23:00:00太长),因此会自动选择显示它们

结果是:

我想把它们都展示出来

因此,我将“时间”字段设置为“日期”(只需删除上述代码中的注释), 现在图表中的最后一个标签不能完全显示,图表中触发tip事件的“点”也不能完全显示

结果是:

有什么问题吗

extraStyle: {
  padding: 20
}
来自论坛

来自论坛