菜鸟学堂
在线运行
源代码
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" type="text/css" href="/try/showrazor.css" /> </head> <body> <span class="marked"> @{ <br> var db = Database.Open("SmallBakery"); <br> var dbdata = db.Query("SELECT Name, Price FROM Product"); <br> var myChart = new Chart(width: 600, height: 400) <br> .AddTitle("Product Sales") <br> .AddSeries(chartType: "Pie",<br> xValue: dbdata, xField: "Name", <br> yValues: dbdata, yFields: "Price") <br> .Write();<br> }<br> </span> </body> </html>
运行结果
在线运行
菜鸟学堂 edu.jb51.net