1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    8
    Vote Rating
    0
    Answers
    1
    manikumar is on a distinguished road

      0  

    Default Answered: values not rendered in line chart, if xField is not given in extjs 4.1

    Answered: values not rendered in line chart, if xField is not given in extjs 4.1


    I have problem in line chart in extjs 4.1.0. when upgraded to ext js 4.1.0 from 4.0.2a values not rendered in line chart, if xField is not given but in extjs 4.02a, values are rendered if xField is not given. here is code that is working in extjs 4.0.2a:


    xtype: 'chart',
    height: 120,
    id: 'accounts-per-day-chart',
    insetPadding: 5,
    store: 'CustomersStore',
    flex: 5,
    series: [
    {
    type: 'line',
    highlight: true,
    yField: [
    'Customers'
    ],
    fill: true,

    selectionTolerance: 5
    }
    ],
    axes: [
    {
    type: 'Numeric',
    dashSize: 2,
    fields: [
    'Customers'
    ],
    majorTickSteps: 0,
    position: 'left',
    decimals: 0,
    minimum: 0
    }
    ]
    }


    is xField mandatory in extjs 4.1.0? please suggest solution to render values in line chart with out declaring value for xField

  2. After r&d, came to know that declaring xField is mandatory in extjs 4.1. added xField in line series and it worked for me ..here is the working code.
    NOTE: xField values should be UNIQUE
    xtype: 'chart',
    height: 120,
    id: 'accounts-per-day-chart',
    insetPadding: 5,
    store: 'CustomersStore',
    flex: 5,
    series: [
    {
    type: 'line',
    highlight: true,
    yField: [
    'Customers'
    ],
    xField: [
    'Time'
    ],
    fill: true,
    selectionTolerance: 5
    }
    ],
    axes: [
    {
    type: 'Numeric',
    dashSize: 2,
    fields: [
    'Customers'
    ],
    majorTickSteps: 0,
    position: 'left',
    decimals: 0,
    minimum: 0
    }
    ]
    }

  3. #2
    Sencha User
    Join Date
    Sep 2007
    Posts
    9
    Vote Rating
    0
    ealbers is on a distinguished road

      0  

    Default Xfield in chart required?

    Xfield in chart required?


    I have a large set of data, and it needs to be plotted with the X axis being range 1-8, there is no way to put the X range INTO the data store, that would not make sense, since the fields of the store are being plotted against the 1-8 in X...

    So how do I set xfield to a fixed range say 1-8? I can't make a column in the data called xrange and just fill it with repeating 1,2,3,4,5,6,7,8,1,2,3,4....., the line graph shows werid stuff
    Thanks
    Eric

Thread Participants: 1

Tags for this Thread