| 

.NET C# Java Javascript Exception

1
Wie im Code angezeigt, bekomme ich CustomLabels angezeigt, aber sie liegen nicht auf den in der ChartArea definierten MajorTickMarks. Wie bekomme ich das synchron?
[vb.net]Dim von_X, bis_X As Date
von_X = myClass.get_DateOfWeek(CInt(yearkNo), CInt(weekNo), DayOfWeek.Monday)
'Letzte Woche aus mainTable
weekNo = mainTable.Columns(mainTable.Columns.Count - 1).ColumnName.Split(CChar("/"))(0).Substring(2, 2)
yearkNo = mainTable.Columns(mainTable.Columns.Count - 1).ColumnName.Split(CChar("/"))(1).Substring(0, 4)
bis_X = myClass.get_DateOfWeek(CInt(yearkNo), CInt(weekNo), DayOfWeek.Saturday)

Dim ints as integer = CInt(DateDiff(DateInterval.WeekOfYear, von_X, bis_X, FirstDayOfWeek.Monday, FirstWeekOfYear.FirstFullWeek))
Dim xdate(ints) As Date 'wird in einer Schleife durchlaufen und das Datum der jeweiligen Woche hinzugefügt.

newchart(chart1) 'erzeuge neuen chart
Dim chartArea1 As New ChartArea("Default")
chart1.ChartAreas.Add(chartArea1)

chart1.ChartAreas("Default").AxisX.IntervalType = DateTimeIntervalType.Weeks
chart1.ChartAreas("Default").AxisX.Interval = 1
chart1.ChartAreas("Default").AxisX.LabelAutoFitStyle = LabelAutoFitStyles.DecreaseFont
chart1.ChartAreas("Default").AxisX.LabelAutoFitMinFontSize = 7
chart1.ChartAreas("Default").AxisX.LabelStyle.Font = My.Settings.fontbold8
chart1.ChartAreas("Default").AxisX.LabelStyle.Angle = 90
chart1.ChartAreas("Default").AxisX.MajorTickMark.Enabled = True
chart1.ChartAreas("Default").AxisX.MinorTickMark.Enabled = False
chart1.ChartAreas("Default").AxisX.Minimum = von_X.ToOADate()'44443
chart1.ChartAreas("Default").AxisX.Maximum = bis_X.ToOADate()'44828
chart1.ChartAreas("Default").AxisX.IsMarginVisible = False

chart1.Series.Add("K").Color = ColorTranslator.FromHtml("#297AB7") 'MattBlau colorx(0)
chart1.Series("K").Points.DataBindXY(xdate, yValues)

chart1.ChartAreas("Default").AxisX.CustomLabels.Clear()
For intVal As Integer = 0 To ints - 1
Debug.Print(intVal & " - " & Format(xdate(intVal), "yyyy-MM-dd"))
Select Case intVal
Case 0, 5, 10, 15, 20, ints - 2
chart1.ChartAreas("Default").AxisX.CustomLabels.Add(xdate(intVal).ToOADate(), xdate(ints - 1).ToOADate(), myClass.get_WeekNumber(xdate(intVal)) & "/" & xdate(intVal).Year)
End Select
Next
[/vb.net]
News:
17.05.2022
TOP TECHNOLOGIES CONSULTING GmbH