-
24 May 2012 5:36 AM #1
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:
Any tips? Thanks.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' } }] }); }});
-
26 May 2012 3:52 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,118
- Vote Rating
- 453
- Answers
- 3160
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
________________
http://www.JSONPLint.com - Source to lint your JSONP!
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 almost in print!
When posting code, please use BBCode's CODE tags.
-
28 May 2012 1:32 AM #3
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
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote