Jump to content
Software FX Community

Constaint line in datalist bound chart


Recommended Posts

 I need help getting a constaint line in a chart that is inside of a datalist control.  When I try to use the CustomGridLine function I keep getting a "System.NullReferenceException was unhandled by user code  Message="Object reference not set to an instance of an object." error during post back.  This works fine when I add a chart to the form that is not inserted in the datalist control.  See code below.

 Partial Class Chart   Inherits System.Web.UI.Page   Dim AddAssyLines As String   Dim Chart As ChartFX.WebForms.Chart   Protected Sub ChartBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ChartBtn.Click   AssyChkBox.Visible = False   ChartBtn.Visible = False   DataListRadar.Visible = True   AddAssyLines = BuildValueList(AssyChkBox.Items, True)   AssyLinesBTTlbl.Text = AddAssyLines   Chart = DataListRadar.FindControl("Chart1")   Dim custom1 As ChartFX.WebForms.CustomGridLine   custom1 = New ChartFX.WebForms.CustomGridLine   custom1.Value = 95   custom1.Color = System.Drawing.Color.DarkBlue   custom1.Text = "Target 95%"   custom1.Width = 2   Chart.AxisY.CustomGridLines.Add(custom1)   End Sub   Protected Function BuildValueList(ByVal items As ListItemCollection, ByVal itemMustBeSelected As Boolean) As String   Dim idList As StringBuilder = New StringBuilder()   For Each item As ListItem In items   If itemMustBeSelected AndAlso (Not item.Selected) Then   Continue For   Else   idList.Append(item.Value.ToString())   idList.Append(",")   End If   Next item   Return idList.ToString()   End FunctionEnd Class

Link to comment
Share on other sites

  • 4 weeks later...

Hi,Could you please report this problem to support at softwarefx dot com?

We will try to replicate the issue on our side so we can confirm it as a bug. However we would appreciate that you send an email detailing what exactly happens at your end so we can properly track the incident.



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.

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.

  • Create New...