本文整理汇总了C#中ZedGraph.GraphPane.AddStick方法的典型用法代码示例。如果您正苦于以下问题:C# GraphPane.AddStick方法的具体用法?C# GraphPane.AddStick怎么用?C# GraphPane.AddStick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZedGraph.GraphPane
的用法示例。
在下文中一共展示了GraphPane.AddStick方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PlotPrecipHour
/// <summary>
/// Plot the hourly precipitation !!!!
/// </summary>
/// <param name="ts"></param>
/// <param name="myPane"></param>
private void PlotPrecipHour(ITimeSeries ts, GraphPane myPane)
{
DateTime MinDate, MaxDate;
if (ts.Count > 0)
{
TimeSeries ts1 = (TimeSeries)ts.AggregateHourly();
MinDate = ts1.Start;
MaxDate = ts1.End;
//Main creation of curve
double totalDays = (MaxDate.Subtract(MinDate)).TotalDays;
if (totalDays < 2)
{
BarItem myCurve = myPane.AddBar("srážky", ts1, Color.Blue);
myCurve.Bar.Border.Color = Color.Blue;
myCurve.Bar.Border.IsVisible = true;
myCurve.Bar.Fill.Type = FillType.Solid;
myCurve.Bar.Fill.IsScaled = false;
}
else
{
StickItem myCurve = myPane.AddStick("srážky", ts1, Color.Blue);
}
//cumulative precipitation..
if (ts != null)
{
TimeSeries ts2 = (TimeSeries)ts.ShowCumulative();
LineItem myCurve2 = myPane.AddCurve("suma srážek", ts2, Color.Red, SymbolType.None);
myCurve2.IsY2Axis = true;
myPane.AxisChange();
}
}
}
示例2: DrawThumb2
/// <summary>
/// Draws the 'thumb' version of the chart
/// </summary>
/// <param name="ts"></param>
/// <param name="chartType"></param>
/// <param name="file"></param>
private void DrawThumb2(ITimeSeries ts, string chartType, string file)
{
GraphPane myPane = new GraphPane(new RectangleF(0, 0, this.ThumbWidth, this.ThumbHeight),
"", "", "");
if (ts.Count > 0)
{
myPane.XAxis.Scale.Min = XDate.DateTimeToXLDate(ts.Start);
myPane.XAxis.Scale.Max = XDate.DateTimeToXLDate(ts.End);
LineItem myCurve;
StickItem myCurve2;
switch (chartType)
{
case "hla":
myCurve = myPane.AddCurve("", ts, Color.Blue, SymbolType.None);
myCurve.Line.Width = 0;
myCurve.Line.Fill = new Fill(Color.Blue);
break;
case "rad":
myCurve = myPane.AddCurve("", ts, Color.Orange, SymbolType.None);
myCurve.Line.Width = 0;
myCurve.Line.Fill = new Fill(Color.Orange);
break;
case "sra":
myCurve2 = myPane.AddStick("", ts, Color.Blue);
//cumulative precipitation..
ITimeSeries ts2 = ts.ShowCumulative();
myCurve = myPane.AddCurve("", ts2, Color.Red, SymbolType.None);
myCurve.IsY2Axis = true;
break;
case "tep":
myCurve = myPane.AddCurve("", ts, Color.Red, SymbolType.None);
double[] xdata = new double[]{XDate.DateTimeToXLDate(ts.Start),
XDate.DateTimeToXLDate(ts.End)};
double[] ydata = new double[]{0.0, 0.0};
LineItem myCurve3 = myPane.AddCurve("", xdata, ydata, Color.Blue);
break;
default:
myCurve = myPane.AddCurve("", ts, Color.Red, SymbolType.None);
break;
}
myPane.XAxis.IsVisible = false;
myPane.YAxis.IsVisible = false;
myPane.Y2Axis.IsVisible = false;
myPane.XAxis.MajorGrid.IsVisible = false;
myPane.Border.Color = Color.White;
myPane.Legend.IsVisible = false;
myPane.AxisChange();
Bitmap bmp = ExportGraph(myPane);
//string filePath = _dir + "m-" + file;
bmp.Save(file, System.Drawing.Imaging.ImageFormat.Png);
bmp.Dispose();
}
}
示例3: PlotPrecipHour
/// <summary>
/// Plot the hourly precipitation !!!!
/// </summary>
private void PlotPrecipHour(ITimeSeries ts, GraphPane myPane)
{
TimeInterval interval = new TimeInterval(ts.Start, ts.End);
string varName = Resources.precip_label;
//Main creation of curve
if ( interval.Length.TotalDays <= 2 )
{
BarItem myCurve = myPane.AddBar(varName, ts, Color.Blue);
myCurve.Bar.Border.Color = Color.Blue;
myCurve.Bar.Border.IsVisible = true;
myCurve.Bar.Fill.Type = FillType.Solid;
myCurve.Bar.Fill.IsScaled = false;
}
else
{
StickItem myCurve = myPane.AddStick(varName, ts, Color.Blue);
}
//cumulative precipitation..
ITimeSeries ts2 = ts.ShowCumulative();
LineItem myCurve2 = myPane.AddCurve(Resources.precip_sum_label,
ts2, Color.Red, SymbolType.None);
myCurve2.IsY2Axis = true;
myPane.AxisChange();
}
示例4: PlotSnow
/// <summary>
/// Plot the snow !!!!
/// </summary>
/// <param name="ts"></param>
/// <param name="myPane"></param>
private void PlotSnow(ITimeSeries ts, GraphPane myPane)
{
TimeInterval interval = new TimeInterval(ts.Start, ts.End);
//Main creation of curve
if ( interval.Length.TotalDays < 160 )
{
BarItem myCurve = myPane.AddBar("", ts, Color.Blue);
myCurve.Bar.Border.Color = Color.Blue;
myCurve.Bar.Border.IsVisible = true;
myCurve.Bar.Fill.Type = FillType.Solid;
myCurve.Bar.Fill.IsScaled = false;
}
else if (interval.Length.TotalDays < 200)
{
StickItem myCurve = myPane.AddStick("", ts, Color.Blue);
}
else if (interval.Length.TotalDays < 400)
{
BarItem myCurve = myPane.AddBar("", ts, Color.Blue);
myCurve.Bar.Border.Color = Color.Blue;
myCurve.Bar.Border.IsVisible = true;
myCurve.Bar.Fill.Type = FillType.Solid;
myCurve.Bar.Fill.IsScaled = false;
}
else
{
StickItem myCurve = myPane.AddStick("", ts, Color.Blue);
}
//else
//{
// StickItem myCurve = myPane.AddStick("", ts, Color.Blue);
// //LineItem myCurve = myPane.AddCurve("", ts, Color.Blue, SymbolType.None);
// //myCurve.Line.Width = 0F;
// //myCurve.Line.Fill = new Fill(Color.Blue);
//}
}
示例5: Form1_Load
//.........这里部分代码省略.........
}
LineItem myCurve = myPane.AddCurve( "curve", list, Color.Blue, SymbolType.Diamond );
Bitmap bm = new Bitmap( @"c:\windows\winnt256.bmp" );
Image image = Image.FromHbitmap( bm.GetHbitmap() );
myCurve.Line.IsVisible = false;
myCurve.Symbol.Type = SymbolType.Square;
myCurve.Symbol.Size = 16;
myCurve.Symbol.Border.IsVisible = false;
myCurve.Symbol.Fill = new Fill( image, WrapMode.Clamp );
myPane.AxisChange( this.CreateGraphics() );
trackBar1.Minimum = 0;
trackBar1.Maximum = 359;
trackBar1.Value = 0;
#endif
#if false // Stick Item Test
myPane = new GraphPane( new RectangleF( 0, 0, 640, 480 ), "Title", "XAxis", "YAxis" );
PointPairList list = new PointPairList();
for ( int i=0; i<100; i++ )
{
double x = (double) i;
double y = Math.Sin( i / 8.0 );
double z = Math.Abs(Math.Cos( i / 8.0 )) * y;
list.Add( x, y, z );
}
StickItem myCurve = myPane.AddStick( "curve", list, Color.Blue );
myCurve.Line.Width = 2.0f;
myPane.XAxis.IsShowGrid = true;
myPane.XAxis.Max = 100;
myPane.AxisChange( this.CreateGraphics() );
trackBar1.Minimum = 0;
trackBar1.Maximum = 359;
trackBar1.Value = 0;
#endif
#if false // Basic curve test - Dual Y axes
myPane = new GraphPane( new RectangleF( 0, 0, 640, 480 ), "Title", "XAxis", "YAxis" );
myPane.Y2Axis.Title.Text = "My Y2 Axis";
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 );