can anyone help me add a title to a graph?

the code i run to create the graph is

[B]Dim strConn As String = connectionstring
        Dim conn As New SqlConnection(strConn)
        Dim sqlProducts As String = "SELECT * from VW_OEEBrakeDowns_ByYear where Year ='" & Me.lbyear.Text & "' and LineNumber =" & Me.lbline.Text & ""
        Dim da As New SqlDataAdapter(sqlProducts, conn)
        Dim ds As New DataSet()
        da.Fill(ds, "BDHRS")
        Dim ChartArea2 As ChartArea = New ChartArea()
        Dim Legend2 As Legend = New Legend()
        Dim Series2 As Series = New Series()
        Dim Chart2 = New Chart()
        Me.Controls.Add(Chart2)
        ChartArea2.Name = "ChartArea2"
        Chart2.ChartAreas.Add(ChartArea2)
        Legend2.Name = "Legend1"
        Chart2.Legends.Add(Legend2)
        Chart2.Location = New System.Drawing.Point(613, 5)
        Chart2.Name = "Chart2"
        Series2.ChartArea = "ChartArea2"
        Series2.Legend = "Legend1"
        Series2.Name = "Series2"
        Chart2.Series.Add(Series2)
        Chart2.Size = New System.Drawing.Size(600, 400)
        Chart2.TabIndex = 0
        Chart2.Text = "Chart2"

        Chart2.Series("Series2").XValueMember = "BrakeDownDesc"
        Chart2.Series("Series2").YValueMembers = "DownHrs"

        Chart2.DataSource = ds.Tables("BDHRS")[/B]

Maybe you can add a new title to the Chart2.Titles collection.

Hope this helps

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.