请问用MSChart怎么显示3D饼状图,在线等

sunnyhe968 2014-04-29 11:03:11
如果有例子更好了,求大师指导!
...全文
470 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
wg5945 2014-04-29
  • 打赏
  • 举报
回复


using System.Web.UI.DataVisualization.Charting;
...

private void Page_Load(object sender, System.EventArgs e)
{
    // Populate series data
    double[]    yValues = {65.62, 75.54, 60.45, 34.73, 85.42};
    string[]    xValues = {"France", "Canada", "Germany", "USA", "Italy"};
    Chart1.Series["Default"].Points.DataBindXY(xValues, yValues);

    // Set Doughnut chart type
    Chart1.Series["Default"].ChartType = SeriesChartType.Doughnut;

    // Set labels style
    Chart1.Series["Default"]["PieLabelStyle"] = "Outside";

    // Set Doughnut radius percentage
    Chart1.Series["Default"]["DoughnutRadius"] = "30";

    // Explode data point with label "Italy"
    Chart1.Series["Default"].Points[4]["Exploded"] = "true";
    
    // Enable 3D
    Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enabled = true; 

    // Disable the Legend
    Chart1.Legends[0].Enabled = false;
}



抄了个,没跑过,你试试~~
by_封爱 2014-04-29
  • 打赏
  • 举报
回复
饼图你会吗?弄个饼图 之后 有一个属性啊...

 Area.Area3DStyle.Enable3D=true;
就行了
sunnyhe968 2014-04-29
  • 打赏
  • 举报
回复
引用 1 楼 wg5945 的回复:
http://www.cnblogs.com/skykang/archive/2011/11/22/2258872.html 里面有,看看呢~~
我也找了这个例子,因为没有完整的例子,我调不通
wg5945 2014-04-29
  • 打赏
  • 举报
回复
sunnyhe968 2014-04-29
  • 打赏
  • 举报
回复
引用 4 楼 wg5945 的回复:


using System.Web.UI.DataVisualization.Charting;
...

private void Page_Load(object sender, System.EventArgs e)
{
    // Populate series data
    double[]    yValues = {65.62, 75.54, 60.45, 34.73, 85.42};
    string[]    xValues = {"France", "Canada", "Germany", "USA", "Italy"};
    Chart1.Series["Default"].Points.DataBindXY(xValues, yValues);

    // Set Doughnut chart type
    Chart1.Series["Default"].ChartType = SeriesChartType.Doughnut;

    // Set labels style
    Chart1.Series["Default"]["PieLabelStyle"] = "Outside";

    // Set Doughnut radius percentage
    Chart1.Series["Default"]["DoughnutRadius"] = "30";

    // Explode data point with label "Italy"
    Chart1.Series["Default"].Points[4]["Exploded"] = "true";
    
    // Enable 3D
    Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enabled = true; 

    // Disable the Legend
    Chart1.Legends[0].Enabled = false;
}



抄了个,没跑过,你试试~~
如果由于Label字太多,必须用线引出来。这个是自动的还是要设置属性啊?

4,818

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧