Jump to content
Software FX Community

NullReferenceException in chart.set_ValueEx


User (Legacy)
 Share

Recommended Posts

Using ChartFX client server + financial extention:

I put the following lines of code ( VB.net) in a button click to drow my

data on a chart:

//////////////////start of code////////////////////////////

chart.OpenDataEx(ChartfxLib.CfxCod.COD_VALUES, 5, ds.Tables(0).Rows.Count -

1)

chart.OpenDataEx(ChartfxLib.CfxCod.COD_XVALUES, 1, ds.Tables(0).Rows.Count -

1)

For count = 0 To ds.Tables(0).Rows.Count - 1

chart.set_ValueEx(0, count, ds.Tables(0).Rows(count)("Low"))

chart.set_ValueEx(1, count, ds.Tables(0).Rows(count)("open"))

'<--- the red line

chart.set_ValueEx(2, count, ds.Tables(0).Rows(count)("close"))

chart.set_ValueEx(3, count, ds.Tables(0).Rows(count)("high"))

chart.set_ValueEx(4, count, ds.Tables(0).Rows(count)("vol"))

chart.set_XValueEx(0, count,

ds.Tables(0).Rows(count)("ts_date").Date.ToOADate())

Next count

chart.CloseData(ChartfxLib.CfxCod.COD_VALUES)

chart.CloseData(ChartfxLib.CfxCod.COD_XVALUES)

//////////////////end of code////////////////////////////

this code works well when I click on the button for the first time BUT for

the second time

the red line throws a nullreference exception

Why this happens? and how can I overcome this?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...