change - 老发泡线图表刷新闪烁问题处理

dev
wenjy 1 year ago
parent 2cba8a8813
commit 6599168e10

@ -217,9 +217,11 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
var hourFoamDataList = _boxFoamDataServices.Query(x=>x.ProductLineCode == "CX_01" && x.StationCode == "1105");
if(hourFoamDataList != null)
List<int> hours = new List<int>();
if (hourFoamDataList != null)
{
HourAchievement.Clear();
hourAchievement.Add(hourFoamDataList.Sum(x => x.AnHour));
hourAchievement.Add(hourFoamDataList.Sum(x => x.TwoHour));
hourAchievement.Add(hourFoamDataList.Sum(x => x.ThreeHour));
@ -233,11 +235,27 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
hourAchievement.Add(hourFoamDataList.Sum(x => x.ElevenHour));
hourAchievement.Add(hourFoamDataList.Sum(x => x.TwelveHour));
}
var shellColumn = new ColumnSeries();
shellColumn.DataLabels = true;
shellColumn.Title = "小时产量";
shellColumn.Values = hourAchievement;
HourAchievement.Add(shellColumn);
if(HourAchievement.Count > 0)
{
for (int i = 0; i < hourAchievement.Count; i++)
{
//hours
HourAchievement.FirstOrDefault().Values[i] = hourAchievement.ElementAt(i);
}
}
else
{
HourAchievement.Add(shellColumn);
}
}));
}
@ -258,8 +276,6 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
if (hourFoamDataList != null)
{
MaterialTypeAchievement.Clear();
var grouped = hourFoamDataList.GroupBy(x => x.Fixtureboxtype);
foreach (var item in grouped)
{
@ -273,7 +289,18 @@ namespace Aucma.Core.OldBoxFoam.ViewModels
shellColumn.DataLabels = true;
shellColumn.Title = "型号统计";
shellColumn.Values = materialTypeAchievement;
MaterialTypeAchievement.Add(shellColumn);
if (MaterialTypeAchievement.Count > 0)
{
for (int i = 0; i < materialTypeAchievement.Count; i++)
{
MaterialTypeAchievement.FirstOrDefault().Values[i] = materialTypeAchievement.ElementAt(i);
}
}
else
{
MaterialTypeAchievement.Add(shellColumn);
}
}));
}

@ -166,12 +166,11 @@
<TextBlock Text="当日小时产量统计" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" >
<lvc:CartesianChart Series="{Binding HourAchievement, UpdateSourceTrigger=PropertyChanged}" >
<lvc:CartesianChart Series="{Binding HourAchievement, UpdateSourceTrigger=PropertyChanged}" Foreground="White" DisableAnimations="True">
<lvc:CartesianChart.AxisX>
<lvc:Axis Labels="{Binding HourOutPutList}" FontSize="15">
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1.5" StrokeDashArray="0" Stroke="White" >
<lvc:Separator Visibility="Hidden" StrokeThickness="1.5" StrokeDashArray="0" Stroke="Transparent" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>
@ -179,7 +178,7 @@
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="15" MinValue="0" LabelFormatter="{Binding YAxisLabelFormatter}" >
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56">
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="Transparent">
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>
@ -199,11 +198,11 @@
<TextBlock Text="当日型号产量统计" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
<Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" >
<lvc:CartesianChart Series="{Binding MaterialTypeAchievement, UpdateSourceTrigger=PropertyChanged}" Margin="5">
<lvc:CartesianChart.AxisX>
<lvc:CartesianChart Series="{Binding MaterialTypeAchievement, UpdateSourceTrigger=PropertyChanged}" Margin="5" Foreground="White" DisableAnimations="True">
<lvc:CartesianChart.AxisX >
<lvc:Axis Labels="{Binding MaterialTypeOutPutList}" FontSize="15">
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1.5" StrokeDashArray="0" Stroke="#404F56" >
<lvc:Separator Visibility="Hidden" StrokeThickness="1.5" StrokeDashArray="0" Stroke="Transparent" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>
@ -211,7 +210,7 @@
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="15" MinValue="0" LabelFormatter="{Binding YAxisLabelFormatter}">
<lvc:Axis.Separator>
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="Transparent" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>

Loading…
Cancel
Save