Member Avatar

Hi, How can i draw a horizontal line in my chart? Currently my chart look like below: ![chart11](/attachments/large/3/chart11.JPG "chart11") Before this i use below code to draw it but when i try to draw with this application (Y axis in datetime), it give me error like 'make sure not dividing by zero' Private Sub Chart1_PostPaint(ByVal sender As Object, ByVal e As ChartPaintEventArgs) Handles Chart1.PostPaint If TypeOf e.ChartElement Is ChartArea Then Dim area As ChartArea = CType(e.ChartElement, ChartArea) Dim x1 As Single = CSng(area.AxisX.ValueToPixelPosition(area.AxisX.Minimum)) Dim x2 As Single = CSng(area.AxisX.ValueToPixelPosition(area.AxisX.Maximum)) Dim y As Single = CSng(area.AxisY.ValueToPixelPosition(20)) e.ChartGraphics.Graphics.DrawLine(New Pen(Color.Blue, width:=5), x1, y, …

0
1
Member Avatar

Hi, I have 2 datagridview. 1 to show TANTOU, TOTAL SUM of DURATION and COUNT of event happened. Another 1 is to show TANTOU, AVERAGE of DURATION and COUNT of event happened. I have use LINQ function to get the result. But how can i combine it so that i can show both result in the same datagrid? (means, I just use 1 LINQ function that can display TANTOU, SUM, AVERAGE, and COUNT) here is the code of sum: Dim group As IEnumerable(Of DataRow) = _ From row In Ds.Tables(0).AsEnumerable() _ Group row By TANTOU = row.Field(Of String)("TANTOU") Into grp …

0
2

The End.