protected virtual void ProcessChartType3D(bool selection, ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw)
        {
            ArrayList arrayList = null;

            if (area.Area3DStyle.Clustered && this.SideBySideSeries)
            {
                goto IL_0020;
            }
            if (this.Stacked)
            {
                goto IL_0020;
            }
            arrayList = new ArrayList();
            arrayList.Add(seriesToDraw.Name);
            goto IL_0044;
IL_0044:
            ArrayList dataPointDrawingOrder = area.GetDataPointDrawingOrder(arrayList, this, selection, COPCoordinates.X, null, this.yValueIndex, false);

            foreach (object item in dataPointDrawingOrder)
            {
                this.ProcessSinglePoint3D((DataPoint3D)item, selection, graph, common, area);
            }
            this.DrawAccumulated3DLabels(graph, common, area);
            return;

IL_0020:
            arrayList = area.GetSeriesFromChartType(this.Name);
            goto IL_0044;
        }
        protected virtual void ProcessChartType3D(bool selection, ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw)
        {
            ArrayList arrayList = null;

            if ((area.Area3DStyle.Clustered && SideBySideSeries) || Stacked)
            {
                arrayList = area.GetSeriesFromChartType(Name);
            }
            else
            {
                arrayList = new ArrayList();
                arrayList.Add(seriesToDraw.Name);
            }
            foreach (object item in area.GetDataPointDrawingOrder(arrayList, this, selection, COPCoordinates.X, null, yValueIndex, sideBySide: false))
            {
                ProcessSinglePoint3D((DataPoint3D)item, selection, graph, common, area);
            }
            DrawAccumulated3DLabels(graph, common, area);
        }
        private void ProcessChartType3D(bool selection, ChartGraphics graph, CommonElements common, ChartArea area, bool labels, Series seriesToDraw)
        {
            if (labels && !selection)
            {
                return;
            }
            ArrayList arrayList = null;

            arrayList = area.GetClusterSeriesNames(seriesToDraw.Name);
            common.DataManager.GetNumberOfPoints((string[])arrayList.ToArray(typeof(string)));
            ArrayList dataPointDrawingOrder = area.GetDataPointDrawingOrder(arrayList, this, selection, COPCoordinates.X | COPCoordinates.Y, null, 0, sideBySide: false);
            bool      flag = false;

            foreach (DataPoint3D item in dataPointDrawingOrder)
            {
                DataPoint dataPoint = item.dataPoint;
                Series    series    = dataPoint.series;
                currentStackGroup     = GetSeriesStackGroupName(series);
                dataPoint.positionRel = new PointF(float.NaN, float.NaN);
                Axis            axis            = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
                Axis            axis2           = area.GetAxis(AxisName.X, series.XAxisType, series.XSubAxisName);
                BarDrawingStyle barDrawingStyle = ChartGraphics.GetBarDrawingStyle(dataPoint);
                float           num             = 0.5f;
                float           num2            = 0.5f;
                bool            flag2           = true;
                bool            flag3           = false;
                for (int i = 0; i < arrayList.Count; i++)
                {
                    Series series2 = common.DataManager.Series[i];
                    if (flag2 && item.index <= series2.Points.Count && series2.Points[item.index - 1].YValues[0] != 0.0)
                    {
                        flag2 = false;
                        if (series2.Name == series.Name)
                        {
                            num2 = 0f;
                        }
                    }
                    if (series2.Name == series.Name)
                    {
                        flag3 = true;
                    }
                    else if (item.index <= series2.Points.Count && series2.Points[item.index - 1].YValues[0] != 0.0)
                    {
                        flag3 = false;
                    }
                }
                if (flag3)
                {
                    num = 0f;
                }
                if (area.stackGroupNames != null && area.stackGroupNames.Count > 1 && area.Area3DStyle.Clustered)
                {
                    string seriesStackGroupName = GetSeriesStackGroupName(series);
                    bool   flag4 = true;
                    bool   flag5 = false;
                    foreach (string item2 in arrayList)
                    {
                        Series series3 = common.DataManager.Series[item2];
                        if (!(GetSeriesStackGroupName(series3) == seriesStackGroupName))
                        {
                            continue;
                        }
                        if (flag4 && item.index < series3.Points.Count && series3.Points[item.index - 1].YValues[0] != 0.0)
                        {
                            flag4 = false;
                            if (item2 == series.Name)
                            {
                                num2 = 0f;
                            }
                        }
                        if (item2 == series.Name)
                        {
                            flag5 = true;
                        }
                        else if (item.index < series3.Points.Count && series3.Points[item.index - 1].YValues[0] != 0.0)
                        {
                            flag5 = false;
                        }
                    }
                    if (flag5)
                    {
                        num = 0f;
                    }
                }
                double yValue  = GetYValue(common, area, series, item.dataPoint, item.index - 1, 0);
                double yValue2 = yValue - GetYValue(common, area, series, item.dataPoint, item.index - 1, -1);
                yValue  = axis.GetLogValue(yValue);
                yValue2 = axis.GetLogValue(yValue2);
                if (yValue2 > axis.GetViewMaximum())
                {
                    num     = 0.5f;
                    yValue2 = axis.GetViewMaximum();
                }
                else if (yValue2 < axis.GetViewMinimum())
                {
                    num2    = 0.5f;
                    yValue2 = axis.GetViewMinimum();
                }
                if (yValue > axis.GetViewMaximum())
                {
                    num    = 0.5f;
                    yValue = axis.GetViewMaximum();
                }
                else if (yValue < axis.GetViewMinimum())
                {
                    num2   = 0.5f;
                    yValue = axis.GetViewMinimum();
                }
                double     linearPosition  = axis.GetLinearPosition(yValue);
                double     linearPosition2 = axis.GetLinearPosition(yValue2);
                RectangleF empty           = RectangleF.Empty;
                try
                {
                    empty.X     = (float)(item.xPosition - item.width / 2.0);
                    empty.Width = (float)item.width;
                    if (linearPosition2 < linearPosition)
                    {
                        float num3 = num2;
                        num2         = num;
                        num          = num3;
                        empty.Y      = (float)linearPosition2;
                        empty.Height = (float)linearPosition - empty.Y;
                    }
                    else
                    {
                        empty.Y      = (float)linearPosition;
                        empty.Height = (float)linearPosition2 - empty.Y;
                    }
                }
                catch (Exception)
                {
                    continue;
                }
                dataPoint.positionRel = new PointF((float)item.xPosition, empty.Top);
                if (dataPoint.Empty)
                {
                    continue;
                }
                double yValue3 = item.indexedSeries ? ((double)item.index) : dataPoint.XValue;
                yValue3 = axis2.GetLogValue(yValue3);
                if (yValue3 < axis2.GetViewMinimum() || yValue3 > axis2.GetViewMaximum() || (yValue < axis.GetViewMinimum() && yValue2 < axis.GetViewMinimum()) || (yValue > axis.GetViewMaximum() && yValue2 > axis.GetViewMaximum()))
                {
                    continue;
                }
                bool flag6 = false;
                if (empty.Right <= area.PlotAreaPosition.X || empty.X >= area.PlotAreaPosition.Right())
                {
                    continue;
                }
                if (empty.X < area.PlotAreaPosition.X)
                {
                    empty.Width -= area.PlotAreaPosition.X - empty.X;
                    empty.X      = area.PlotAreaPosition.X;
                }
                if (empty.Right > area.PlotAreaPosition.Right())
                {
                    empty.Width -= empty.Right - area.PlotAreaPosition.Right();
                }
                if (empty.Width < 0f)
                {
                    empty.Width = 0f;
                }
                if (empty.Height != 0f && empty.Width != 0f)
                {
                    DrawingOperationTypes drawingOperationTypes = DrawingOperationTypes.DrawElement;
                    if (common.ProcessModeRegions)
                    {
                        drawingOperationTypes |= DrawingOperationTypes.CalcElementPath;
                    }
                    graph.StartHotRegion(dataPoint);
                    GraphicsPath path = graph.Fill3DRectangle(empty, item.zPosition, item.depth, area.matrix3D, area.Area3DStyle.Light, dataPoint.Color, num, num2, dataPoint.BackHatchStyle, dataPoint.BackImage, dataPoint.BackImageMode, dataPoint.BackImageTransparentColor, dataPoint.BackImageAlign, dataPoint.BackGradientType, dataPoint.BackGradientEndColor, dataPoint.BorderColor, dataPoint.BorderWidth, dataPoint.BorderStyle, PenAlignment.Inset, barDrawingStyle, veticalOrientation: true, drawingOperationTypes);
                    graph.StopAnimation();
                    graph.EndHotRegion();
                    if (flag6)
                    {
                        graph.ResetClip();
                    }
                    if (common.ProcessModeRegions && !labels)
                    {
                        common.HotRegionsList.AddHotRegion(path, relativePath: false, graph, dataPoint, series.Name, item.index - 1);
                    }
                    if (dataPoint.ShowLabelAsValue || dataPoint.Label.Length > 0)
                    {
                        flag = true;
                    }
                }
            }
            if (!flag)
            {
                return;
            }
            foreach (DataPoint3D item3 in dataPointDrawingOrder)
            {
                DataPoint dataPoint2 = item3.dataPoint;
                Series    series4    = dataPoint2.series;
                Axis      axis3      = area.GetAxis(AxisName.Y, series4.YAxisType, series4.YSubAxisName);
                Axis      axis4      = area.GetAxis(AxisName.X, series4.XAxisType, series4.XSubAxisName);
                double    num4       = GetYValue(common, area, series4, item3.dataPoint, item3.index - 1, 0);
                if (num4 > axis3.GetViewMaximum())
                {
                    num4 = axis3.GetViewMaximum();
                }
                if (num4 < axis3.GetViewMinimum())
                {
                    num4 = axis3.GetViewMinimum();
                }
                num4 = axis3.GetLogValue(num4);
                double     yPosition = item3.yPosition;
                double     num5      = num4 - axis3.GetLogValue(GetYValue(common, area, series4, item3.dataPoint, item3.index - 1, -1));
                double     height    = item3.height;
                RectangleF empty2    = RectangleF.Empty;
                try
                {
                    empty2.X     = (float)(item3.xPosition - item3.width / 2.0);
                    empty2.Width = (float)item3.width;
                    if (height < yPosition)
                    {
                        empty2.Y      = (float)height;
                        empty2.Height = (float)yPosition - empty2.Y;
                    }
                    else
                    {
                        empty2.Y      = (float)yPosition;
                        empty2.Height = (float)height - empty2.Y;
                    }
                }
                catch (Exception)
                {
                    continue;
                }
                if (!dataPoint2.Empty && !selection)
                {
                    double yValue4 = item3.indexedSeries ? ((double)item3.index) : dataPoint2.XValue;
                    yValue4 = axis4.GetLogValue(yValue4);
                    if (!(yValue4 < axis4.GetViewMinimum()) && !(yValue4 > axis4.GetViewMaximum()) && (!(num4 < axis3.GetViewMinimum()) || !(num5 < axis3.GetViewMinimum())) && (!(num4 > axis3.GetViewMaximum()) || !(num5 > axis3.GetViewMaximum())))
                    {
                        graph.StartAnimation();
                        DrawLabels3D(common, graph, area, item3, item3.index - 1, series4, empty2);
                        graph.StopAnimation();
                    }
                }
            }
        }
Example #4
0
        private void ProcessChartType3D(bool labels, bool selection, ChartGraphics graph, CommonElements common, ChartArea area, Series seriesToDraw)
        {
            if (labels && !selection)
            {
                return;
            }
            SizeF     relativeSize = graph.GetRelativeSize(new SizeF(1.1f, 1.1f));
            ArrayList arrayList    = null;
            bool      flag         = drawSeriesSideBySide;

            if ((area.Area3DStyle.Clustered && SideBySideSeries) || Stacked)
            {
                arrayList = area.GetSeriesFromChartType(Name);
                foreach (string item in arrayList)
                {
                    if (common.DataManager.Series[item].IsAttributeSet("DrawSideBySide"))
                    {
                        string strA = common.DataManager.Series[item]["DrawSideBySide"];
                        if (string.Compare(strA, "False", StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            flag = false;
                        }
                        else if (string.Compare(strA, "True", StringComparison.OrdinalIgnoreCase) == 0)
                        {
                            flag = true;
                        }
                        else if (string.Compare(strA, "Auto", StringComparison.OrdinalIgnoreCase) != 0)
                        {
                            throw new InvalidOperationException(SR.ExceptionAttributeDrawSideBySideInvalid);
                        }
                    }
                }
            }
            else
            {
                arrayList = new ArrayList();
                arrayList.Add(seriesToDraw.Name);
            }
            foreach (DataPoint3D item2 in area.GetDataPointDrawingOrder(arrayList, this, selection, coordinates, null, yValueIndex, flag))
            {
                DataPoint       dataPoint       = item2.dataPoint;
                Series          series          = dataPoint.series;
                BarDrawingStyle barDrawingStyle = ChartGraphics.GetBarDrawingStyle(dataPoint);
                Axis            axis            = area.GetAxis(AxisName.Y, series.YAxisType, series.YSubAxisName);
                Axis            axis2           = area.GetAxis(AxisName.X, series.XAxisType, series.XSubAxisName);
                float           num             = 0f;
                float           num2            = 0f;
                double          yValue          = GetYValue(common, area, series, item2.dataPoint, item2.index - 1, useTwoValues ? 1 : 0);
                yValue = axis.GetLogValue(yValue);
                if (yValue > axis.GetViewMaximum())
                {
                    num    = 0.5f;
                    yValue = axis.GetViewMaximum();
                }
                if (yValue < axis.GetViewMinimum())
                {
                    num    = 0.5f;
                    yValue = axis.GetViewMinimum();
                }
                double num3 = axis.GetLinearPosition(yValue);
                double num4 = 0.0;
                if (useTwoValues)
                {
                    double num5 = axis.GetLogValue(GetYValue(common, area, series, dataPoint, item2.index - 1, 0));
                    if (num5 > axis.GetViewMaximum())
                    {
                        num2 = 0.5f;
                        num5 = axis.GetViewMaximum();
                    }
                    else if (num5 < axis.GetViewMinimum())
                    {
                        num2 = 0.5f;
                        num5 = axis.GetViewMinimum();
                    }
                    num4 = axis.GetLinearPosition(num5);
                }
                else
                {
                    num4 = axis.GetPosition(axis.Crossing);
                }
                if (!flag)
                {
                    item2.xPosition = item2.xCenterVal;
                }
                ShiftedX = item2.xPosition - item2.xCenterVal;
                if (num3 < num4 && num4 - num3 < (double)relativeSize.Height)
                {
                    num3 = num4 - (double)relativeSize.Height;
                }
                if (num3 > num4 && num3 - num4 < (double)relativeSize.Height)
                {
                    num3 = num4 + (double)relativeSize.Height;
                }
                RectangleF empty = RectangleF.Empty;
                try
                {
                    empty.X     = (float)(item2.xPosition - item2.width / 2.0);
                    empty.Width = (float)item2.width;
                    if (num4 < num3)
                    {
                        float num6 = num2;
                        num2         = num;
                        num          = num6;
                        empty.Y      = (float)num4;
                        empty.Height = (float)num3 - empty.Y;
                    }
                    else
                    {
                        empty.Y      = (float)num3;
                        empty.Height = (float)num4 - empty.Y;
                    }
                }
                catch (Exception)
                {
                    continue;
                }
                GraphicsPath graphicsPath = null;
                double       yValue2      = item2.indexedSeries ? ((double)item2.index) : dataPoint.XValue;
                yValue2 = axis2.GetLogValue(yValue2);
                if (yValue2 < axis2.GetViewMinimum() || yValue2 > axis2.GetViewMaximum())
                {
                    continue;
                }
                bool flag2 = false;
                if (empty.Right <= area.PlotAreaPosition.X || empty.X >= area.PlotAreaPosition.Right())
                {
                    continue;
                }
                if (empty.X < area.PlotAreaPosition.X)
                {
                    empty.Width -= area.PlotAreaPosition.X - empty.X;
                    empty.X      = area.PlotAreaPosition.X;
                }
                if (empty.Right > area.PlotAreaPosition.Right())
                {
                    empty.Width -= empty.Right - area.PlotAreaPosition.Right();
                }
                if (empty.Width < 0f)
                {
                    empty.Width = 0f;
                }
                DrawingOperationTypes drawingOperationTypes = DrawingOperationTypes.DrawElement;
                if (common.ProcessModeRegions)
                {
                    drawingOperationTypes |= DrawingOperationTypes.CalcElementPath;
                }
                if (!dataPoint.Empty && empty.Height > 0f && empty.Width > 0f)
                {
                    graph.StartHotRegion(dataPoint);
                    Init3DAnimation(common, empty, item2.zPosition, item2.depth, area.matrix3D, graph, yValue < axis2.Crossing, dataPoint);
                    graph.StartAnimation();
                    graphicsPath = graph.Fill3DRectangle(empty, item2.zPosition, item2.depth, area.matrix3D, area.Area3DStyle.Light, dataPoint.Color, num, num2, dataPoint.BackHatchStyle, dataPoint.BackImage, dataPoint.BackImageMode, dataPoint.BackImageTransparentColor, dataPoint.BackImageAlign, dataPoint.BackGradientType, dataPoint.BackGradientEndColor, dataPoint.BorderColor, dataPoint.BorderWidth, dataPoint.BorderStyle, PenAlignment.Inset, barDrawingStyle, veticalOrientation: true, drawingOperationTypes);
                    graph.StopAnimation();
                    graph.EndHotRegion();
                    if (common.ProcessModeRegions && !labels)
                    {
                        common.HotRegionsList.AddHotRegion(graphicsPath, relativePath: false, graph, dataPoint, series.Name, item2.index - 1);
                    }
                }
                if (flag2)
                {
                    graph.ResetClip();
                }
                ProcessSinglePoint3D(item2, selection, graph, common, area, empty, item2.index - 1);
            }
            DrawAccumulated3DLabels(graph, common, area);
        }