Results 1 to 2 of 2

Thread: Charts: setSeries and setAxes not working

    Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Jul 2011
    Location
    Holland
    Posts
    98

    Default Charts: setSeries and setAxes not working

    REQUIRED INFORMATIONExt version tested:
    • Sencha Touch 2.2.1
    Browser versions tested against:
    • Safari 6.0.5
    • Chrome 29.0.1547.65
    DOCTYPE tested against:


    • <!DOCTYPE HTML>
    Description:
    • When using the functions setSeries and/or set Axes on a Chart, the chart stays empty.
    Steps to reproduce the problem:
    • Create a new chart without series, add the series by using setSeries and renderer the chart.
    The result that was expected:
    • A working chart with the specified series and/or axes configuration.
    The result that occurs instead:
    • The chart does render, but without any data.
    Test Case:
    Code:
     
            store = Ext.create("Ext.data.Store", {
                storeId: "store",
                fields: [
                    {name: "id", type: "int"},
                    {name: "name",  type: "string"},
                    {name: "field1",  type: "int"},
                    {name: "field2",  type: "int"}
                ],
                data : [
                    {id: 1, name: 'record1', field1: 10, field2: 5},
                    {id: 2, name: 'record2',field1: 13, field2: 3},
                    {id: 3, name: 'record3', field1: 3, field2: 6},
                ]
            });
            
            
            panel = Ext.create('Ext.chart.CartesianChart', {
            store: 'store',
            colors: [
                '#115fa6',
                '#94ae0a',
                '#a61120',
                '#ff8809',
            ],        
             axes: [{
                type: 'category',
                fields: ['name']
            },{
                type: 'numeric',
                position: 'left',
                itemId: 'axe',
                fields: ['field1', 'field2'],
                title: {
                    text: 'Score',
                    fontSize: 15
                },
                grid: true
            }],    
            legend: {
                xtype: 'legend',
                position: 'bottom'
            }                   
            });
    
    
    
    
            var seriesArray = new Array();
            seriesArray.push(
                new Ext.chart.series.Bar({
                    type: 'bar',
                    yField: ['field1', 'field2'],
                    xField: 'name',
                    stacked: false
                })
            ); 
            panel.setSeries(seriesArray);        
    
    
            Ext.Viewport.add(panel);
    Full source:
    http://virtual-life.net/meuk/app_dynamic.js

    Online demos:
    http://virtual-life.net/meuk/myApp_static (static series, it's working as expected)
    http://virtual-life.net/meuk/myApp_dynamic (like this example, not working)

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    4,108

    Default

    Add a fill color to your chart series.
    Code:
    style: {
        fill: 'blue'
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •