MSChart and JavaScript

Discussion in 'Javascript' started by NvrBst, Jan 4, 2008.

  1. NvrBst

    NvrBst Guest

    I can't seem to set the "MSChart1.ChartData = myArr;" value using
    JavaScript. It says "Bad Argument".

    I've tried setting myArr two ways. 1. var myArr = [1,2,3,4,5]; and 2.
    var x = [1,2,3,4,5]; var myArr = [x];. Both produce the same error.


    I can set the chart by doing "MSChart1.Row = row;" "MSChart1.Column =
    col;" "MSChart1.Data = 3;". However, I have about a 200 points and
    doing it this way takes the Chart about 20 seconds (it draws to the
    chart after each point is set). I suspect the "MSChart1.ChartData =
    myArr;" would be faster in this respect.

    Another possbile solution, anyone know how to tell MSChart1 to not
    draw while I set all the points (Then I can just do an
    "MSChart1.Refresh();" when I'm done setting points.

    Thanks

    NB
    NvrBst, Jan 4, 2008
    #1
    1. Advertising

  2. NvrBst

    NvrBst Guest

    On Jan 4, 12:26 pm, NvrBst <> wrote:
    > I can't seem to set the "MSChart1.ChartData = myArr;" value using
    > JavaScript.  It says "Bad Argument".
    >
    > I've tried setting myArr two ways.  1. var myArr = [1,2,3,4,5]; and 2.
    > var x = [1,2,3,4,5]; var myArr = [x];.  Both produce the same error.
    >
    > I can set the chart by doing "MSChart1.Row = row;" "MSChart1.Column =
    > col;" "MSChart1.Data = 3;".  However, I have about a 200 points and
    > doing it this way takes the Chart about 20 seconds (it draws to the
    > chart after each point is set).  I suspect the "MSChart1.ChartData =
    > myArr;" would be faster in this respect.
    >
    > Another possbile solution, anyone know how to tell MSChart1 to not
    > draw while I set all the points (Then I can just do an
    > "MSChart1.Refresh();" when I'm done setting points.
    >
    > Thanks
    >
    > NB


    I found the "MSChart1.Redraw = bool" property. By wrapping my code in
    that it cuts the inital loading from 20 seconds to about 9 seconds.
    Updating is pretty instant but with a small flicker which isn't a
    problem for me.

    Thanks NB
    NvrBst, Jan 4, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. arc

    MSChart in .NET environmnet

    arc, Mar 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,667
    Ken Cox [Microsoft MVP]
    Mar 4, 2004
  2. =?Utf-8?B?X0RvdWc=?=

    MSChart won't work

    =?Utf-8?B?X0RvdWc=?=, Jan 7, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    360
    =?Utf-8?B?X0RvdWc=?=
    Jan 7, 2005
  3. John Blair
    Replies:
    2
    Views:
    2,150
    John Blair
    Jan 12, 2005
  4. MSChart in ASPX

    , Jun 22, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    582
    Mark Rae
    Jun 22, 2007
  5. MSChart Memory Leak

    , Aug 1, 2009, in forum: ASP .Net
    Replies:
    0
    Views:
    571
Loading...

Share This Page