Question

Horizontal Legend Layout

Posted 11 months ago by Avatar Nathan Hanson

Hi! I'm evaluating Actipro's charting component for use in an upcoming software release. It's looking great so far but I have a question about the legend. The Legend can be placed in a variety of locations and that's really helpful. But I'd like to have the legend items lay out horizontally instead of vertically when I put the legend above or below the chart itself. Can a horizontal orientation be set through a template or anything?

Thanks,

Nate Hanson

EPIS, LLC.


Comments (2)

Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA

Hi Nate,

Thanks for evaluating our products.  The Legend is an ItemsControl, so you can change its layout to horizontal by adding this to XYChart:

<charts:XYChart.LegendStyle>
	<Style TargetType="ItemsControl">
		<Setter Property="ItemsPanel">
			<Setter.Value>
				<ItemsPanelTemplate>
					<StackPanel Orientation="Horizontal" />
				</ItemsPanelTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</charts:XYChart.LegendStyle>

Actipro Software Support
Posted 10 months ago by Nathan Hanson

Excellent! That worked like a charm. I love WPF components. The chart I'm hoping to replace is an old Winforms component and I have no control over things like the legend style.

Thanks for the help! I'll be demoing my WPF chart sample app for the higher ups soon. Hoping to sell them on the whole suite of your controls.

Information The latest build of this product (2018.1 build 0672) was released 2 months ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.