1. #1
    Touch Premium Member
    Join Date
    Sep 2010
    Location
    Boston, MA
    Posts
    24
    Vote Rating
    1
    Answers
    1
    ncooley527 is on a distinguished road

      0  

    Default Unanswered: Time based axis not responding to fromDate/toDate

    Unanswered: 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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,651
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Touch Premium Member
    Join Date
    Sep 2010
    Location
    Boston, MA
    Posts
    24
    Vote Rating
    1
    Answers
    1
    ncooley527 is on a distinguished road

      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 - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,651
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Sounds like a bug in the current release.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Touch Premium Member
    Join Date
    Sep 2010
    Location
    Boston, MA
    Posts
    24
    Vote Rating
    1
    Answers
    1
    ncooley527 is on a distinguished road

      0  

    Default


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

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,651
    Vote Rating
    899
    Answers
    3575
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      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 @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1

Tags for this Thread