Customising BarSeries to display the value within the bar

Charts for WPF Forum

Posted 3 years ago by Colin H
Version: 20.1.1
Avatar

I have some BarSeries charts, and am using the LabelVisibility to show the bar's Y 'value'. I'd prefer though to display the Y value within the bar. (Hope that makes sense - I can't spot a way to paste an example image into this post)

Is this possible, and if so, any pointers/tips to how to customise it....? 

Comments (1)

Answer - Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Colin,

You could probably do this by customizing the BarSeries.BarTemplate. 

If you open our BarStyles QuickStart and add this to the BarSeriesStyle's Setters, you should be able to see the value in the bar:

<Setter Property="BarTemplate">
	<Setter.Value>
		<DataTemplate>
			<Grid>
				<Rectangle Fill="Yellow" />
				<TextBlock Text="{Binding YValue}" VerticalAlignment="Center" HorizontalAlignment="Center" />
			</Grid>
		</DataTemplate>
	</Setter.Value>
</Setter>

[Modified 3 years ago]


Actipro Software Support

The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.