実際、私は自分のデータを表示するためにPieChart
ofを使用しています。
データはバインドされていますが、正しく表示されていません。
同じデータを にバインドすると、完全に表示されますが、 になると、この問題が発生します。データも以下のように表示されます:HighCharts
Tooltips
LineChart
PieChart
Slices
私のコードは次のようになります:
<highchart:PieChart ID="chart1" Width="500" Height="500" runat="server" />
SqlDataAdapter da = new SqlDataAdapter("select * from SURVEY_ORG where USERS<>0", con);
DataSet ds = new DataSet();
da.Fill(ds);
chart1.PlotOptions = new Highchart.Core.PlotOptions.PlotOptionsPie
{
allowPointSelect = true,
cursor = "pointer",
dataLabels = new Highchart.Core.PlotOptions.DataLabels { enabled = true }
};
PointCollection pc = new PointCollection();
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
{
pc.Add(new Point(ds.Tables[0].Rows[i]["ORG_NAME"], Convert.ToInt64(ds.Tables[0].Rows[i]["USERS"])));
}
var series = new Collection<Serie>();
series.Add(new Serie() { data = pc.ToArray() });
chart1.PlotOptions = new Highchart.Core.PlotOptions.PlotOptionsPie
{
allowPointSelect = true,
cursor = "Pointer",
showInLegend = true,
dataLabels = new Highchart.Core.PlotOptions.DataLabels
{
enabled = true
}
};
chart1.Tooltip = new ToolTip { formatter = "function() { return '<b>'+ this.point.name +'</b>: '+ this.percentage.toFixed(2) +' %'; }" };
chart1.Title = new Highchart.Core.Title("Custom Title");
chart1.PlotOptions.shadow = false;
chart1.DataSource = series;
chart1.DataBind()
Legends
の前後に「ORG_NAME」を表示したいslice