Click here to Skip to main content
15,887,376 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:

VB
Public Property Label As String
Public Property RangeStart As Decimal
Public Property RangeEnd As Decimal



Populating the data:
VB
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
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900