zedgraphをいうDLLを使いフォームに棒グラフや線グラフを表示したいのですがうまくいきません。VC++のサンプルソースがなかったので、C#のサンプルを元に作ったのですがうまく表示ができませんでした。
どなたかzedgraphの使い方知っているかた、教えてください。
↓が私の書いたソースです。
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
GraphPane myPane = this->zedGraphControl3->GraphPane;
// Set the Titles
myPane.Title->Text = "My Test Graph\n(For CodeProject Sample)";
myPane.XAxis->Title->Text = "My X Axis";
myPane.YAxis->Title->Text = "My Y Axis";
// Make up some data arrays based on the Sine function
PointPairList list1 = gcnew PointPairList();
IPointList^ list;
for ( int i = 0; i < 36; i++ )
{
double x = i * 10.0 + 50.0;
double y = Math::Sin( i * Math::PI / 15.0 ) * 16.0;
list1.Add( x, y );
}
list=list1.Clone();
LineItem curve = myPane.AddCurve("label",list,Color::Red,SymbolType::Circle);
curve.Line->Width = 1.5F;
curve.Symbol->Fill = gcnew Fill( Color::Red );
curve.Symbol->Size = 5;
// Make the XAxis start with the first label at 50
myPane.XAxis->Scale->BaseTic = 50;
// Fill the axis background with a gradient
myPane.Chart->Fill = gcnew Fill( Color::White, Color::SteelBlue, 45.0F );
// Calculate the Axis Scale Ranges
myPane.AxisChange();
Refresh();
}
C++/CLIのサンプル・プロジェクトなら
SourceForge:ZedGraph download の
zedgraph_sample_projects_5.1.2 に含まれてましたけど。
επιστημηさん、ありがとうございます。
サンプルソースのところしか見ておらず、サンプルプロジェクトを
見逃していました。さっそくDLしてみます。
サンプルプロジェクトを参考にして解決することができました。
ありがとうございました。
ツイート | ![]() |