Beispiel #1
0
        public void RemoveAnnotations(ISubprofilingTool tool)
        {
            if (tool.GetType() == typeof(DiffWidthHeightSubprofilingTool))
            {
                DiffWidthHeightSubprofilingTool added = tool as DiffWidthHeightSubprofilingTool;
                sciChartSurface.Annotations.Remove(added.Horizontals[0]);
                sciChartSurface.Annotations.Remove(added.Horizontals[1]);
                sciChartSurface.Annotations.Remove(added.Verticals[0]);
                sciChartSurface.Annotations.Remove(added.Verticals[1]);
            }

            if (tool.GetType() == typeof(HeightMinMaxTool))
            {
                HeightMinMaxTool added = tool as HeightMinMaxTool;
                sciChartSurface.Annotations.Remove(added.Verticals[0]);
                sciChartSurface.Annotations.Remove(added.Verticals[1]);
            }
        }
Beispiel #2
0
        public void AddAnnotations(ISubprofilingTool tool)
        {
            if (tool.GetType() == typeof(DiffWidthHeightSubprofilingTool))
            {
                var xList = GetDataKeyList();
                var yList = GetDataValueList();

                DiffWidthHeightSubprofilingTool added = tool as DiffWidthHeightSubprofilingTool;
                added.Horizontals[0].Y1 = yList.Min();
                added.Horizontals[1].Y1 = yList.Max();
                added.Verticals[0].X1   = xList.Min();
                added.Verticals[1].X1   = xList.Max();
                added.Height            = Math.Round(Math.Abs(
                                                         (double)(added.Horizontals[0].Y1) -
                                                         (double)(added.Horizontals[1].Y1)), 6);
                added.Width = Math.Round(Math.Abs(
                                             (double)(added.Verticals[0].X1) -
                                             (double)(added.Verticals[1].X1)), 6);
                added.Value1 = String.Format("{0:Height:0.######}", Height.ToString());
                added.Value2 = String.Format("{0:Width:0.######}", Width.ToString());
                sciChartSurface.Annotations.Add(added.Horizontals[0]);
                sciChartSurface.Annotations.Add(added.Horizontals[1]);
                sciChartSurface.Annotations.Add(added.Verticals[0]);
                sciChartSurface.Annotations.Add(added.Verticals[1]);
            }

            else if (tool.GetType() == typeof(HeightMinMaxTool))
            {
                var xList = GetDataKeyList();
                var yList = GetDataValueList();

                HeightMinMaxTool added = tool as HeightMinMaxTool;
                added.Verticals[0].X1 = xList.Min();
                added.Verticals[1].X1 = xList.Max();
                added.Update();
                sciChartSurface.Annotations.Add(added.Verticals[0]);
                sciChartSurface.Annotations.Add(added.Verticals[1]);
            }
        }