GraphUtility 1.0.3
See the version list below for details.
dotnet add package GraphUtility --version 1.0.3
NuGet\Install-Package GraphUtility -Version 1.0.3
<PackageReference Include="GraphUtility" Version="1.0.3" />
paket add GraphUtility --version 1.0.3
#r "nuget: GraphUtility, 1.0.3"
// Install GraphUtility as a Cake Addin #addin nuget:?package=GraphUtility&version=1.0.3 // Install GraphUtility as a Cake Tool #tool nuget:?package=GraphUtility&version=1.0.3
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms;
namespace GraphUtilityTest { internal partial class GraphUtilityTest : Form { public GraphUtilityTest() { Font = SystemInformation.MenuFont; StartPosition = FormStartPosition.CenterScreen;
var f = new Font("Times New Roman", 12, FontStyle.Italic);
GraphUtility.Graph gu = new GraphUtility.Graph("graph title", f);
MenuStrip menu = new MenuStrip() { Parent = this, };
var toolStripMenuItemTest = new ToolStripMenuItem() { Text = "Test", };
var toolStripMenuItemAddCurve1 = new ToolStripMenuItem() { Text = "AddCurve1", };
menu.Items.Add(toolStripMenuItemTest);
toolStripMenuItemTest.DropDownItems.Add(toolStripMenuItemAddCurve1);
toolStripMenuItemAddCurve1.Click += (sender, e) =>
{
gu.ClearCurve();
gu.SetXAxisTitle("x value");
var s = 2000;
var ppl = GraphUtility.GraphHelper.ToPointPairList(Enumerable.Range(-s, (s * 2) + 1).Select(x => new ZedGraph.PointPair(x, x * 2 - 20)));
gu.AddCurve(ppl, "y=2x-20", Color.Red);
gu.SetYAxisTitle("red");
var ppl2 = GraphUtility.GraphHelper.ToPointPairList(Enumerable.Range(-s, (s * 2) + 1).Select(x => new ZedGraph.PointPair(x, Math.Pow(x, 2) - 4 * x + 1)));
gu.AddCurve2(ppl2, "y=x^2-4x+1", Color.Green);
gu.SetY2AxisTitle("green");
gu.SetXAxisType(ZedGraph.AxisType.Linear);
gu.SetXAxisScaleFormat("0");
gu.SetXAxisMajorStep(-1);
gu.RefreshGraph();
gu.ResetPointValueMode(GraphUtility.Graph.PointValueMode.Normal);
};
var toolStripMenuItemAddBar1 = new ToolStripMenuItem() { Text = "AddBar1", };
toolStripMenuItemTest.DropDownItems.Add(toolStripMenuItemAddBar1);
toolStripMenuItemAddBar1.Click += (sender, e) =>
{
gu.ClearCurve();
#if false /** 積み上げ棒グラフ */ gu.ReSetBarGraphType(ZedGraph.BarType.Stack); #else gu.ReSetBarGraphType(ZedGraph.BarType.Cluster); #endif
var ppl = GraphUtility.GraphHelper.ToPointPairList();
var ppl2 = GraphUtility.GraphHelper.ToPointPairList();
foreach (var d in Enumerable.Range(-10, 21))
{
ppl.Add(GraphUtility.GraphHelper.ToPointPair(DateTime.Today.AddDays(d), d * 4));
ppl2.Add(GraphUtility.GraphHelper.ToPointPair(DateTime.Today.AddDays(d), d * 4 + d));
}
gu.AddBar(ppl, "date", Color.Red);
gu.AddBar(ppl2, "date2", Color.Blue);
#if false /** x軸ラベルを直接指定する場合 */ gu.SetXAxisType(ZedGraph.AxisType.Text, 0, Enumerable.Range(0, 21).Select(x ⇒ string.Format("{0}?", x))); gu.SetXAxisMajorStep(-1); #else gu.SetXAxisType(ZedGraph.AxisType.Date, 45); gu.SetXAxisScaleFormat("yyyy/MM/dd"); gu.SetXAxisMajorStep(7); gu.ResetPointValueMode(GraphUtility.Graph.PointValueMode.DateTime);
#endif gu.RefreshGraph();
};
var graph = gu.MainGraph;
Controls.Add(graph);
Controls.Add(menu);
SizeChanged += (sender, e) =>
{
graph.Height = ClientSize.Height - menu.Height;
};
ClientSize = new Size(800, 600);
return;
}
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net452 is compatible. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- ZedGraph (>= 5.1.7)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.