当前位置:网站首页>Vb.net chart1 processing
Vb.net chart1 processing
2022-07-26 21:56:00 【laocooon】
Imports System.Windows.Forms.DataVisualization.Charting
Public Class Form1
Public Class Data
Public Unit type As String
Public Total heat supply As Double
Public On grid power As Double
Sub New(jzbl As String, zgrl As Double, swdl As Double)
Unit type = jzbl
Total heat supply = zgrl
On grid power = swdl
End Sub
End Class
Dim list As List(Of Data) = New List(Of Data)
Private Sub Chart1_Click(sender As Object, e As EventArgs) Handles Chart1.Click
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
' Reference namespace
' Instantiation Thread class
' call start
'
Chart1.ChartAreas.Clear()
Dim ChartAreas1 As New ChartArea("Read length") ' Define a new ChartArea
Chart1.ChartAreas.Add(ChartAreas1) ' The newly defined ChartArea Join in Chart1
Chart1.ChartAreas(0).AxisX.Title = " company " ' Set up ChartArea Inner axis title
Chart1.ChartAreas(0).AxisY.Title = " energy "
Chart1.Series.Clear()
Dim series1 As New Series(" Total heat supply ")
series1.ChartType = SeriesChartType.Column ' Set up Series Type of drawing Column Pie
Chart1.Series.Add(series1)
Dim series2 As New Series(" On grid power ")
series2.ChartType = SeriesChartType.Column ' Set up Series Type of drawing Column Pie
Chart1.Series.Add(series2)
'For i = 0 To list.Count - 1
' Chart1.Series(" Total heat supply ").Points.AddXY(list(i). Unit type , list(i). Total heat supply )
' Chart1.Series(" On grid power ").Points.AddXY(list(i). Unit type , list(i). On grid power )
'Next
For Each data In list
Chart1.Series(" Total heat supply ").Points.AddXY(data. Unit type , data. Total heat supply )
Chart1.Series(" On grid power ").Points.AddXY(data. Unit type , data. On grid power )
Next
Chart1.Legends(0).Docking = Docking.Top ' Adjust the position of the legend
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
list.Add(New Data(" Datang Power generation ", 1603637.05, 1186290.45))
list.Add(New Data(" Guodian power ", 2848337.57, 1785987.19))
list.Add(New Data(" Huaneng International ", 12950880.13, 4379843.99))
list.Add(New Data(" Huadian power international ", 7437217.4, 3078924.09))
list.Add(New Data(" Other power plants ", 3831094.84, 1513056.81))
list.Add(New Data(" Own power plant ", 754594.06, 265813.24))
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Chart1.ChartAreas.Clear()
Dim ChartAreas1 As New ChartArea("Read length") ' Define a new ChartArea
Chart1.ChartAreas.Add(ChartAreas1) ' The newly defined ChartArea Join in Chart1
Chart1.ChartAreas(0).AxisX.Title = " company " ' Set up ChartArea Inner axis title
Chart1.ChartAreas(0).AxisY.Title = " energy "
Chart1.Series.Clear()
Dim series1 As New Series(" Total heat supply ")
series1.ChartType = SeriesChartType.Pie ' Set up Series Type of drawing Column Pie
series1.LegendText = "#PERCENT{P1}" ' Legend percentage
'series1.Label = "#PERCENT{P1}" ' Legend percentage
Chart1.Series.Add(series1)
Dim zggrl As Double
zggrl = 0
For Each data In list
zggrl += data. Total heat supply
Next
For Each data In list
Dim bfb As Double
bfb = data. Total heat supply / zggrl * 100
Dim str_bfb As String
str_bfb = Format(bfb, "#.#").ToString() + "%"
Chart1.Series(" Total heat supply ").Points.AddXY(data. Unit type + " " + str_bfb, data. Total heat supply )
Next
Chart1.Legends(0).Docking = Docking.Top ' Adjust the position of the legend
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
Chart1.ChartAreas.Clear()
Dim ChartAreas1 As New ChartArea("Read length") ' Define a new ChartArea
Chart1.ChartAreas.Add(ChartAreas1) ' The newly defined ChartArea Join in Chart1
Chart1.ChartAreas(0).AxisX.Title = " company " ' Set up ChartArea Inner axis title
Chart1.ChartAreas(0).AxisY.Title = " energy "
Chart1.Series.Clear()
Dim series1 As New Series(" On grid power ")
series1.ChartType = SeriesChartType.Pie ' Set up Series Type of drawing Column Pie
series1.LegendText = "#PERCENT{P2}" ' Legend percentage
'series1.Label = "#PERCENT{P1}" ' Legend percentage
Chart1.Series.Add(series1)
Dim zggrl As Double
zggrl = 0
For Each data In list
zggrl += data. On grid power
Next
For Each data In list
Dim bfb As Double
bfb = data. On grid power / zggrl * 100
Dim str_bfb As String
str_bfb = Format(bfb, "#.##").ToString() + "%"
Chart1.Series(" On grid power ").Points.AddXY(data. Unit type + " " + str_bfb, data. On grid power )
Next
Chart1.Legends(0).Docking = Docking.Top ' Adjust the position of the legend
End Sub
End Class
边栏推荐
- When deploying Flink on a single machine and creating the connection table of oracle19c RAC, the error ora-12505 is reported. Who can help
- 6、 Wechat applet release process
- Content management tools, blue bookmarks are enough
- Japan approves the export of EUV photoresist to South Korea, and the crisis of Samsung and SK Hynix may be alleviated
- A friend with a monthly salary of 50000 told me that you were just doing chores
- 梦里的一碗面
- Isilon's onefs common operation commands (I)
- Search eBay product API by keyword
- Thorough load balancing
- 带你搞懂MySQL隔离级别,两个事务同时操作同一行数据会怎样?
猜你喜欢

A friend with a monthly salary of 50000 told me that you were just doing chores

CMake 的使用

补充—非线性规划

imshow()函数后面如果不加waitKey()函数就不显示

《暑假每日一题》Week 7:7.18 - 7.24

6、 Wechat applet release process

从手动测试,到自动化测试老司机,只用了几个月,我的薪资翻了一倍

Type assertion in typescript

My SQL is OK. Why is it still so slow? MySQL locking rules

If you do not add waitkey() function after imshow() function, it will not be displayed
随机推荐
Make a resizable element
深入源码剖析String类为什么不可变?(还不明白就来打我)
Alkbh1
成功上岸了自动化测试岗,最高月薪15.4K,自己真棒~
Just one dependency to give swagger a new skin, which is simple and cool
基于memcache的缓存机制的6个指令
My SQL is OK. Why is it still so slow? MySQL locking rules
Search Yiwu shopping (PAI Li Tao) API by image
FreeRTOS个人笔记-软件定时器
Shangtang technology releases sensepass pro, an all-in-one face recognition machine
逻辑漏洞----任意账号注册
Shrimp Shope gets the product details API according to the ID
Pbootcms一级栏目下的二级三级栏目高亮
Talk about TCP time_ WAIT
VB.net Chart1的处理
Selenium automated test interview questions family bucket
七月集训(第26天) —— 并查集
三星发布1.08亿像素图像传感器ISOCELL Bright HMX,小米将首发
从手动测试,到自动化测试老司机,只用了几个月,我的薪资翻了一倍
45、实例分割的labelme数据集转coco数据集以及coco数据集转labelme数据集