Question

Can't find my title element to the chart even do I add title to the chart.

   Imports System.Web.UI.DataVisualization.Charting
With chartResult
Dim t As Title = .Titles.Add("title1")
.Titles("title1").Alignment = ContentAlignment.MiddleLeft 'This is saying it can´t
can´t find the title 
end With

Argumentexception unhandle by user code A chart element with the name 'title1' could not be found in the 'TitleCollection'.

Was it helpful?

Solution

    Dim t As Title = chartResult.Titles.Add("Title1")
    t.Alignment = ContentAlignment.MiddleLeft

OTHER TIPS

Clearing titles (all):

 Chart1.Titles.Clear()

Adding title(s):

 Chart1.Titles.Add("some string")

Reading title from chart (first):

dim s As String = Chart1.Titles.Item(0).Text
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top