Medsphere chart widget: how to display a simple chart?
i've found this开发者_JAVA百科 interesting widget and in particular i'm interested in display chart. The problem is i can't find how to. Does anyone know this widget and know how to show a simple chart, and finally, post an example here ?
Thanks!
Check out the graph demo here. In particular, most of the time you instantiate a Graph2D
object, add the necessary X and Y axes (usually LinearAxis
which implements IAxis
) and then add whatever IPlot
instances you want to be shown on the graph (e.g. a LinePlot
or HistogramPlot
)
You can look at the AddRandomLinePlot method in that demo to see that in action.
all I assume that you have aready download Medsphere.Widgets,and build successfully and get Medsphere.Widgets.dll.
First ,you should create a new GTK# project. Secondly, add the GraphDemo.cs which is in the Demo files into your solution. And modify the GraphDemo's constructor: modify" public GraphDemo ():base("Graph Demo")"into " public GraphDemo (Mainwindow window):base("Graph Demo")". Thirdly,edit your Main(string[] args) like this:
public static viod Main()
{
Application.Init();
MainWindow testWindow=new MainWindow();
GraphDemo testGD=new GraphDemo(testWindow);//this is key.
testWindow.ShowAll();
Application.Run();
}
fellow these steps, you can get the beautiful chart.
Hope this can help you,look forward to receive your feeback.
yours, Demi
精彩评论