1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    2
    Vote Rating
    0
    chartuser is on a distinguished road

      0  

    Default Query on Ext js TimeAxis

    Query on Ext js TimeAxis


    Hi,

    I am using a Ext js 3.4 columnchart and a stacked column chart , in which yAxis is a numeric axis and x axis as TimeAxis.

    The numeric axis always start at zero and units are displayed according to values . However ,my TimeAxis does start on the least month with store has . I could see all the columns/bars. But the problem is since the value ranges from say Dec -1 -YYYY., my first bar always start on zeroth position. Is there a way to shift the bar , to first axis value, instead of zeroth axis value?

    Also , is there a way to display the time axis label , exactly same as value?

    My chart code is as below .

    Code:
    {
    			
    xtype:'stackedcolumnchart',
    height:300,
    store: mychartStore,
     xField:	'timePeriod',
     xAxis: new Ext.chart.TimeAxis({
    	labelRenderer: Ext.util.Format.dateRenderer('m/Y')  				
    }),
    yAxis: new Ext.chart.NumericAxis({
    	stackingEnabled: true,
    	title: 'Dollars',				
    labelRenderer: function(value)
    	{
      	return  Ext.util.Format.number(value, '123,456.78'); 
      }		
     }),	
    series: [{
    	yField:'earning',
    	displayName: 'Earnings',
    	style: { color: "#748746" }
    },{
    yField:'principal',
    displayName: 'Principal',
    style: { color: "#8C3F3A" }
    }],
    
    
    }

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,207
    Vote Rating
    856
    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


    The YUI charts will try to do a lot of magic.. some of which is not exactly what everyone wants. You could check the YUI docs to see how to customize what you want.
    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
    Sencha User
    Join Date
    Nov 2011
    Posts
    2
    Vote Rating
    0
    chartuser is on a distinguished road

      0  

    Default


    Thank you. My collegue helped.
    Instead of setting the xAxis to TimeAxis, donot set any. The chart will render its default. It worked.