none
Trend Chart With One week history RRS feed

All replies

  • Hi,

    The following trend chart is okey?

    Imports System.Windows.Forms.DataVisualization.Charting
    
    Public Class Form1
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            Dim x1 As Single = Single.Parse(TextBox1.Text)
            Dim x2 As Single = Single.Parse(TextBox2.Text)
            Dim x3 As Single = Single.Parse(TextBox3.Text)
            Dim x4 As Single = Single.Parse(TextBox4.Text)
            Dim x5 As Single = Single.Parse(TextBox5.Text)
            Dim x6 As Single = Single.Parse(TextBox6.Text)
            Dim x7 As Single = Single.Parse(TextBox7.Text)
            Dim chart = Chart1.ChartAreas(0)
            chart.AxisX.IntervalType = DateTimeIntervalType.Number
            chart.AxisX.LabelStyle.Format = ""
            chart.AxisY.LabelStyle.Format = ""
            chart.AxisY.LabelStyle.IsEndLabelVisible = True
            chart.AxisX.Minimum = 1
            chart.AxisX.Maximum = 7
            chart.AxisY.Minimum = 0
            chart.AxisY.Maximum = 20
            chart.AxisX.Interval = 1
            chart.AxisY.Interval = 5
            Chart1.Series.Add("line1")
            Chart1.Series("line1").ChartType = SeriesChartType.Line
            Chart1.Series("line1").ChartType = SeriesChartType.Spline
            Chart1.Series("line1").Color = Color.Red
            Chart1.Series(0).IsVisibleInLegend = False
            Chart1.Series("line1").Points.AddXY("Su", x1)
            Chart1.Series("line1").Points.AddXY("Mo", x2)
            Chart1.Series("line1").Points.AddXY("Tu", x3)
            Chart1.Series("line1").Points.AddXY("We", x4)
            Chart1.Series("line1").Points.AddXY("Th", x5)
            Chart1.Series("line1").Points.AddXY("Fr", x6)
            Chart1.Series("line1").Points.AddXY("Sa", x7)
        End Sub
    End Class
    

    Best Regards,

    Alex


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, March 11, 2019 2:16 AM