But does not display the tooltip. --> (a.png)
However, the tooltip is displayed, use the Zoom. --> (b.png)
a.png & b.png is same data.
What is the reason?
=============================
private void SetChartSettlement()
{
#region 침하량
SettlementMapping.LegendLabel = "침하량(m)";
SettlementMapping.SeriesDefinition = new LineSeriesDefinition();
(SettlementMapping.SeriesDefinition as LineSeriesDefinition).ShowPointMarks = false;
(SettlementMapping.SeriesDefinition as LineSeriesDefinition).ShowItemLabels = false;
(SettlementMapping.SeriesDefinition as LineSeriesDefinition).ShowItemToolTips = true;
SettlementMapping.SeriesDefinition.ShowItemToolTips = true;
SettlementMapping.SeriesDefinition.Appearance.PointMark.Shape = MarkerShape.Triangle;
SettlementMapping.SeriesDefinition.Appearance.PointMark.Shape = MarkerShape.Triangle;
SettlementMapping.SeriesDefinition.Appearance.PointMark.Stroke = new SolidColorBrush(Colors.Red);
SettlementMapping.SeriesDefinition.Appearance.PointMark.StrokeThickness = 1;
SettlementMapping.SeriesDefinition.Appearance.PointMark.Fill = new SolidColorBrush(Colors.Red);
SettlementMapping.SeriesDefinition.Appearance.StrokeThickness = 1;
SettlementMapping.SeriesDefinition.Appearance.Stroke = new SolidColorBrush(Colors.Red);
SettlementMapping.SeriesDefinition.ItemToolTipFormat = "측 정 일: #DATAITEM.MesDate{yyyy-MM-dd HH:mm}" +
//"\n침 하 량: #DATAITEM.TotalSettlement{#,##0.000} (m)" +
"\n침 하 량: #DATAITEM.TotalSettlement{###,###,##0.000} (m)" +
"\n=============" +
"\n경과일수: #DATAITEM.TotalPassDay{#,##0} (일)" +
"\n상 단 고: #DATAITEM.TopHeight{#,##0.000} (m)" +
"\n지 반 고: #DATAITEM.GroundHeight{#,##0.000} (m)" +
"\n봉 길 이: #DATAITEM.RodHeight{#,##0.000} (m)" +
"\n성 토 고: #DATAITEM.EmLevel{#,##0.000} (m)" +
"\n비 고: #DATAITEM.ETC{}";
SettlementMapping.ItemMappings.Add(new ItemMapping("TotalPassDay", DataPointMember.XValue));
SettlementMapping.ItemMappings.Add(new ItemMapping("TotalSettlement", DataPointMember.YValue));
this.chart.SeriesMappings.Add(SettlementMapping);
#endregion 침하량
}
private void DataLoadComplete(DomainContextLoadBatch batch)
{
try
{
this.busyIndicator.IsBusy = false;
this.btnPrint.IsEnabled = true;
this.btnModify.IsEnabled = true;
if (batch != null)
{
if (batch.FailedOperationCount > 0)
{
// Do Error handling
}
else
{
this.chart.DefaultView.ChartLegend.Visibility = Visibility.Visible;
this.chart.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Normal;
this.chart.DefaultView.ChartArea.AxisX.AutoRange = true;
this.SetChartPL();
this.SetChartEmLevel();
this.SetChartSettlement();
this._so = _ds.T_SOs.FirstOrDefault();
this.DataContext = _so;
if (_ds.T_SO_SettlementPlates.Count > 0)
{
//값표시
_sp = this._so.T_SO_SettlementPlate.FirstOrDefault();
this.OriginEL.Text = _sp.OriginEL.ToString();
this.EmStartDate.Text = (_sp.EmStartDate ?? DateTime.Now).ToString("yyyy-MM-dd"); // 성토시작일
_mdList = SettlementPlateFunc.GetDataSource(_ds.T_SOs.FirstOrDefault());
if (_mdList.Count > 0)
{
//침하량 축 Range
double seMax = 0;
if (Math.Abs(_mdList.Max(m => m.TotalSettlement)) > Math.Abs(_mdList.Min(m => m.TotalSettlement)))
{
seMax = Math.Abs(_mdList.Max(m => m.TotalSettlement));
}
else
{
seMax = Math.Abs(_mdList.Min(m => m.TotalSettlement));
}
seMax = Utils.RangeCal(seMax);
//성토고 축 Range
double emMax = 0;
if (Math.Abs(_mdList.Max(m => m.EmLevel)) > Math.Abs(_mdList.Min(m => m.EmLevel)))
{
emMax = Math.Abs(_mdList.Max(m => m.EmLevel));
}
else
{
emMax = Math.Abs(_mdList.Min(m => m.EmLevel));
}
emMax = Utils.RangeCal(emMax);
this.emLevelMapping.LegendLabel = "성토고 : " + _mdList.Last().EmLevel.ToString("0.000") + "(m)";
this.SettlementMapping.LegendLabel = "침하량 : " + _mdList.Last().TotalSettlement.ToString("0.000") + "(m)";
this.chart.DefaultView.ChartArea.AxisY.AddRange(-seMax, seMax, Utils.StepCal(seMax));
this.chart.DefaultView.ChartArea.AxisY.AutoRange = false;
this.chart.DefaultView.ChartArea.AxisY.ExtendDirection = AxisExtendDirection.None;
this.chart.DefaultView.ChartArea.AxisY.DefaultLabelFormat = "0.000";
this.chart.DefaultView.ChartArea.AdditionalYAxes[0].AddRange(-emMax, emMax, Utils.StepCal(emMax));
this.chart.DefaultView.ChartArea.AdditionalYAxes[0].AutoRange = false;
this.chart.DefaultView.ChartArea.AdditionalYAxes[0].ExtendDirection = AxisExtendDirection.None;
this.chart.DefaultView.ChartArea.AdditionalYAxes[0].DefaultLabelFormat = "0.0";
this.chart.ItemsSource = _mdList;
this.dataGrid.ItemsSource = _mdList;
#region PL고 설정
if ((_sp.PL1 ?? 0) > 0)
{
DataPoint dap = new DataPoint();
dap.YValue = (double)_sp.PL1;
dap.XValue = 0;
dataPL1.Add(dap);
dap = new DataPoint();
dap.YValue = (double)_sp.PL1;
dap.XValue = _mdList.LastOrDefault().TotalPassDay;
dataPL1.Add(dap);
this.dataPL1.LegendLabel = "P/L1고 : " + (_sp.PL1 ?? 0).ToString("0.000") + "(m)";
this.chart.DefaultView.ChartArea.DataSeries.Insert(0, this.dataPL1);
}
if ((_sp.PL2 ?? 0) > 0)
{
DataPoint dap = new DataPoint();
dap.YValue = (double)_sp.PL2;
dap.XValue = 0;
dataPL2.Add(dap);
dap = new DataPoint();
dap.YValue = (double)_sp.PL2;
dap.XValue = _mdList.LastOrDefault().TotalPassDay;
dataPL2.Add(dap);
this.dataPL2.LegendLabel = "P/L2고 : " + (_sp.PL2 ?? 0).ToString("0.000") + "(m)";
this.chart.DefaultView.ChartArea.DataSeries.Insert(0, this.dataPL2);
}
if ((_sp.PL3 ?? 0) > 0)
{
DataPoint dap = new DataPoint();
dap.YValue = (double)_sp.PL3;
dap.XValue = 0;
dataPL3.Add(dap);
dap = new DataPoint();
dap.YValue = (double)_sp.PL3;
dap.XValue = _mdList.LastOrDefault().TotalPassDay;
dataPL3.Add(dap);
this.dataPL3.LegendLabel = "P/L3고 : " + (_sp.PL3 ?? 0).ToString("0.000") + "(m)";
this.chart.DefaultView.ChartArea.DataSeries.Insert(0, this.dataPL3);
}
if ((_sp.PL4 ?? 0) > 0)
{
DataPoint dap = new DataPoint();
dap.YValue = (double)_sp.PL4;
dap.XValue = 0;
dataPL4.Add(dap);
dap = new DataPoint();
dap.YValue = (double)_sp.PL4;
dap.XValue = _mdList.LastOrDefault().TotalPassDay;
dataPL4.Add(dap);
this.dataPL4.LegendLabel = "P/L4고 : " + (_sp.PL4 ?? 0).ToString("0.000") + "(m)";
this.chart.DefaultView.ChartArea.DataSeries.Insert(0, this.dataPL4);
}
if ((_sp.PL5 ?? 0) > 0)
{
DataPoint dap = new DataPoint();
dap.YValue = (double)_sp.PL5;
dap.XValue = 0;
dataPL5.Add(dap);
dap = new DataPoint();
dap.YValue = (double)_sp.PL5;
dap.XValue = _mdList.LastOrDefault().TotalPassDay;
dataPL5.Add(dap);
this.dataPL5.LegendLabel = "P/L5고 : " + (_sp.PL5 ?? 0).ToString("0.000") + "(m)";
this.chart.DefaultView.ChartArea.DataSeries.Insert(0, this.dataPL5);
}
#endregion PL고 설정
}
}
}
}
int rtime = (_so.RefleshTime ?? 60);
timer1.Interval = TimeSpan.FromMinutes(rtime);
this.timer1.Start();
}
catch (Exception ex)
{
//MessageBox.Show(ex.ToString());
}
finally
{
GC.Collect();
GC.WaitForPendingFinalizers();
GC.Collect();
}
}