当前位置: 首页>>代码示例>>C#>>正文


C# ZedGraphControl.Dispose方法代码示例

本文整理汇总了C#中ZedGraph.ZedGraphControl.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# ZedGraphControl.Dispose方法的具体用法?C# ZedGraphControl.Dispose怎么用?C# ZedGraphControl.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ZedGraph.ZedGraphControl的用法示例。


在下文中一共展示了ZedGraphControl.Dispose方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ZedGraphStyle_ZedGraphDrawing

        private void ZedGraphStyle_ZedGraphDrawing(object sender, ZedGraphDrawingEventArgs e)
        {
            ZedGraphControl zedGraph = new ZedGraphControl();
            zedGraph.Size = new Size(100, 100);

            zedGraph.GraphPane.Fill.Type = FillType.None;
            zedGraph.GraphPane.Chart.Fill.Type = FillType.None;

            zedGraph.GraphPane.Border.IsVisible = false;
            zedGraph.GraphPane.Chart.Border.IsVisible = false;
            zedGraph.GraphPane.XAxis.IsVisible = false;
            zedGraph.GraphPane.YAxis.IsVisible = false;
            zedGraph.GraphPane.Legend.IsVisible = false;
            zedGraph.GraphPane.Title.IsVisible = false;

            for (int i = 0; i < SelectedColumns.Count; i++)
            {
                double value = 0;
                if (!double.TryParse(e.Feature.ColumnValues[SelectedColumns[i]], out value))
                {
                    zedGraph.Dispose();
                    return;
                }
                Color color = System.Drawing.Color.FromArgb(pieColors[i].AlphaComponent, pieColors[i].RedComponent, pieColors[i].GreenComponent, pieColors[i].BlueComponent);
                PieItem pieItem = zedGraph.GraphPane.AddPieSlice(value, color, 0.08, "");
                pieItem.LabelDetail.IsVisible = false;
            }
            zedGraph.AxisChange();

            e.Bitmap = zedGraph.GraphPane.GetImage();
            zedGraph.Dispose();
        }
开发者ID:MapSuiteSamples,项目名称:MapSuiteSamples,代码行数:32,代码来源:PieChartDemographicStyleBuilder.cs

示例2: CreateBarChartImageFile


//.........这里部分代码省略.........
                pane.X2Axis.MajorGrid.IsVisible = false;
                pane.X2Axis.MinorGrid.IsVisible = false;
                pane.X2Axis.MajorTic.IsInside = false;
                pane.X2Axis.MajorTic.IsOutside = false;
                pane.X2Axis.MinorTic.IsInside = false;
                pane.X2Axis.MinorTic.IsOutside = false;

                pane.YAxis.MajorGrid.IsVisible = true;
                pane.YAxis.MajorGrid.Color = Color.LightSteelBlue;

                pane.YAxis.MajorTic.IsInside = false;

                pane.YAxis.MinorTic.IsInside = false;
                pane.YAxis.MinorTic.IsOutside = false;

                pane.YAxis.Scale.FontSpec.Family = fontFamily;
                pane.YAxis.Scale.FontSpec.Size = fontSize;

                pane.YAxis.Title.FontSpec.Family = fontFamily;
                pane.YAxis.Title.FontSpec.Size = fontSize;
                pane.YAxis.Title.IsVisible = false;
                pane.YAxis.Title.Text = string.Empty;

                pane.Y2Axis.IsVisible = false;
                pane.Y2Axis.MajorGrid.IsVisible = false;
                pane.Y2Axis.MinorGrid.IsVisible = false;
                pane.Y2Axis.MajorTic.IsInside = false;
                pane.Y2Axis.MajorTic.IsOutside = false;
                pane.Y2Axis.MinorTic.IsInside = false;
                pane.Y2Axis.MinorTic.IsOutside = false;

                int idx = 0;
                string[] labels = new string[ barChartData.Count ];

                PointPairList nPoints = new PointPairList();
                PointPairList pPoints = new PointPairList();
                foreach( KeyValuePair<int, double> yearValue in barChartData )
                {
                    int yr = yearValue.Key % 100;
                    labels[ idx ] = "'" + yr.ToString( "00" );

                    double value = yearValue.Value * 100;
                    if( yearValue.Value >= 0 )
                    {
                        nPoints.Add( yearValue.Key, 0.0 );
                        pPoints.Add( yearValue.Key, value );
                    }
                    else
                    {
                        nPoints.Add( yearValue.Key, value );
                        pPoints.Add( yearValue.Key, 0.0 );
                    }

                    idx++;
                }

                pane.XAxis.Scale.TextLabels = labels;
                pane.XAxis.Type = AxisType.Text;

                //negative values
                BarItem nBar = pane.AddBar( string.Empty, nPoints, Color.Empty );
                nBar.Bar.Fill = new Fill( Color.FromArgb( 227, 99, 52 ), Color.FromArgb( 255, 177, 126 ), Color.FromArgb( 227, 99, 52 ) );

                //positive values
                BarItem pBar = pane.AddBar( string.Empty, pPoints, Color.Empty );
                pBar.Bar.Fill = new Fill( Color.FromArgb( 81, 148, 157 ), Color.FromArgb( 107, 197, 222 ), Color.FromArgb( 81, 148, 157 ) );

                //1 - Update the chart with the series
                chart.AxisChange();

                //2 - Process the value labels for each point
                this.WriteValueLabels( pane, nBar, fontFamily, fontSize, true );
                this.WriteValueLabels( pane, pBar, fontFamily, fontSize, false );

                //3 - Update the chart again
                chart.AxisChange();

                using( Image img = chart.GetImage() )
                {
                    EncoderParameters parms = new EncoderParameters( 1 );
                    EncoderParameter parm = new EncoderParameter( System.Drawing.Imaging.Encoder.Quality, 80L );
                    parms.Param[ 0 ] = parm;

                    ImageCodecInfo jgpEncoder = GetEncoder( ImageFormat.Jpeg );
                    img.Save( completeFileName, jgpEncoder, parms );
                }

                try
                {
                    chart.Dispose();
                    chart = null;
                }
                catch { }

                return true;
            }
            catch { }

            return false;
        }
开发者ID:plamikcho,项目名称:xbrlpoc,代码行数:101,代码来源:ReportBuilder.Charting.cs

示例3: writeResetSummaryXMLFile


//.........这里部分代码省略.........
                f.WriteLine("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
                f.WriteLine("<reset>");
                int styleCt = 0;
                List<string> il = new List<string>();
                foreach (string str2 in this.reportDataHash.Keys)
                {
                    Header1DataClass class2 = (Header1DataClass) this.reportDataHash[str2];
                    f.WriteLine("\t<swVersion name=\"{0}\">", str2);
                    ArrayList list2 = new ArrayList();
                    foreach (string str3 in class2.Header2DataHash.Keys)
                    {
                        list2.Add(str3);
                    }
                    list2.Sort();
                    foreach (string str4 in list2)
                    {
                        plots.PaneTitle = str2 + "\r\n" + str4;
                        plots.CreateCharts();
                        GraphPane myPane = plots.AddPane("TTFF Resets", "Secs");
                        GraphPane pane2 = plots.AddPane("2-D Error", "Meters");
                        GraphPane pane3 = plots.AddPane("Verical Error", "Meters");
                        PerEnvReport report = (PerEnvReport) class2.Header2DataHash[str4];
                        if (this.ReportLayout == ReportLayoutType.GroupBySWVersion)
                        {
                            styleCt++;
                        }
                        else
                        {
                            styleCt = 1;
                        }
                        string item = str4 + styleCt.ToString() + ".jpg";
                        string str6 = "Style" + styleCt.ToString();
                        il.Add(item);
                        f.WriteLine("\t\t<environment name=\"{0}\" plotImage=\"{1}\"  showpicturestyle=\"{2}\">", str4, item, str6);
                        ArrayList list3 = new ArrayList();
                        foreach (string str7 in report.PerSiteData.Keys)
                        {
                            list3.Add(str7);
                        }
                        list3.Sort();
                        int num2 = 0;
                        foreach (string str8 in list3)
                        {
                            ReportElements elements = (ReportElements) report.PerSiteData[str8];
                            f.WriteLine("\t\t\t<site number=\"{0}\">", str8);
                            this.printResetSummary(f, elements.TTFFSamples.Samples, elements.NumberOfMisses, elements.NumberOfSVInFix);
                            this.printSampleData(f, elements.TTFFSamples, this._percentile, this._ttffLimit, Convert.ToDouble(this._timeoutVal), "TTFF", "sec");
                            this.printSampleData(f, elements.Position2DErrorSamples, this._percentile, this._hrErrLimit, -9999.0, "2-D Error", "m");
                            this.printSampleData(f, elements.VerticalErrorSamples, this._percentile, this._hrErrLimit, -9999.0, "Vertical Error", "m");
                            this.printSampleData(f, elements.CNOSamples, this._percentile, "", -9999.0, "CNO", "dbHz");
                            f.WriteLine("\t\t\t</site>");
                            if (rFormat == ReportLayoutType.GroupBySWVersion)
                            {
                                plots.AddCurve(myPane, elements.TTFFSamples, elements.TTFFSamples.Samples, str8);
                                plots.AddCurve(pane2, elements.Position2DErrorSamples, elements.Position2DErrorSamples.Samples, str8);
                                plots.AddCurve(pane3, elements.VerticalErrorSamples, elements.VerticalErrorSamples.Samples, str8);
                            }
                            num2++;
                        }
                        if (rFormat == ReportLayoutType.GroupBySWVersion)
                        {
                            plots.RefreshGraph();
                            plots.SaveGraphToFile(dir, item);
                            plots.PaneTitle = string.Empty;
                        }
                        f.WriteLine("\t\t</environment>");
                        myPane = null;
                        pane2 = null;
                        pane3 = null;
                    }
                    f.WriteLine("\t</swVersion>");
                }
                this.printTestSetup(f);
                if (rFormat == ReportLayoutType.GroupBySWVersion)
                {
                    this.modifyResetReportCSS(dir, styleCt);
                    this.printImageList(f, il);
                }
                f.WriteLine("</reset>");
                f.Close();
                this.reportDataHash.Clear();
                this.perRxSetupData.Clear();
                string outputFile = path.Replace(".xml", ".html");
                this.GenerateHTMLReport(path, outputFile, ConfigurationManager.AppSettings["InstalledDirectory"] + @"\scripts\resetReport.xsl");
                plots.Dispose();
                control.Dispose();
            }
            catch (Exception exception)
            {
                this.perRxSetupData.Clear();
                this.perRxSetupData.Clear();
                plots.Dispose();
                control.Dispose();
                if (f != null)
                {
                    f.Close();
                }
                MessageBox.Show(exception.Message, "Report Generate Error");
            }
        }
开发者ID:facchinm,项目名称:SiRFLive,代码行数:101,代码来源:Report.cs


注:本文中的ZedGraph.ZedGraphControl.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。