Results 1 to 2 of 2

Thread: Wrong data being displayed on line chart for time series

  1. #1

    Default Wrong data being displayed on line chart for time series

    Dear all,

    I am trying to add charts to an application, but I got stucked in this. I have
    followed the steps in the API, and my code is like this right now:

    var chart;
    Ext.onReady(function () {
            //Define a model
            Ext.define('cts', {
                extend: '',
                fields: [ {name: 'date'}, {name: 'counts', type: 'integer'}]
            //Define an store
            var store=Ext.create('', {
                model: 'cts',
                data: [ {date: new Date(2011, 1, 1, 8), counts: 0},
                        {date: new Date(2011, 1, 2, 8), counts: 23},
                        {date: new Date(2011, 1, 3, 8), counts: 40},
                        {date: new Date(2011, 1, 4, 8), counts: 50}]
        //Define the chart itself
        chart = new Ext.chart.Chart({
            width: 400,
            height: 400,
            store: store,
            renderTo: Ext.getBody(),
            axes: [{
                type: 'Numeric',
                minimum: 0,
                maximum: 200,
                position: 'left',
                fields: ['counts'],
                title: 'Counts per channel per minute',
                grid: {
                    odd: {
                        fill: '#dedede',
                        stroke: '#ddd',
                        'stroke-width': 0.5
            }, {
                type: 'Time',
                fields: ['date'],
                position: 'bottom',
                title: 'time stamp',
                dateFormat: 'Y-m-d',
                groupBy: 'year,month,day,hour,minute,second'
            series: [{
                type: 'line',
                xField: 'date',
                yField: 'counts'
    But instead of a nice chart I am getting this instead:


    I have tried to define the store of many ways, but I always reach the same result. Curiously the result in safari is similar, but the horizontal lines do not appear. Any clue about what am I doing wrong?



  2. #2


    Hello scar,

    I also stumbled upon this. I found out the code for Live Updated Chart uses Time Axis and wondered how this works:
    It uses both axes in axis-attribute of the series. So please try this, it worked for me:

    series: [{
      type: 'line',
      axis: ['left', 'bottom'],
      xField: 'date',
      yField: 'counts'

Tags for this Thread

Posting Permissions

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