Forum Replies Created by cyoung

Viewing 2 posts - 1 through 2 (of 2 total)
  • in reply to: issue with AJAX all with DateTime type return #4663

    Thanks Sunil,
    With a little server side code, I was able to do what I want with xValueType.

    Thanks for providing this wonderful plot package. Saves me a LOT of work!!

    Charles

    in reply to: issue with AJAX all with DateTime type return #4648

    Well, according to jsonlint.com

    [{“x”:”\/Date(1370439429173)\/”,”y”:10},{“x”:”\/Date(1370070000000)\/”,”y”:30}]
    is valid

    [{“x”: new Date(1370439429173),”y”:10},{“x”:new Date(1370070000000),”y”:30}]
    is NOT valid
    Parse error on line 3:
    … { “x”: newDate(137043942917
    ———————^
    Expecting ‘STRING’, ‘NUMBER’, ‘NULL’, ‘TRUE’, ‘FALSE’, ‘{‘, ‘[‘

    If I use that string above, AJAX throws a parsererror.

    I can put quotes around “new Date” to avoid the parser error. But then nothing is plotted.

    Both json strings below give a blank chart.
    [{“x”:”Date(1370470421781)”,”y”:10},{“x”:”Date(1370070000000)”,”y”:30}]
    [{“x”:”new Date(1370470355535)”,”y”:10},{“x”:”new Date(1370070000000)”,”y”:30}]

    Would you please look into this further and make sure that CanvasJS is handling the json object from AJAX properly.

    Thanks!

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