This is a migrated thread and some comments may be shown as answers.

Width of first and last bars in reporting Graph is cut in half

2 Answers 98 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 22 Apr 2020, 02:10 PM
Using the Telerik.Reporting.Graph, how can I get the first and last bar to not be cut in half?

2 Answers, 1 is accepted

Sort by
0
David
Top achievements
Rank 1
answered on 24 Apr 2020, 01:35 PM

I have worked around this issue, but it doesn't seem quite like the proper way of doing it.

Just in case someone else comes across this issue and the "proper" way is never revealed, this is what I did:

My data is always a range such as 1-20, or 1-30. I manually set the cartesianCoordinateSystem.XAxis.Scale.Minimum to 0.65, this allowed a little space between the y axis line and the first bar.

To handle the maximum value, I left the default to NaN, but setup a binding to change the Maximum. You set the binding under cartesianCoordinateSystem, not the graph itself. The binding I used was:

Property Path : XAxis.Scale.Maximum

Expression: = IsNull(CDbl(Max(Fields.DisplayNumber)), 20) + 0.35

The IsNull wasnt really needed, but the preview in the designer was showing an error without it.

0
Accepted
Katia
Telerik team
answered on 27 Apr 2020, 09:00 AM

Hello David,

Based on the provided information, it seems that you are using a Numerical scale for XAxis which places the data points precisely where the tick marks are. I can confirm that the solution using bindings for changing the Maximum and Minimum properties of the Scale is the correct one.

You can also test if switching to a Category scale might bring the desired visualization of the data points - How to change the axis scale to Category.

 

Regards,
Katia
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
David
Top achievements
Rank 1
Answers by
David
Top achievements
Rank 1
Katia
Telerik team
Share this question
or