の結果でパイを移入過去ログのHighCharts、私は(LINQ to SQLは)クエリの結果であるデータとのパイを移入する必要があるクエリ
このコードは
実際 protected void Page_Load(object sender, EventArgs e)
{
//RepeaterVersionsForPie.DataSource = DAaccess.LibDataVersion.LibDataVersion.GetNumberOfCompaniesUsingEachVersions();
//RepeaterVersionsForPie.DataBind();
var test = DAaccess.LibDataVersion.LibDataVersion.GetNumberOfCompaniesUsingEachVersions();
Highcharts chart = new Highcharts("chart")
.InitChart(new Chart { PlotShadow = false })
.SetTitle(new Title { Text = "Browser market shares at a specific website, 2010" })
.SetTooltip(new Tooltip { Formatter = "function() { return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %'; }" })
.SetPlotOptions(new PlotOptions
{
Pie = new PlotOptionsPie
{
AllowPointSelect = true,
Cursor = Cursors.Pointer,
DataLabels = new PlotOptionsPieDataLabels
{
Color = ColorTranslator.FromHtml("#000000"),
ConnectorColor = ColorTranslator.FromHtml("#000000"),
Formatter = "function() { return '<b>'+ this.point.name +'</b>: '+ this.percentage +' %'; }"
},
Point = new PlotOptionsPiePoint
{
Events = new PlotOptionsPiePointEvents
{
Click = "function() { alert (this.category +': '+ this.y); }"
}
}
}
})
.SetSeries(new Series
{
Type = ChartTypes.Pie,
Name = "Browser share",
Data = new Data(new object[]
{
new object[] { "Firefox", 45.0 },
new object[] { "IE", 26.8 },
new DotNet.Highcharts.Options.Point
{
Name = "Chrome",
Y = 12.8,
Sliced = true,
Selected = true
},
new object[] { "Safari", 8.5 },
new object[] { "Opera", 6.2 },
new object[] { "Others", 0.7 }
})
});
ltrChart.Text = chart.ToHtmlString();
}
が、私はこのような何かを挿入できるようにする必要があります...静的Firefoxの、クロム、IE電気ショック療法の代わりに私のデータを挿入するには:
foreach (var item in test)
{
new object[] { item.name, item.count}
}
をしかし、VSは」doesnの私が成功することを許可するh物 あなたの助けを前もっておかげです...
あなたのソリューションは私の問題を解決するように導きます。私は少し修正する必要があり、私はそれを働かせました。助けてくれてありがとう。私はあなたに恩恵を与えるだろうが、私は誰かの質問にそれを設定した。うまくいけば、それは彼らのために働くと彼らは受け入れられたとしてそれをマークします。 – Linger
私は賞金を授与する方法を見ていますが、私は24時間待たなければなりません。 – Linger
私の答えはこちらhttp://stackoverflow.com/questions/10074620/pass-a-list-of-series-to-setseries/10096108#10096108私が指摘したように、私はDotNet.HighChartsプロジェクトに精通していませんが、Lingerのコメントに基づいて、メソッドはオブジェクトの配列の代わりにSeriesの配列として返す必要があります。 –