Page 1 of 1

Chart?

Posted: Sun Oct 01, 2017 11:08 am
by Dummy1912
How can we show our chart with all names and with currency?

not really an idea how to use our chart with sqlite db
Code: Select all
Public Sub GenerateChart()
        Dim CArea As ChartArea = Chart1.ChartAreas(0)
        CArea.BackColor = Color.Azure           '~~> Changing the Back Color of the Chart Area 
        CArea.ShadowColor = Color.Red           '~~> Changing the Shadow Color of the Chart Area 
        CArea.Area3DStyle.Enable3D = True       '~~> Changing the Chart Style to 3D 

        '~~> Formatting X Axis
        'CArea.AxisY.Interval = 0.2
        Chart1.Series("Series1").ChartType = SeriesChartType.Column
        '~~> Setting label's Fore Color
        Chart1.Series("Series1").LabelForeColor = Color.DarkGreen
        CArea.AxisY.LabelStyle.Format = FormatCurrency(0, 2)

        '~~> Display Data Labels
        Chart1.Series("Series1").IsValueShownAsLabel = True
        Chart1.Series("Series1").Font = New System.Drawing.Font("Verdana", 8)
        Chart1.Series("Series1")("LabelStyle") = "Top"

        Dim attributes As String = "Vendors.name,transactions.amount,groups.type"
        Dim fromClause As String = "LEFT JOIN Vendors ON transactions.vendor = Vendors.id LEFT JOIN Groups ON transactions.type = groups.id"

        Dim whereClause As String = "transactions.type ='1' AND transactions.setdate BETWEEN '2017-10-01' AND '2017-10-15'"

        Dim tblFields As SQLiteDataReader = DataBase.executeQuery("SELECT " & attributes & " FROM transactions " & fromClause & " WHERE " & whereClause & ";")

        While tblFields.Read
            '~~> SET DATA SOURCE <~~'
            Chart1.Series("Series1").Points.AddXY(tblFields.GetValue(0), FormatCurrency(tblFields.GetValue(1), 2))
        End While
        tblFields.Close()

    End Sub
https://drive.google.com/open?id=0B37cl ... XRSNTlxMzQ

don't show all names of Vendors.name and don't show my amounts with formatcurrency?
show only vendors.name on the lines where the chart has been paint :( ... why?
how can we draw lines on the chart to show all names?