本文介绍了如何用3D视图绘制饼图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我有三个文本框; txtDone,txtPending和txtRescheduled包含数据。我想绘制一个饼图,其中包含文本框中的值,任何人都可以帮忙。以下是我到目前为止的代码 私人 Sub btnGetSummary_Click( ByVal sender As System。对象, ByVal e As System.EventArgs)句柄 btnGetSummary.Click Dim data()作为 Double = {Val(txtDone.Text),Val(txtPending.Text),Val(txtReschedule.Text)} Dim labels() As String = { 完成检查, Pending Inspections, 重新安排的检查} Dim c 作为 PieChart = 新 PieChart( 360 , 300 ) c.setPieSize( 180 , 140 , 100 ) c.addTitle(lblHeading.Text) ' 以3D形式绘制饼图 c.set3D() ' 设置饼图数据和饼图标签 c.setData(数据,标签) ' 爆炸第一个扇区(索引= 0) c.setExplode( 0 ) ' 输出图表 pctChartSummary.Image = c.makeWebImage(Chart.PNG) ' 包含图表的工具提示 pctChartSummary.ImageMap = c.getHTMLImageMap( , ,_ title ='{label}:US $ {value} K({percent}%)') 解决方案 {value} K({percent}%)') I have three textboxes; txtDone, txtPending and txtRescheduled with data in them. I'll like to draw a pie chart with the values in the textboxes can anyone help please. Below is the code I have so far Private Sub btnGetSummary_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetSummary.ClickDim data() As Double = {Val(txtDone.Text), Val(txtPending.Text), Val(txtReschedule.Text)} Dim labels() As String = {"Done Inspections", "Pending Inspections", "Rescheduled Inspections"} Dim c As PieChart = New PieChart(360, 300) c.setPieSize(180, 140, 100) c.addTitle(lblHeading.Text) ' Draw the pie in 3D c.set3D() ' Set the pie data and the pie labels c.setData(data, labels) ' Explode the 1st sector (index = 0) c.setExplode(0) ' Output the chart pctChartSummary.Image = c.makeWebImage(Chart.PNG) ' Include tool tip for the chart pctChartSummary.ImageMap = c.getHTMLImageMap("", "", _ "title='{label}: US${value}K ({percent}%)'") 解决方案 {value}K ({percent}%)'") 这篇关于如何用3D视图绘制饼图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-20 10:01