Chart SeriesMapping Tooltip Error

5 posts, 0 answers
  1. Sang Jun Park
    Sang Jun Park avatar
    3 posts
    Member since:
    Aug 2009

    Posted 10 Oct 2010 Link to this post

    I have a chart composed by SeriesMapping.
    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();
                }
            }

     







  2. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 13 Oct 2010 Link to this post

    Hello Sang,

    I reviewed the code, and it looks correct. To properly trace the issue however, it will be best if you open a formal support ticket, and send us a small working project, demonstrating the issue at hand. We will debug it locally, and advise you further.

    Best wishes,
    Yavor
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Sang Jun Park
    Sang Jun Park avatar
    3 posts
    Member since:
    Aug 2009

    Posted 20 Oct 2010 Link to this post


    Thanks for your reply.

    Sharing is part of the project is difficult.

    The amount of data being processed is small, this expression is the tooltip, but the amount of data to many is that abnormal behavior.
  4. Yavor
    Admin
    Yavor avatar
    11 posts

    Posted 20 Oct 2010 Link to this post

    Hi Sang Jun Park,

    You can remove any unneeded modules for the sample, strip the data layer, and send along a reduced subset of the original project. We will debug it locally, and advise you further on the cause of the problem, as well as possible options to resolve the issue.

    Greetings,
    Yavor
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Sang Jun Park
    Sang Jun Park avatar
    3 posts
    Member since:
    Aug 2009

    Posted 09 Dec 2010 Link to this post

    I found the cause of the problem.

    the workaround is "this._chart.SamplingSettings.SamplingThreshold = 0;"

    Cause of the problem is that the SamplingThreshold was 200 by default.

    a lot of data processing was expressed by calculating the median.

    So the value is null DataItem calculate the exact value is not paying.

    ^^
Back to Top