문제

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'.

도움이 되었습니까?

해결책

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

다른 팁

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top