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

[Solved] Label position for horizontal bar chart

3 Answers 259 Views
Chart for XAML
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nazia
Top achievements
Rank 1
Nazia asked on 24 Jul 2012, 09:52 AM
Hi,

 I am creating a horizontal bar chart and setting its lables like

barseries.LabelDefinitions.Add(new ChartSeriesLabelDefinition { Margin = new Thickness(0, 0, 0, 0) });



But the labels gets displayed at the right side.I need them at the top of each bar.

In case of vertical bar, it displays automatically at the top of each bar.

How do I get the same feature for horizontal bar chart?

3 Answers, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 26 Jul 2012, 01:59 PM
Hi Nazia,

Thank you for contacting us and for your question.

You can alter the HorizontalAlignment and VerticalAlignment of the ChartSeriesLabelDefinition object:

<telerik:BarSeries ShowLabels="True">
    <telerik:BarSeries.LabelDefinitions>
        <telerik:ChartSeriesLabelDefinition HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,0,0,0">
        </telerik:ChartSeriesLabelDefinition>
    </telerik:BarSeries.LabelDefinitions>
</telerik:BarSeries>

I hope this helps. Let me know if you have further questions.

Regards,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Matt
Top achievements
Rank 1
answered on 15 Oct 2014, 02:45 AM
What if I want to build a horizontal bar chart where the field numbers are on one side (in this case the left side) when the data is positive, and the other side (in this case the right side) when the data is negative? I've attached an image of a mock-up made in Excel for reference.
0
Ves
Telerik team
answered on 17 Oct 2014, 10:06 AM
Hi Matt,

I have attached a small example, showing how to achieve this.

Best regards,
Ves
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Chart for XAML
Asked by
Nazia
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Matt
Top achievements
Rank 1
Ves
Telerik team
Share this question
or