Results 1 to 6 of 6

Thread: Time based axis not responding to fromDate/toDate

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Touch Premium Member
    Join Date
    Sep 2010
    Location
    Boston, MA
    Posts
    24
    Answers
    1
    Vote Rating
    1
      0  

    Default Time based axis not responding to fromDate/toDate

    Hey all --

    Trying out Touch Charts 2 beta with an ST2 application that I'm building and whenever I try to specify a 'fromDate' and/or 'toDate' in an axis, the values are ignored and I'm left with 1969-January 1970 (which I believe is what happens when you enter a new Date(0)). No matter what I do to update these values, the time type axis is stuck with these two dates.

    Here's a sencha fiddle I put together of the issue (NOTE: make sure to hit "Run" to see result): http://www.senchafiddle.com/#CJB2R

    And another one using Category as an axis-type: http://www.senchafiddle.com/#FciIX

    (Note: In order to make this example work, I had to add touch-charts.js at the beginning of the fiddle - since it doesn't accept 'resources' yet.) My code starts around line 23959, but here's the gist:

    Code:
    Ext.define('app.view.chart.Chart', {
        extend: "Ext.Panel", 
        xtype: 'isochart',
        requires: [Ext.chart.Chart, Ext.chart.axis.Numeric, Ext.chart.axis.Time, Ext.chart.series.Line],
        config: {
            autoDestroy: true,
            id: 'chartview',
            layout: 'vbox',
            defaults: {
                flex:1,
                padding:10
            },
            
            items: [
            {
                xtype:'chart',
                store: myStore,
                style: {
                    background: 'white'
                },
                animate: true,
                height:300,
                
                interactions: [
                    {
                        type: 'iteminfo',
                        listeners: {
                            show: function(interactions, item, panel){
                                var storeItem = item.storeItem;
                                console.log(storeItem.get('lmptotal') + ' ' + storeItem.get('date'));
                            }
                        }
    
    
                    }
                ],
                axes: [{
                    type: 'Numeric',
                    position:'left',
                    fields: ['lmptotal'],
                    title: 'Price',
                    grid: true,
                    minimum: 0,
                    maximum: 40
                },
                /* 
                {
                    type: 'Category',
                    position: 'bottom',
                    fields: ['date'],
                    title: 'Hours'
                }
                */
    
    
                
                {
                    type: 'Time',
                    position:'bottom',
                    fields: 'date',
                    label: {
                        rotate: {
                            degrees: 45
                        }
                    },
                    title: 'Hours',
                    dateFormat: 'M Y',                
                    grid: true,
                    fromDate: '6/27/12',
                    toDate: '6/28/12'
                    }
                ],
    
    
                series: [
                    {
                        type: 'line',
                        highlight: {
                            size:2,
                            radius: 2
                        },
                        smooth: false,
                        axis: ['left','bottom'],
                        xField: 'date',
                        yField: 'lmptotal',
                        Title: 'LMP'
                    }]
                }
            ]}
    });
    Thanks in advance!

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    I see you are setting it to a string, have you tried setting it to a Date object?

    Side note, we will be having a major overhaul in the next month or two for charts.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Touch Premium Member
    Join Date
    Sep 2010
    Location
    Boston, MA
    Posts
    24
    Answers
    1
    Vote Rating
    1
      0  

    Default

    Thanks for the response @msims84.

    I've tried: a.) String (which was the example used in the docs), b.) Date object (new Date('6/27/2012')) and c.) function which returns a date object.

    All three seem to have the same result.

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Sounds like a bug in the current release.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  5. #5
    Touch Premium Member
    Join Date
    Sep 2010
    Location
    Boston, MA
    Posts
    24
    Answers
    1
    Vote Rating
    1
      0  

    Default

    Can I use x-credits to get a patch fix for this? Totally understand it's in Beta...

  6. #6
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    Quote Originally Posted by ncooley527 View Post
    Can I use x-credits to get a patch fix for this? Totally understand it's in Beta...
    Large chucks of the chart package has been rewritten so the override wouldn't work in the release but if you need it right away you can of course open a ticket.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

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
  •