Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    May 2012
    Posts
    3
    Vote Rating
    0
    flagg19 is on a distinguished road

      0  

    Default Unanswered: How can i show a chart bigger than device screen on iphone?

    Unanswered: How can i show a chart bigger than device screen on iphone?


    Hi, I'm trying to show a line chart with a hight number of points (>30) in a UIWebView, but letting sencha handle the chart dimension with "fullscreen: true" the points are too close. What i would like to do is setting the chart width to something bigger (let's say 1000px) and then scroll using the webview built in scroll.

    The chart is shown bigger as it should (i can see a part of it) but (I don't know why) the webview scroll is disabled as soon as the chart appear, i mean, objective-c side it's still active, but the view simply does not respond to gesture any more, i think it could be something in the sencha js code that prevent default gesture to work.

    Here is my code:

    Code:
    Ext.setup({onReady:function(){
    
    
    	var store=new Ext.data.JsonStore({
    	fields:["key","value"],
    	data:[
    		{"key":"slice_0","value":0},
    		{"key":"slice_1","value":1},
    		{"key":"slice_2","value":2}
    	]});
    
    
    	new Ext.chart.Chart({
    		renderTo: Ext.getBody(),
    		width: 800,
    		height: 460,
    		store: store,
    		series: [{
    		type:'pie',
    		angleField:'value',
    		label:{
    			field:'key',
    			display:'rotate',
    			contrast:true,
    			font:'18px Arial'
    			}
    		}]
    	});
    }});
    Any tips? Thanks.

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

      1  

    Default


    You should wrap the chart in a container. The container should have the size and the chart should not, container should use fit layout and scroll : 'both'
    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
    May 2012
    Posts
    3
    Vote Rating
    0
    flagg19 is on a distinguished road

      0  

    Default Solved

    Solved


    EDIT: (ignore the "solved" title, i've edited the post but can't change the title)

    Thanks for replying, I've tried your suggestion of using a container but i've set things up this way:

    -- Container --
    - fulscreen rendered to body
    - layout auto (why use 'fit'? having the chart resizing to the layout is what i'm tring to avoid)
    - scroll: both
    - style: 'overflow: hidden;'

    -- Chart --
    - size: whatever i want (bigger than screen size)

    This setup almost works as i want, except that a chart in a container with an "auto" layout doesn't get rendered. I've erroneously make the chart render on the body too and it worked in certain cases, but it's... well, just not the right thing to do, right?

    Is there a way to render a chart into a container with "auto" layout?
    Thanks again for your help and sorry for my bad english.
    Last edited by flagg19; 28 May 2012 at 7:16 AM. Reason: the previous version was incomplete and just wrong

Thread Participants: 1

Tags for this Thread