Hi Chia,
Generally you need to modify the chart document each time the code enters in AsyncRefresh for the old ASP.NET control, or in the case of the ThinWeb controls you need to execute this code in the OnAutoUpdate callback method. Following is some sceleton code that shows how to achieve auto updatable chart with the ThinWeb chart:
protected void Page_Load(object sender, EventArgs e)
{
if (!NThinChartControl1.Initialized)
{
// do some one time initialization here
// subscribe fo auto update (you'll receive a call back at 1 second)
NThinChartControl1.ServerSettings.EnableAutoUpdate = true;
NThinChartControl1.ServerSettings.AutoUpdateInterval = 1000;
NThinChartControl1.AutoUpdateCallback = new NAutoUpdateCallback();
}
if (!IsPostBack)
{
AutoUpdateIntervalTextBox.Text = NThinChartControl1.ServerSettings.AutoUpdateInterval.ToString();
}
}
[Serializable]
public class NAutoUpdateCallback : INAutoUpdateCallback
{
#region INAutoUpdateCallback Members
void INAutoUpdateCallback.OnAutoUpdate(NAspNetThinWebControl control)
{
NThinChartControl chartControl = (NThinChartControl)control;
// fetch data from SQL and populate the chart
chartControl.UpdateView();
}
void INAutoUpdateCallback.OnAutoUpdateStateChanged(NAspNetThinWebControl control)
{
}
#endregion
}
Hope this helps - let us know if you meet any problems or have any questions.
Best Regards,
Nevron Support Team