Dim t As Title = chartResult.Titles.Add("Title1")
t.Alignment = ContentAlignment.MiddleLeft
Adding a title to chart, can´t find the title element
سؤال
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'.
المحلول
نصائح أخرى
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
لا تنتمي إلى StackOverflow