Home forums Using CanvasJS Auto refresh Graph with some particular time duration

This topic contains 10 replies, has 2 voices, and was last updated by  maheshbapathi 2 weeks, 3 days ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #21233

    hi sir,
    i am fetching records from database(SQL) & want to refresh page after some particular duration could please anybody help me?
    hope you will help me
    Thanks & regards
    Mahesh.

    #21234

    Priyanka M S
    Member

    @maheshbapathi,

    You can simply render chart inside setInterval or setTimeout function, which renders the chart for every set duration. Please check this thread for more information.

    __
    Priyanka M S
    TeamCanvasJS

    #21237

    Hi Madam,
    Thanks for Your Replay..
    I tried one code but it’s draw same chart over by over
    please provide me a sample code which could be working properly
    i am using ASP.MVC and SQL

    This is my code:

    var x = i;
    var updateInterval = 1000;
    var updateChart = function () {
    for(var y=0; y < result.length; y++){
    dataPoints.push({label:result[y].Head, y:result[y].ForgingStock});
    }
    x=y;
    chart.render();
    };
    setInterval(function () { updateChart() }, updateInterval);

    Thanks & regards
    Mahesh.

    #21255

    Priyanka M S
    Member

    @maheshbapathi,

    Please take a look at this sample project, which updates the chart when dataPoints are added to the database. Also please refer the ReadMe.txt file present in the sample project for setup related information.

    __
    Priyanka M S
    Team CanvasJS

    #21260

    Thanks for sending sample code
    right now my problem has been resloved .
    i have one more doubt how to remove water marks(trail vesion,canvas.com) from chart could you please help me?
    Thanks & regards
    Mahesh

    #21263

    Priyanka M S
    Member

    @maheshbapathi,

    Trial Version is for evaluation purposes for up to 30 days. To use charts without ‘Trial Version’ and ‘CanvasJS’ Credit Link you will need to have a Commercial Version of CanvasJS. Please contact sales@canvasjs.com for sales related queries.

    __
    Priyanka M S
    Team CanvasJS

    #21266

    Thanks’s for your replay.
    I have 1 view and want to give time intervel from database(Sql) dynamically not static
    I have gave some particular time duration(5000) in database based upon that it should be updating the graph
    Could you please help me?
    I am using SQL and Asp.Net MVC
    Thanks & regards
    Mahesh

    #21324

    Priyanka M S
    Member

    @maheshbapathi,

    As of now, in the given sample project, chart gets updated whenever a new dataPoint is added to the database. If you are updating the database at a certain interval, the chart gets updated accordingly.

    If this doesn’t solve your requirement, please brief us further so that we can understand it better and help you out.

    __
    Priyanka M S
    Team CanvasJS

    #21328

    i need dynamic time refresh for example in database(sql) i have assign time interval (5000). Instead of giving time interval in html better to fetching from database

    var update Interval =5000;(html)(static)
    here i put 5000 as time interval i want time interval from database
    i want to fetch time duration in SQL database
    Tell me any idea for dynamic refresh time instead of static
    Thanks & regards
    mahesh

    #21341

    Priyanka M S
    Member

    @maheshbapathi,

    You can get the interval data from the database and assign it to a variable in the back-end(C#), then you can use the same variable in the front-end(HTML) with the help of inline expressions.
    ex: var updateInterval = <%= variable_name %>;
    Assigning this inline expression to updateInterval should work fine in your case.

    __
    Priyanka M S
    Team CanvasJS

    #21342

    Thanks for your replay.
    If you don’t mind could you please share me sample code in MVC
    Thanking you
    Thanks & regards
    Mahesh

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.