MVC ASP.NET プロジェクトを作成しており、Shield UI MVC チャートを使用しています。ダウンロードしたトライアル パッケージへの参照を追加し、オンラインで入手できるサンプル デモ コードを挿入しました: https://demos.shieldui.com/mvc/pie-chart/basic-usage
@(Html.ShieldChart()
.Name("chart")
.Theme(Response.Cookies.Theme())
.Export(false)
.PrimaryHeader(header => header.Text("Browsers Popularity amongst Users"))
.ChartLegend(legend=>legend.Enabled(true))
.SeriesSettings(setting=>setting.Pie(pie=>pie
.EnablePointSelection(true)))
.Tooltip(tooltip=>tooltip.CustomPointText("{point.collectionAlias}: {point.y}"))
.DataSeries(dataSeries => dataSeries.Pie()
.CollectionAlias("Usage")
.Data(new object[]
{
new object[] {"Firefox", 44.2},
new object[] {"IE7", 26.6},
new object[] {"IE6", 20},
new object[] {"Chrome", 3.1},
new object[] {"Other", 5.4}
}))
) ステートメントのみ:
.Theme(Response.Cookies.Theme())
エラーが発生しましたが、最初に開始する必要があるため、行を削除しました。
私は MVC にまったく慣れていないので、次のコード行をどこに配置できるかわかりません。
<head >
<link rel="stylesheet" type="text/css" href="css/shieldchart.css" />
<script src="js/jquery-1.9.1.min.js" type="text/javascript">//</script>
<script src="js/shield-chart.all.min.js" type="text/javascript">//</script>
</head>
適切な場所がどこにもないからです。プロジェクトに Index.cshtml ファイルと About.cshtm ファイルがありますが、行を配置できる要素がありません…</p>