This is a migrated thread and some comments may be shown as answers.

Chart SeriesMapping Tooltip Error

4 Answers 69 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Sang Jun Park
Top achievements
Rank 1
Sang Jun Park asked on 11 Oct 2010, 04:02 AM
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();
            }
        }

 







4 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 13 Oct 2010, 08:40 AM
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
0
Sang Jun Park
Top achievements
Rank 1
answered on 20 Oct 2010, 05:14 AM

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.
0
Yavor
Telerik team
answered on 20 Oct 2010, 12:53 PM
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
0
Sang Jun Park
Top achievements
Rank 1
answered on 10 Dec 2010, 03:18 AM
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.

^^
Tags
Chart
Asked by
Sang Jun Park
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Sang Jun Park
Top achievements
Rank 1
Share this question
or