Feb 04, 2013, 11:52 PM
[CLOSED] Use Chart ,push data in code behide,it will be hangs up..?
I want to push data,in Page_Load
It will be hangs up....?
this is my code
Is this the same problem?
It will be hangs up....?
this is my code
<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Register assembly="Ext.Net" namespace="Ext.Net" tagprefix="ext" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Store Store1 = this.Chart1.GetStore();
Store1.DataSource = Ext.Net.Examples.ChartData.GenerateData(8);
Store1.DataBind();
}
}
protected void ReloadData(object sender, DirectEventArgs e)
{
}
</script>
<!DOCTYPE html>
<html>
<head id="Head1" runat="server">
<title>Grouped Bar Chart - Ext.NET Examples</title>
<link href="/resources/css/examples.css" rel="stylesheet" />
<script>
function saveChart(btn) {
Ext.MessageBox.confirm('Confirm Download', 'Would you like to download the chart as an image?', function (choice) {
if (choice == 'yes') {
btn.up('panel').down('chart').save({
type: 'image/png'
});
}
});
}
</script>
</head>
<body>
<form id="Form1" runat="server">
<ext:ResourceManager ID="ResourceManager1" runat="server" />
<h1>Grouped Bar Sample</h1>
<p>Display 3 sets of random data in a grouped bar series.</p>
<p>Reload data will randomly generate a new set of data in the store. Click or hover on the legend items to highlight and remove them from the chart.</p>
<ext:Panel ID="Panel1"
runat="server"
Title="Grouped Bar Chart"
Width="800"
Height="600"
Layout="FitLayout">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server">
<Items>
<ext:Button ID="Button1"
runat="server"
Text="Reload Data"
Icon="ArrowRefresh"
OnDirectClick="ReloadData"
/>
<ext:Button ID="Button2"
runat="server"
Text="Animate"
Icon="ShapesManySelect"
EnableToggle="true"
Pressed="true">
<Listeners>
<Toggle Handler="#{Chart1}.animate = pressed ? {easing: 'ease', duration: 500} : false;" />
</Listeners>
</ext:Button>
<ext:Button ID="Button3"
runat="server"
Text="Save Chart"
Icon="Disk"
Handler="saveChart"
/>
</Items>
</ext:Toolbar>
</TopBar>
<Items>
<ext:Chart
ID="Chart1"
runat="server"
StyleSpec="background:#fff;"
StandardTheme="Category1"
Shadow="true"
Animate="true">
<LegendConfig Position="Right" />
<Store>
<ext:Store ID="Store1"
runat="server"
AutoDataBind="true">
<Model>
<ext:Model ID="Model1" runat="server">
<Fields>
<ext:ModelField Name="Name" />
<ext:ModelField Name="Data1" />
<ext:ModelField Name="Data2" />
<ext:ModelField Name="Data3" />
<ext:ModelField Name="Data4" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<Axes>
<ext:NumericAxis
Position="Left"
Fields="Data1,Data2,Data3,Data4"
Title="Number of Hits"
Grid="true"
Minimum="0">
<Label>
<Renderer Fn="Ext.util.Format.numberRenderer('0,0')" />
</Label>
</ext:NumericAxis>
<ext:CategoryAxis
Fields="Name"
Position="Bottom"
Title="Month of the Year"
/>
</Axes>
<Series>
<ext:ColumnSeries
Axis="Bottom"
XField="Name"
YField="Data1,Data2,Data3"
Stacked="true"
/>
<ext:LineSeries Axis="Bottom" Smooth="3" Fill="true" XField="Name" YField="Data4" />
</Series>
</ext:Chart>
</Items>
</ext:Panel>
</form>
</body>
</html>
Is this the same problem?
Last edited by Daniil; Feb 05, 2013 at 9:42 AM.
Reason: [CLOSED]