Oct 31, 2012, 1:32 PM
[CLOSED] Charts created in code behind
I have a panel defined that will hold a chart that I will create and recreate based on user options in code behind.
<ext:Panel ID="ChartPanel" runat="server" layout="BorderLayout" >
<Items>
</Items>
</ext:Panel>
When creating the chart in the code behind I added it to the panel usingprivate void BuildChart()
{
...
Ext.Net.Chart byMonthChart = new Chart()
{ ... }
ChartPanel.Items.Add(byMonthChart);
}
But when I went to recreate the chart via BuildChart it would not update on the panel. After looking through a couple of threads I changed it to the following. Is this the correct way? I only want one chart showing in the panel? Do I need the clear or clean anything up before trying to add the chart?private void BuildChart()
{
...
Ext.Net.Chart byMonthChart = new Chart()
{ ... }
byMonthChart.AddTo(ChartPanel);
//ChartPanel.Items.Add(byMonthChart);
}
Last edited by Daniil; Oct 31, 2012 at 6:09 PM.
Reason: [CLOSED]