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

Chart Labels inside column

2 Answers 235 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Phil
Top achievements
Rank 1
Phil asked on 06 Sep 2019, 01:57 PM

I have an issue on my Telerik charts where the data label will be inside of the column if the column reaches the edge of the chart area, as attached.

Is there anyway to force the chart to not reach the edge so this won't occur? I'm assuming it takes the largest value and uses that as the edge of the chart, how do I go about stopping this? I've made sure the DataPointLabelAlignment is set to OutsideEnd, as that would make the most logical sense.

Any help on this would be greatly appreciated - I'm sure it's something small and stupid that I'm missing!

 

Thanks,

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Silviya
Telerik team
answered on 10 Sep 2019, 11:50 AM

Hi Phil,

The graph axis range is determined by data, not by the visual representation of the data points. That's why the X axis maximum value is set to the maximum value according to the data instead of adding some more to accommodate the label.

The answer is to use the CoordinateSystem.Bindings - this way the axis minimum and maximum can be set using an expression and depending on the maximum provided value. For example, the PropertyPath should be set to XAxis.Scale.Maximum, and the Expression - to =Max(Fields.Value)+1, where Fields.Value represents the measure displayed on the X axis.
You can check the following article for more details: How to: Use Bindings to Control the Coordinate System Properties.

Best Regards,
Silviya
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Phil
Top achievements
Rank 1
answered on 16 Sep 2019, 09:45 AM

Hi Silviya,

That works a treat. I've been able to tweak the XAxis maximum scale to meet my needs and cause no overlapping of data point labels - issue resolved!

Thanks

Tags
General Discussions
Asked by
Phil
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Phil
Top achievements
Rank 1
Share this question
or