How to change the size of a chart marker?

Charts for WPF Forum

Posted 9 years ago by Irene Aquino
Version: 14.2.0610
Avatar

Hi,

I'm developing an XYChart with a LineSeries. What I would like to do is when the series reaches the Maximum XAxis value and the chart refreshes, the series will start again on leftmost part of the chart and the line series will have a vertical line in front of it. Upon evaluating available controls of Actipro, I saw that this would be achievable by using the chart marker and setting the chart marker visibility to "last", only I need the marker to be a vertical line. Is this possible? I tried creating a template for the line but the size of the marker seems to be restricted somewhere I can not find.

<charts:LineSeries.MarkerStyle>
<Style TargetType="charts:ChartMarker">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="charts:ChartMarker">
<Rectangle
x:Name="LineMarker"
Fill="{TemplateBinding Background}"
Height="50" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</charts:LineSeries.MarkerStyle>

 

Any help would be very appreciated. Thanks!!

[Modified 9 years ago]

Comments (2)

Posted 9 years ago by Irene Aquino
Avatar

I achieved this by setting Height property in the same level of my template property.

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

Hi Irene,

The default style for ChartMarker has Setters for Width and Height.  As you saw, you would want to add your own Setters for those to override the default ones.  That should fix the problem.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.