Forum Replies Created by jhair01

Viewing 3 posts - 1 through 3 (of 3 total)
  • in reply to: Cannot pass dataPoints.push() from string #15351

    Namaste Bivek,

    My solution was to Serialize the Data from a List and then pass it in the ViewBag to the View of the MVC. It works. Thank you for your time and your consideration.

    Jon

    in reply to: Cannot pass dataPoints.push() from string #15341

    Hi Bivek,

    I have an update. I am passing the string and then pushing it into a value array in JS. Here is the value of the array in JS:

    ["{ x: new Date(2017,06,13), y: 490 }" , "{ x: new Date(2017,06,14), y: 403 }"]

    This still throws an exception, “Unable to get property ‘getTime’ of undefined or null reference”. The format looks correct to me. The only thing I notice is that when I look in the debugger, array is surrounded by double quotes. Can you please help me again??

    • This reply was modified 6 years, 10 months ago by jhair01. Reason: more info
    • This reply was modified 6 years, 10 months ago by jhair01. Reason: updated code
    in reply to: Cannot pass dataPoints.push() from string #15337

    Hi Bivek,

    Thank you. To give you a better idea of what is happening, the chart is rendered in the V part of an ASP.NET MVC. I am looking at the Object returned from the controller which is a C# string containing all the data. So my code looks like this:

    var dataString = "@Model";

    The problem is that the variable is a string so when the value is passed it has the quotes around it. Please look at this fiddle for me?? Thank you very much!

    https://jsfiddle.net/gq7ucw53/3/

    • This reply was modified 6 years, 10 months ago by jhair01. Reason: more info to help mod determine
    • This reply was modified 6 years, 10 months ago by jhair01. Reason: typo
Viewing 3 posts - 1 through 3 (of 3 total)