Hello everyone,
I have an RDLC report in a Winforms VB.Net application,
which contains a chart of type: Range Bar
The goal is:
On the Y-Axis the days should be displayed as: 2018-12-01 ,2018-12-02 and so on,
On the X-Axis the range of the person availability time,
e.g.: at 2018-12-01, he is available from 9 AM to 2:30 PM and so on,
The model has 3 properties:
Public Property Label As String
Public Property RangeStart As Decimal
Public Property RangeEnd As Decimal
Populating the data:
Sub New(ByVal startDate as DateTime,ByVal endDate as DateTime)
Label = startDate.ToString("yyyy-MM-dd")
RangeStart = startDate.Hour + (startDate.Minute/60)
RangeEnd = endDate.Hour + (endDate.Minute/60)
End Sub
In the RDLC report in the horizontal axis properties I sat the minimum to 0 and the maximum to 24 and the interval to 1
works fine but the horizontal axis labels display: 0, 1, 2, ... etc
I need it to display 12AM, 1AM, .... etc
What I have tried:
1. I googled and found a solution that applies to a chart control in the from by changing the axis label in the code behind, but I don't know how to apply it to a chart in an RDLC report.
https://stackoverflow.com/questions/6444058/mschart-how-to-group-rangebar-data-with-text-labels-instead-of-indexes
2. I changed the data types of the RangeStart and RangeEnd properties to DateTime and changed the population of data accordingly:
No data is displayed when I run the application.
3. I changed the format of the horizontal Axis label to: hh tt
it doesn't work, simply displays hh tt for all labels