Steppy lines

Posted 8 months ago by Avatar Julian Thomas


I am not able to get a smooth line, it has descrete steps in it. I have tried with and without aggregation and they are still there. For example, if I use a pure sine wave, you can see the steps:

Without aggregation:

With aggregation, the line just becomes 'bumpy':

It is as though only certain angles of line can be rendered (integer perhaps?)

code I am using:


<charts:XYChart IsLegendVisible="True" PaddingPercentage="0" LegendHorizontalPosition="LeftInside"
GridLineMajorVisibility="Y" Margin="73,64,36,47">
<charts:Palette Kind="Roman"/>

<charts:XYDoubleAxis x:Name="yAxis" Position="FarEdge" AreMajorTicksVisible="True" Minimum="0.0" Maximum="80.0" TickMajorInterval="10.0" Title="Stock Value"/>
<charts:LineSeries ItemsSource="{Binding ElementName=CTLiveMainWindow, Path=ChartData1}" YAxis="{Binding ElementName=yAxis}" Description="Cyberdyne" IsAggregationEnabled="True" YPath="Amount" XPath="Index" LineKind="Normal" Name="lineSeries"/>



Style style = new System.Windows.Style();
style.Setters.Add(new Setter(Shape.StrokeThicknessProperty, 1.0));
lineSeries.LineStyle = style;

for (int i = 0; i <= 1800; i++)
double value = Math.Sin(i / 100.0) * 40.0 + 40.0;
var newSalesData1 = new SalesData(DateTime.Now, value, i);




Comments (1)

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

Hi Julian,

Thanks for reporting this.  It appears to be due to some optimizations we make to help reduce anti-aliasing of lines in general.  We round data points a tad to assist with that by default.

For the next build, we have added a XYAxisBase.UseDisplayOptimizations property that you'd want to set to false on both axes.  That will turn off our rounding and will make the lines smooth for this kind of scenario.

Actipro Software Support
Information The latest build of this product (2018.1 build 0671) was released 1 month ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.