• Top Members
    Reps
    Posts
  • 834 Replies
    2585 Replies
  • 713 Replies
    2021 Replies
  • 331 Replies
    1928 Replies
The site is still being updated (as of 14th Jan 2018 6PM GMT) but can be used in the meantime.

Chart?

Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
User avatar
Dummy1912
VIP - Donator
Posts: 1947

Chart?

Sun Oct 01, 2017 12:08 pm

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?

Post Reply

Return to “Coding Help & Support”