Profile Picture

How to bind database from SQL server 2008 express to Nevron chart?

Posted By Chia Wan Yi 12 Years Ago

How to bind database from SQL server 2008 express to Nevron chart?

Author
Message
Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

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



Chia Wan Yi
biggrin Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)Forum Newbie (1 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 1, Visits: 1
Say I have a random data feed from SQL, and I want to display the data through the chart. How can I bind the x and y values of the chart to this data feed? The data has to be displayed in real time. I have implemented the chart from this link.

http://support.nevron.com/KB/a175/implement-real-time-chart-in-aspnet-application-using-ajax.aspx

How do i continue from here to insert data from my own database from SQL?



Similar Topics


Reading This Topic