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


C# GraphPane.AddYAxis方法代码示例

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


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

示例1: readData


//.........这里部分代码省略.........
                                    com = con.CreateCommand();
                                    //com.CommandText = String.Format("Select kks_id_signal,time_page,data from {0} where time_page in ({2}) and kks_id_signal in ({1})", table, kksQ, timesQ);
                                    //com.CommandText = String.Format("Select kks_id_signal,time_page,data from {0} where time_page={2} and kks_id_signal = '{1}'", table, kks, valT);
                                    if (!epa.UseNumSignals) {
                                        com.CommandText = String.Format("Select kks_id_signal,time_page,data from {0} where time_page in ({2}) and kks_id_signal in ({1})", table, kksQ, timesQ);
                                    }
                                    else {
                                        com.CommandText = String.Format("Select kks_id_signal,time_page,data from {0} where time_page in ({2}) and num_sign in ({1})", table, numQ, timesQ);
                                    }

                                    Status.Text += "---|";
                                    reader = com.ExecuteReader();
                                    while (reader.Read()) {
                                        try {
                                            int timeRes = reader.GetInt32(1);
                                            string kksAsu = reader.GetString(0);
                                            double val = reader.GetFloat(2);

                                            long resultTime = timesDict[timeRes];
                                            Data[resultTime][kksAsu] = val;
                                        }
                                        catch (Exception e) {Logger.Info(e.ToString()); }
                                    }
                                    reader.Close();
                                }
                                catch (Exception e) {Logger.Info(e.ToString()); }
                            }
                        }
                    }
                    catch (Exception e) { Logger.Info(e.ToString()); }
                }
            }
            con.Close();

            Status.Text = "Чтение завершено";
            List<string> thAsuList = new List<string>();
            List<string> thTechList = new List<string>();

            foreach (SignalInfo si in epa.SelectedAnalogSignals) {
                thAsuList.Add(String.Format("<th>{0}</th>", si.ShortName));
                try {
                    string kksTech = epa.ASUTechDict[si.KKS];
                    SignalInfo tech = epa.FindSignal(epa.TechRoot, kksTech, null);
                    thTechList.Add(String.Format("<th>{0}</th>", tech.ShortName));
                }
                catch {
                    thTechList.Add("<th>-</th>");
                }
            }
            OutputData.writeToOutput(fn, String.Format("<table border='1'><tr><th rowspan='2'>Дата</th>{0}</tr><tr>{1}</tr>",string.Join(" ",thAsuList),string.Join(" ",thTechList)));
            foreach (int tm in Data.Keys) {
                OutputData.writeToOutput(fn, String.Format("<tr><th>{0}</th><td>{1}</td></tr>", EPADB.GetDate(tm), String.Join("</td><td>", Data[tm].Values)));
            }
            OutputData.writeToOutput(fn,"</table>");

            graph.CurveList.Clear();
            graph.XAxis.Scale.Min = Data.Keys.First();
            graph.XAxis.Scale.Max = Data.Keys.Last();
            graph.XAxis.Scale.MinAuto = false;
            graph.XAxis.Scale.MaxAuto = false;
            graph.XAxis.Title.IsVisible = false;
            graph.YAxis.IsVisible = false;
            graph.YAxis.Title.IsVisible = false;
            graph.Legend.FontSpec.Size = 6;
            graph.Legend.Location.X = 0;
            graph.Legend.Location.Y = 0;
            graph.Title.IsVisible = false;
            graph.YAxis.Scale.FontSpec.Size = 6;
            graph.YAxis.IsVisible = false;
            graph.XAxis.Scale.FontSpec.Size = 6;
            int index = 0;
            foreach (SignalInfo si in epa.SelectedAnalogSignals) {
                try {
                    string name = si.ShortName;
                        int axInd=graph.AddYAxis("");
                        graph.YAxisList[axInd].Color = Colors[index % 8];
                        graph.YAxisList[axInd].Scale.FontSpec.Size = 6;
                        graph.YAxisList[axInd].Scale.FontSpec.FontColor = Colors[index % 8];

                    try {
                        string kksTech = epa.ASUTechDict[si.KKS];
                        SignalInfo tech = epa.FindSignal(epa.TechRoot, kksTech, null);
                        name = name + " (" + tech.ShortName + ")";
                    }
                    catch { }
                    PointPairList list = new PointPairList();
                    foreach (int tm in Data.Keys) {
                        list.Add(new PointPair(tm, Data[tm][si.KKS]));
                    }
                    graph.AddCurve(name, list, Colors[index % 8], SymbolType.None);
                    graph.CurveList[index].YAxisIndex = axInd;

                }
                catch (Exception e) {
                    Logger.Info(e.ToString());
                }
                graph.AxisChange();
                index++;
            }
        }
开发者ID:rj128x,项目名称:EPADB,代码行数:101,代码来源:EpaAnalogData.cs

示例2: Form1_Load


//.........这里部分代码省略.........
            PointPairList list = new PointPairList();
            PointPairList list2 = new PointPairList();

            for ( int i=0; i<100; i++ )
            {
                double x = (double) i;
                double y = Math.Sin( i / 8.0 ) * 100000 + 150000;
                double y2 = Math.Sin( i / 3.0 ) * 300 - 400;
                list.Add( x, y );
                list2.Add( x, y2 );
                //double z = Math.Abs( Math.Cos( i / 8.0 ) ) * y;
            }

            LineItem myCurve = myPane.AddCurve( "curve", list, Color.Blue, SymbolType.Diamond );
            LineItem myCurve2 = myPane.AddCurve( "curve2", list2, Color.Red, SymbolType.Diamond );
            myCurve2.IsY2Axis = true;

            myPane.Y2Axis.IsVisible = true;

            AlignYZeroLines( myPane, 12 );
            myPane.YAxis.IsMinorOppositeTic = false;
            myPane.Y2Axis.IsMinorOppositeTic = false;

            trackBar1.Minimum = 0;
            trackBar1.Maximum = 100;
            trackBar1.Value = 50;

            #endif

            #if false	// Basic curve test - Multi-Y axes

            myPane = new GraphPane( new RectangleF( 0, 0, 640, 480 ), "Title", "XAxis", "YAxis" );

            myPane.AddYAxis( "Another Y Axis" );
            myPane.AddY2Axis( "Another Y2 Axis" );
            myPane.Y2Axis.Title.Text = "My Y2 Axis";
            myPane.Y2AxisList[0].IsVisible = true;
            myPane.Y2AxisList[1].IsVisible = true;

            PointPairList list = new PointPairList();

            for ( int i=0; i<100; i++ )
            {
                //double x = (double) i;
                double x = new XDate( 2001, 1, i*3 );
                double y = Math.Sin( i / 8.0 ) * 100000 + 100001;
                list.Add( x, y );
                double z = Math.Abs( Math.Cos( i / 8.0 ) ) * y;
            }

            LineItem myCurve = myPane.AddCurve( "curve", list, Color.Blue, SymbolType.Diamond );

            myCurve.YAxisIndex = 1;

            myPane.XAxis.IsSkipLastLabel = false;
            myPane.XAxis.Type = AxisType.DateAsOrdinal;
            myPane.AxisChange( this.CreateGraphics() );

            trackBar1.Minimum = 0;
            trackBar1.Maximum = 100;
            trackBar1.Value = 50;

            #endif

            #if false	// Basic curve test - Date Axis w/ Time Span
开发者ID:Jungwon,项目名称:ZedGraph,代码行数:66,代码来源:Form1.cs


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