Hi i have one Pie chart and i want to show it in one Panel.
I am not able to render it pls help
Hi i have one Pie chart and i want to show it in one Panel.
I am not able to render it pls help
As in every example and in the docs:
Code:layout: 'fit', items: myChart
i am seeing examples of charts.
every where they are using renderTo:'container'
can you pls tell me where this container is defined.
Do not use renderTo inside an Ext container (like Panel). Use the method Animal described.
You should only use renderTo if you want to render a component in existing HTML (not generated by Ext). In the example you mentioned "container" is the id of a <div>.
i am opening js files using openTab function. i dont have any html tags defined in js file. i only have panels. which are beign opened in tabs.
Thanks
Amit
@Condor
I have tried what Animal have suggested. but the chart is not visible in panel, i am using JsonStore for data.
Here is my code
var store1 = new Ext.data.JsonStore({
fields:['month','sales'],
data:[
{month:'Jan',sales:'10000'},
{month:'Feb',sales:'12000'},
{month:'March',sales:'13000'}
]
});
var chart = new Ext.chart.LineChart({
store : store1,
xField:'month',
yField:'sales'
});
var panel = new Ext.Panel({
title:'Chart',
autoScroll:true,
closable:true,
collapsible:true,
layout:'fit',
flex:1,
items:[chart]
});
@Condor
I have tried what Animal have suggested but chart is not visible, I am using JsonStore for data
var store1 = new Ext.JsonStore({
fields:['month','sales'],
data : [
{month:'jan',sales:'10000'},
{month:'feb',sales:'15000'},
{month:'march',sales:'20000'}
]
});
var chart = new Ext.chart.LineChart({
store : store1,
xField : 'month',
yField : 'sales'
});
var panel = new Ext.Panel({
title: 'Chart',
closable : true,
collapsible : true,
autoScroll : true,
flex : 1,
layout : 'fit',
items : chart
});
What Container houses "panel"?
And this panel is supposed to be a tab in the tabpanel? Then SPECIFY it as one of the items of the tabpanel.
@Animal and @Condor
this is standalone js file. i am returning this panel at the end of file. (return panel).
am i supposed to put this panel in another panel and return that??
in general i am having one large panel that can contain other panels, formpanels, grids, tab panel etc and returning the panel.
i am having one index.jsp having intial page linked to it. this page opens when user loads the url. and all the pages are connected to this first page using ipenTab which opens new js file in new tab. in my js files i dont have any html tags just one large panel having other items in it.