dotnetcharting problems. terrible help files.

Last post 07-04-2009 3:49 PM by mysorian. 3 replies.

Sort Posts:

  • dotnetcharting problems. terrible help files.

    10-06-2007, 1:43 PM
    • Member
      50 point Member
    • Beau_Damore
    • Member since 09-08-2007, 3:15 AM
    • Las Vegas
    • Posts 229

    I am having a hard time with dotnetcharting's stuff... basically, their help is un-followable to me. They show parts of code with no relationships between, part of how a pie chart works if you want it this way... and example aspx pages that do not interlink well... I have been trying to piece together from 3-4 pages, how to build a simple pie chart, based on data from a stored procedure.

    They have a page explaining somewhat, how to connect to a DB, a page with a pie chart,... but their help doesn't make the connection between. So I do not know how to structure a simple DB driven page and show a chart... please help. Here's some code I was trying, maybe someone can make sense of it. I'll paste in two different ways I was trying based on their example aspx pages and help files.

    First way: from their datareader.aspx page example combined with one of their piechart.aspx examples
    ====================
            Chart.Title = "Hours/Department"
            Chart.ChartArea.XAxis.Label.Text = "Customers"
            Chart.TempDirectory = "TempCharts"
            Chart.Series.Name = "Employee Hours"

            Dim myConnection As OleDbConnection
            Dim myCommand As OleDbCommand
            Dim strSQL As String
            Dim connStr As String

            connStr = System.Configuration.ConfigurationManager.ConnectionStrings("ProductionConnectionString").ConnectionString
            connStr = connStr & ";Provider=SQLOLEDB"
            myConnection = New OleDbConnection(connStr)

            strSQL = "GetClosedDepartmentSummary 12347"
            'This number in above SP will be replaced with a control item or querystring value once i get it working right
            myCommand = New OleDbCommand(strSQL, myConnection)
            myConnection.Open()

            Dim myReader As OleDbDataReader = myCommand.ExecuteReader()

            ' set dataReader to data property
            Chart.Series.Data = myReader

            'Cleanup
            myReader.Close()
            myConnection.Close()

            Chart.SeriesCollection.Add()
    ==========================

    SECOND WAY: their 'dataengine' way

             Dim de As New DataEngine()

    Dim connStr as String
    connStr = System.Configuration.ConfigurationManager.ConnectionStrings("ProductionConnectionString").ConnectionString
    connStr = connStr & ";Provider=SQLOLEDB"
                       

    de.ConnectionString = connStr
                  de.StoredProcedure = "GetClosedDepartmentSummary"
                  de.AddParameter("@WorkOrderID", 12347, FieldType.Number)

            'set global properties
                  Chart.Title = "Item sales report"
                 Chart.ChartArea.XAxis.Label.Text = "Customers"
                  Chart.TempDirectory = "TempCharts"
            Chart.Debug = True
           

            'Adding series programatically
                  Chart.Series.Name = "Item sales"
                  Chart.Type = ChartType.Pie 'Horizontal;

                 Dim SC As New SeriesCollection()
                 Dim s As New Series()

                  s.Name = "Series 1"

                  Dim ee As New Element()
                  ee.Name = "Employee"
            e.YValue = -25 + myR.Next(50);
            ee.YValue = myR.Next(50)

                 s.Elements.Add(ee)

                   SC.Add(s)
    =============================??????????????????

     P.S. Are there any other ways to make a simple chart in .NET without going Crystal reports? Or with Crystal reports, but somehow simple? like, no 'viewer' just an image output to include in an aspx page?

    Thanks all. 

    Beau D'Amore
    Consultant
    www.beaudamore.com
    Filed under: ,
  • Re: dotnetcharting problems. terrible help files.

    10-08-2007, 5:43 AM
    • Star
      12,429 point Star
    • ca8msm
    • Member since 11-29-2005, 3:57 PM
    • http://mdssolutions.co.uk
    • Posts 2,152

    Beau_Damore:
    Are there any other ways to make a simple chart in .NET without going Crystal reports?
     

    Yes, have a look at this free control from carlosag.net. You could also draw your own images to create a simple chart.

    Website Design Darlington - http://mdssolutions.co.uk
    http://lessthandot.com - Experts, Information, Ideas & Knowledge
    http://aspnetlibrary.com - An online resource for professional ASP.NET developers


    Please remember to click "Mark as Answer" on this post if it helped you

  • Re: dotnetcharting problems. terrible help files.

    03-21-2008, 4:52 PM
    • Member
      56 point Member
    • florentin
    • Member since 09-25-2006, 10:45 AM
    • Posts 22

    Hi,

    I don't know if you are still looking for a charting control, but I recommend ExpertChart. This is a .NET Chart that is very simple to use. You can take a look at the live demo to see the chart types and sample source code:

    http://www.chartingcontrol.net/WebChartDemo/Default.aspx

    Good luck,

    Florentin

     

  • Re: dotnetcharting problems. terrible help files.

    07-04-2009, 3:49 PM
    • Member
      178 point Member
    • mysorian
    • Member since 11-06-2002, 3:27 PM
    • Plainsboro, NJ 08536
    • Posts 57

    With and for .NET Framework 3.5 Microsoft released the new MS Chart Control. This neither needs Crystal Reports nor SQL Server. But if you have SQL Server you can use the chart to display data from the server. The following three graded articles gives you basic understanding of the Chart control. The articles have both VB as well as C3 codes. You could display data without code using desgin time configuration also. Take a look and rate the articles.


    http://dotnetslackers.com/articles/sql/Importing-MS-Excel-data-to-SQL-Server-2008.aspx

    http://dotnetslackers.com/articles/aspnet/Microsoft-Chart-with-ASP-NET-35-Part1.aspx

    http://dotnetslackers.com/articles/aspnet/Microsoft-Chart-with-ASP-NET-35-Part2.aspx

    A fourth article was added recently ( July 13, 2009)

    http://hodentek.blogspot.com/2009/07/ms-chart-bound-to-dataset.html

    jay
Page 1 of 1 (4 items)