Question

How to change the size of a chart marker?

Posted 4 years ago by Avatar Irene Aquino

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 4 years ago]


Comments (2)

Posted 4 years ago by Irene Aquino

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

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

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
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.