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 Ext.chart.chart不工作_Extjs_Charts_Sencha Touch 2 - Fatal编程技术网

Extjs Ext.chart.chart不工作

Extjs Ext.chart.chart不工作,extjs,charts,sencha-touch-2,Extjs,Charts,Sencha Touch 2,当我用Ext.chart.CartesianChart替换为Ext.chart.chart它不起作用时,这里是代码 CartesianChart图表 Ext.define("dashboard.view.HrsWorkedChart", { extend: "Ext.chart.CartesianChart", requires: [ "Ext.TitleBar", "Ext.chart.Cart

当我用Ext.chart.CartesianChart替换为Ext.chart.chart它不起作用时,这里是代码

CartesianChart图表

Ext.define("dashboard.view.HrsWorkedChart", {
       extend: "Ext.chart.CartesianChart",
       requires: [
                  "Ext.TitleBar",
                  "Ext.chart.CartesianChart",
                  "Ext.chart.series.Line",
                  "Ext.chart.axis.Numeric",
                  "Ext.chart.axis.Category",
                  "Ext.draw.sprite.Circle"
                  ],
       alias: "widget.hrsworkedchart",
       config: {
       flex: 1,
       xtype: "chart",
       store: "HrsAndValueByYear",
       cls: "chart",
       innerPadding: 20,
       animate: true,
       series: [
                {
                type: "line",
                xField: "year",
                yField: "hrsworked",
                title: "Hours Worked",
                style: {
                stroke: "#003366",
                lineWidth: 3
                },
                marker: {
                type: "circle",
                stroke: "#003366",
                radius: 5,
                lineWidth: 3
                },
                label: {
                field: "hrsworked",
                color: "#000",
                display: "over",
                font:"10px Helvetica"
                }
                },
                {
                type: "line",
                xField: "year",
                yField: "hrsbilled",
                title: "Hours Billed",
                style: {
                stroke: "#6d0060",
                lineWidth: 3
                },
                marker: {
                type: "circle",
                stroke: "#6d0060",
                radius: 5,
                lineWidth: 3
                },
                label: {
                field: "hrsbilled",
                color: "#000",
                display: "over",
                font: "10px Helvetica"
                }
                }
                ],
       axes: [
              {
              type: "numeric",
              position: "left",
              title: {
              fontSize: 15,
              text: "Hrs"
              },
              minimum: 130000,
              maximum: 180000,
              grid: {
              even: {
              fill: "#f9f9f9"
              }
              }
              },
              {
              type: "category",
              position: "bottom"
              }
              ]
       }
       });
Ext.define("dashboard.view.HrsWorkedChart", {
       extend: "Ext.chart.Chart",
       alias : "widget.hrsworkedchart",
       flex: 1,
       shadow: true,
       animate: true,
       store: "HrsAndValueByYear",
       axes: [{
              type: 'Numeric',
              position: 'left',
              fields: ['year'],
              minimum: 0,
              hidden: true
              }, {
              type: 'Category',
              position: 'bottom',
              fields: ['hrsworked'],
              label: {
              renderer: function(v) {
              return Ext.String.ellipsis(v, 15, false);
              },
              font: '9px Arial',
              rotate: {
              degrees: 270
              }
              }
              }],
       series: [{
                type: 'column',
                axis: 'left',
                highlight: true,
                style: {
                fill: '#456d9f'
                },
                highlightCfg: {
                fill: '#a2b5ca'
                },
                label: {
                contrast: true,
                display: 'insideEnd',
                field: 'year',
                color: '#000',
                orientation: 'vertical',
                'text-anchor': 'middle'
                },
                xField: 'name',
                yField: ['price']
                }]        
       });
Ext.Chart.Chart

Ext.define("dashboard.view.HrsWorkedChart", {
       extend: "Ext.chart.CartesianChart",
       requires: [
                  "Ext.TitleBar",
                  "Ext.chart.CartesianChart",
                  "Ext.chart.series.Line",
                  "Ext.chart.axis.Numeric",
                  "Ext.chart.axis.Category",
                  "Ext.draw.sprite.Circle"
                  ],
       alias: "widget.hrsworkedchart",
       config: {
       flex: 1,
       xtype: "chart",
       store: "HrsAndValueByYear",
       cls: "chart",
       innerPadding: 20,
       animate: true,
       series: [
                {
                type: "line",
                xField: "year",
                yField: "hrsworked",
                title: "Hours Worked",
                style: {
                stroke: "#003366",
                lineWidth: 3
                },
                marker: {
                type: "circle",
                stroke: "#003366",
                radius: 5,
                lineWidth: 3
                },
                label: {
                field: "hrsworked",
                color: "#000",
                display: "over",
                font:"10px Helvetica"
                }
                },
                {
                type: "line",
                xField: "year",
                yField: "hrsbilled",
                title: "Hours Billed",
                style: {
                stroke: "#6d0060",
                lineWidth: 3
                },
                marker: {
                type: "circle",
                stroke: "#6d0060",
                radius: 5,
                lineWidth: 3
                },
                label: {
                field: "hrsbilled",
                color: "#000",
                display: "over",
                font: "10px Helvetica"
                }
                }
                ],
       axes: [
              {
              type: "numeric",
              position: "left",
              title: {
              fontSize: 15,
              text: "Hrs"
              },
              minimum: 130000,
              maximum: 180000,
              grid: {
              even: {
              fill: "#f9f9f9"
              }
              }
              },
              {
              type: "category",
              position: "bottom"
              }
              ]
       }
       });
Ext.define("dashboard.view.HrsWorkedChart", {
       extend: "Ext.chart.Chart",
       alias : "widget.hrsworkedchart",
       flex: 1,
       shadow: true,
       animate: true,
       store: "HrsAndValueByYear",
       axes: [{
              type: 'Numeric',
              position: 'left',
              fields: ['year'],
              minimum: 0,
              hidden: true
              }, {
              type: 'Category',
              position: 'bottom',
              fields: ['hrsworked'],
              label: {
              renderer: function(v) {
              return Ext.String.ellipsis(v, 15, false);
              },
              font: '9px Arial',
              rotate: {
              degrees: 270
              }
              }
              }],
       series: [{
                type: 'column',
                axis: 'left',
                highlight: true,
                style: {
                fill: '#456d9f'
                },
                highlightCfg: {
                fill: '#a2b5ca'
                },
                label: {
                contrast: true,
                display: 'insideEnd',
                field: 'year',
                color: '#000',
                orientation: 'vertical',
                'text-anchor': 'middle'
                },
                xField: 'name',
                yField: ['price']
                }]        
       });
我的代码有什么问题。请帮我解决几个指针

  • 在axis配置中,有效类型为“数字”、“类别”。它是大写的N和C
  • 类别轴应为年,数字轴应为hrsworked
  • 我不确定是否有“专栏”系列。用“酒吧”代替
  • 您可以在这里看到示例和下面的代码片段

    var store1 = Ext.create('Ext.data.Store', {
        fields: ['year', 'hrsworked'],
        data: [{
           year: 2010,
           hrsworked: 130000
        }, {
           year: 2011,
           hrsworked: 140000
        }, {
           year: 2012,
           hrsworked: 150000
        }]
    });
    
    Ext.define("dashboard.view.HrsWorkedChart", {
              extend: "Ext.chart.Chart",
              requires: ["Ext.TitleBar", "Ext.chart.CartesianChart", "Ext.chart.series.Bar", "Ext.chart.series.Line", "Ext.chart.axis.Numeric", "Ext.chart.axis.Category", "Ext.draw.sprite.Circle"],
              alias: "widget.hrsworkedchart",
              config: {
                 flex: 1,
                 shadow: true,
                 animate: true,
                 store: store1,
                 cls: "chart",
                 innerPadding: 20,
                 animate: true,
                 series: [{
                    type: 'bar',
                    xField: 'year',
                    yField: ['hrsworked'],
                    style: {
                      fill: 'blue'
                    }
                 }],
                axes: [{
                    type: "numeric",
                    position: "left",
                    minimum:0,
                    title: {
                      fontSize: 15,
                      text: "Hrs"
                    },
                    grid: {
                      even: {
                        fill: "#f9f9f9"
                      }
                   },
                   field: ['hrsworked']
                }, {
                   type: "category",
                   position: "bottom",
                   label: {
            font: '9px Arial',
                        rotate: {
                          degrees: 270
                         }
               },
                   field: 'year'
               }]
            }
     });
    

    为什么sencha Fiddle要求使用新链接更新密码。看来有人劫持了我的小提琴。谢谢你指出这一点。