[英]wpf charting X axis doesn't come properly in respect to data and making over crouded
My chart contains a series of 5 line series. 我的图表包含5条线系列。 Each line with approx 1001 dots. 每行约有1001个点。 The data of each line is somewhat like this X values from 0 to 1000 and Y values from 0 to 5. My xml is : 每行的数据有点像这样,X值从0到1000,Y值从0到5。我的xml是:
<DVC:Chart Name="siReturnChart" Title="Si Return" LegendTitle="Legend" Width="850" Height="450">
<!-- Add Title on Y axis and X Axis -->
<DVC:Chart.Axes>
<DVC:LinearAxis Orientation="Y" Title="Chemical Concentration" HorizontalAlignment="Center" Location="Left" FontWeight="Bold" />
<DVC:CategoryAxis Orientation="X" Title="Production time (days)" Location="Bottom" HorizontalAlignment="Center" FontWeight="Bold" />
</DVC:Chart.Axes>
<DVC:Chart.Series>
<DVC:LineSeries Name="set1layer1Chart" Title="Set 1 Layer 1" IndependentValueBinding="{Binding X}" DependentValueBinding="{Binding Y}" />
<DVC:LineSeries Name="set1layer2Chart" Title="Set 1 Layer 2" IndependentValueBinding="{Binding X}" DependentValueBinding="{Binding Y}" />
<DVC:LineSeries Name="set1layer3Chart" Title="Set 1 Layer 3" IndependentValueBinding="{Binding X}" DependentValueBinding="{Binding Y}" />
<DVC:LineSeries Name="set1layer4Chart" Title="Set 1 Layer 4" IndependentValueBinding="{Binding X}" DependentValueBinding="{Binding Y}" />
<DVC:LineSeries Name="set1layer5Chart" Title="Set 1 Layer 5" IndependentValueBinding="{Binding X}" DependentValueBinding="{Binding Y}" />
<DVC:LineSeries Name="set1wellChart" Title="Set 1 Whole Well" IndependentValueBinding="{Binding X}" DependentValueBinding="{Binding Y}" />
The result of the chart is : 图表的结果是:
Why the X axis show like this and not the numbers from 0 to 1000 ?? 为什么X轴显示这样而不显示0到1000之间的数字? Due to the X axis, the Y axis is also not shown properly and the center of X axis also looks somewhat weird. 由于X轴,Y轴也未正确显示,并且X轴的中心看起来也有些怪异。
Where am I going wrong ? 我要去哪里错了? Any idea how do I correct this !!!! 任何想法我该如何纠正!!!!
Thanks 谢谢
Added the following line in DVC::Chart.Axes 在DVC :: Chart.Axes中添加了以下行
<DVC:LinearAxis Orientation="X" Location="Bottom" Interval="100" />
and things got better. 情况变好了。 The issue was on X Axis numbers from 0 to 1000 was displaying as it wasn't fitting on 1 line so it was coming on 3 lines messing up the display. 问题出在显示0到1000的X轴数字上,因为它不适合1行,所以它出现在3行上使显示混乱。 By adding interval of 100, the dots are coming properly. 通过增加间隔100,点将正确出现。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.