示例#1
0
 internal void AddHotRegion(int insertIndex, ChartGraphics graph, float x, float y, float radius, DataPoint point, string seriesName, int pointIndex)
 {
     if ((ProcessChartMode & ProcessMode.ImageMaps) == ProcessMode.ImageMaps && common.ChartPicture.MapEnabled && (point.ToolTip.Length > 0 || point.Href.Length > 0 || point.MapAreaAttributes.Length > 0))
     {
         float[] coordinates = new float[3]
         {
             x,
             y,
             radius
         };
         common.ChartPicture.MapAreas.Insert(insertIndex, MapAreaShape.Circle, point.ReplaceKeywords(point.ToolTip), point.ReplaceKeywords(point.Href), point.ReplaceKeywords(point.MapAreaAttributes), coordinates, ((IMapAreaAttributes)point).Tag);
     }
     if ((ProcessChartMode & ProcessMode.HotRegions) == ProcessMode.HotRegions)
     {
         HotRegion    hotRegion     = new HotRegion();
         PointF       absolutePoint = graph.GetAbsolutePoint(new PointF(x, y));
         SizeF        absoluteSize  = graph.GetAbsoluteSize(new SizeF(radius, radius));
         GraphicsPath graphicsPath  = new GraphicsPath();
         graphicsPath.AddEllipse(absolutePoint.X - absoluteSize.Width, absolutePoint.Y - absoluteSize.Width, 2f * absoluteSize.Width, 2f * absoluteSize.Width);
         hotRegion.BoundingRectangle = graphicsPath.GetBounds();
         hotRegion.SeriesName        = seriesName;
         hotRegion.Type                = ChartElementType.DataPoint;
         hotRegion.PointIndex          = pointIndex;
         hotRegion.Path                = graphicsPath;
         hotRegion.RelativeCoordinates = false;
         if (point != null && point.IsAttributeSet("OriginalPointIndex"))
         {
             hotRegion.PointIndex = int.Parse(point["OriginalPointIndex"], CultureInfo.InvariantCulture);
         }
         regionList.Add(hotRegion);
     }
 }
示例#2
0
 internal void AddHotRegion(int insertIndex, GraphicsPath path, bool relativePath, ChartGraphics graph, DataPoint point, string seriesName, int pointIndex)
 {
     if ((ProcessChartMode & ProcessMode.ImageMaps) == ProcessMode.ImageMaps && common.ChartPicture.MapEnabled && (point.ToolTip.Length > 0 || point.Href.Length > 0 || point.MapAreaAttributes.Length > 0))
     {
         int count = common.ChartPicture.MapAreas.Count;
         common.ChartPicture.MapAreas.Insert(insertIndex, point.ReplaceKeywords(point.ToolTip), point.ReplaceKeywords(point.Href), point.ReplaceKeywords(point.MapAreaAttributes), path, !relativePath, graph);
         for (int i = insertIndex; i < common.ChartPicture.MapAreas.Count - count; i++)
         {
             ((IMapAreaAttributes)common.ChartPicture.MapAreas[i]).Tag = ((IMapAreaAttributes)point).Tag;
         }
     }
     if ((ProcessChartMode & ProcessMode.HotRegions) == ProcessMode.HotRegions)
     {
         HotRegion hotRegion = new HotRegion();
         hotRegion.SeriesName          = seriesName;
         hotRegion.PointIndex          = pointIndex;
         hotRegion.Type                = ChartElementType.DataPoint;
         hotRegion.Path                = path;
         hotRegion.BoundingRectangle   = path.GetBounds();
         hotRegion.RelativeCoordinates = relativePath;
         if (point != null && point.IsAttributeSet("OriginalPointIndex"))
         {
             hotRegion.PointIndex = int.Parse(point["OriginalPointIndex"], CultureInfo.InvariantCulture);
         }
         regionList.Add(hotRegion);
     }
 }
示例#3
0
 internal void AddHotRegion(GraphicsPath path, bool relativePath, ChartGraphics graph, ChartElementType type, object selectedObject)
 {
     if ((ProcessChartMode & ProcessMode.HotRegions) == ProcessMode.HotRegions)
     {
         HotRegion hotRegion = new HotRegion();
         hotRegion.SelectedObject      = selectedObject;
         hotRegion.Type                = type;
         hotRegion.Path                = path;
         hotRegion.BoundingRectangle   = path.GetBounds();
         hotRegion.RelativeCoordinates = relativePath;
         regionList.Add(hotRegion);
     }
 }
示例#4
0
 internal void AddHotRegion(ChartGraphics graph, GraphicsPath path, bool relativePath, string toolTip, string hRef, string mapAreaAttributes, object selectedObject, ChartElementType type)
 {
     if ((ProcessChartMode & ProcessMode.ImageMaps) == ProcessMode.ImageMaps && common.ChartPicture.MapEnabled && (toolTip.Length > 0 || hRef.Length > 0 || mapAreaAttributes.Length > 0))
     {
         common.ChartPicture.MapAreas.Insert(0, toolTip, hRef, mapAreaAttributes, path, !relativePath, graph);
     }
     if ((ProcessChartMode & ProcessMode.HotRegions) == ProcessMode.HotRegions)
     {
         HotRegion hotRegion = new HotRegion();
         hotRegion.Type                = type;
         hotRegion.Path                = path;
         hotRegion.SelectedObject      = selectedObject;
         hotRegion.BoundingRectangle   = path.GetBounds();
         hotRegion.RelativeCoordinates = relativePath;
         regionList.Add(hotRegion);
     }
 }
示例#5
0
 internal void AddHotRegion(RectangleF rectArea, object selectedObject, ChartElementType type, bool relativeCoordinates, bool insertAtBeginning)
 {
     if ((ProcessChartMode & ProcessMode.HotRegions) == ProcessMode.HotRegions)
     {
         HotRegion hotRegion = new HotRegion();
         hotRegion.BoundingRectangle   = rectArea;
         hotRegion.RelativeCoordinates = relativeCoordinates;
         hotRegion.Type           = type;
         hotRegion.SelectedObject = selectedObject;
         if (insertAtBeginning)
         {
             regionList.Insert(regionList.Count - 1, hotRegion);
         }
         else
         {
             regionList.Add(hotRegion);
         }
     }
 }
示例#6
0
 internal void AddHotRegion(ChartGraphics graph, RectangleF rectArea, string toolTip, string hRef, string mapAreaAttributes, object selectedObject, ChartElementType type, string series)
 {
     if ((ProcessChartMode & ProcessMode.ImageMaps) == ProcessMode.ImageMaps && common.ChartPicture.MapEnabled && (toolTip.Length > 0 || hRef.Length > 0 || mapAreaAttributes.Length > 0))
     {
         common.ChartPicture.MapAreas.Add(toolTip, hRef, mapAreaAttributes, rectArea, ((IMapAreaAttributes)selectedObject).Tag);
     }
     if ((ProcessChartMode & ProcessMode.HotRegions) == ProcessMode.HotRegions)
     {
         HotRegion hotRegion = new HotRegion();
         hotRegion.BoundingRectangle   = rectArea;
         hotRegion.RelativeCoordinates = true;
         hotRegion.Type           = type;
         hotRegion.SelectedObject = selectedObject;
         if (series != null && series != string.Empty)
         {
             hotRegion.SeriesName = series;
         }
         regionList.Add(hotRegion);
     }
 }
示例#7
0
 internal void AddHotRegion(int insertIndex, ChartGraphics graph, RectangleF rectSize, DataPoint point, string seriesName, int pointIndex)
 {
     if ((ProcessChartMode & ProcessMode.ImageMaps) == ProcessMode.ImageMaps && common.ChartPicture.MapEnabled && (point.ToolTip.Length > 0 || point.Href.Length > 0 || point.MapAreaAttributes.Length > 0))
     {
         common.ChartPicture.MapAreas.Insert(0, point.ReplaceKeywords(point.ToolTip), point.ReplaceKeywords(point.Href), point.ReplaceKeywords(point.MapAreaAttributes), rectSize, ((IMapAreaAttributes)point).Tag);
     }
     if ((ProcessChartMode & ProcessMode.HotRegions) == ProcessMode.HotRegions)
     {
         HotRegion hotRegion = new HotRegion();
         hotRegion.BoundingRectangle = rectSize;
         hotRegion.SeriesName        = seriesName;
         hotRegion.PointIndex        = pointIndex;
         hotRegion.Type = ChartElementType.DataPoint;
         hotRegion.RelativeCoordinates = true;
         if (point != null && point.IsAttributeSet("OriginalPointIndex"))
         {
             hotRegion.PointIndex = int.Parse(point["OriginalPointIndex"], CultureInfo.InvariantCulture);
         }
         regionList.Add(hotRegion);
     }
 }
示例#8
0
        private bool IsElementTransparent(HotRegion region)
        {
            bool result = false;

            if (region.Type == ChartElementType.DataPoint)
            {
                if (common != null && common.Chart != null)
                {
                    DataPoint dataPoint = region.SelectedObject as DataPoint;
                    if (region.SeriesName.Length > 0)
                    {
                        dataPoint = common.Chart.Series[region.SeriesName].Points[region.PointIndex];
                    }
                    if (dataPoint != null && dataPoint.Color == Color.Transparent)
                    {
                        result = true;
                    }
                }
            }
            else if (region.SelectedObject is Axis)
            {
                if (((Axis)region.SelectedObject).LineColor == Color.Transparent)
                {
                    result = true;
                }
            }
            else if (region.SelectedObject is ChartArea)
            {
                if (((ChartArea)region.SelectedObject).BackColor == Color.Transparent)
                {
                    result = true;
                }
            }
            else if (region.SelectedObject is Legend)
            {
                if (((Legend)region.SelectedObject).BackColor == Color.Transparent)
                {
                    result = true;
                }
            }
            else if (region.SelectedObject is Grid)
            {
                if (((Grid)region.SelectedObject).LineColor == Color.Transparent)
                {
                    result = true;
                }
            }
            else if (region.SelectedObject is StripLine)
            {
                if (((StripLine)region.SelectedObject).BackColor == Color.Transparent)
                {
                    result = true;
                }
            }
            else if (region.SelectedObject is TickMark)
            {
                if (((TickMark)region.SelectedObject).LineColor == Color.Transparent)
                {
                    result = true;
                }
            }
            else if (region.SelectedObject is Title)
            {
                Title title = (Title)region.SelectedObject;
                if ((title.Text.Length == 0 || title.Color == Color.Transparent) && (title.BackColor == Color.Transparent || title.BackColor.IsEmpty))
                {
                    result = true;
                }
            }
            return(result);
        }