Solved

asp ajaxtoolkit barchart not filling

Posted on 2013-06-21
3
1,519 Views
Last Modified: 2013-06-27
I am trying to get a bar chart to load from a database.  i need to create the side chart whihc shows the total number of personnel to check in.  then I need to create 3 columns, one for those checked in, checkout and no shows.  I found an article that showed how to do it but not working for me.  it shows no data, but I am putting in a label and they data comes through but does not populate barchart.

 <td>
       <asp:BarChart ID="ChrtInOut" runat="server" ChartHeight="200" ChartWidth="260" ChartType="Column" Visible="false"></asp:BarChart>
</td>

 Private Sub FILLChart()
        sql = "Exec sp_SRPAttendance " & ddlSrpEvent.SelectedValue & ", " & ddlSRPDay.SelectedValue
     
        myDataTable = New DataTable
        myDataTable = getReader(sql)

        lbltest.Text = "Sched = " & myDataTable.Rows(0)(0) & " CheckIn = " & myDataTable.Rows(0)(1) & " No Show = " & myDataTable.Rows(0)(2) & " Completed = " & myDataTable.Rows(0)(3)

        Dim y As Decimal() = New Decimal(Convert.ToInt32(myDataTable.Rows(0)(0))) {}

        ChrtInOut.Series.Add(New AjaxControlToolkit.BarChartSeries() With {.Data = y})
        ChrtInOut.CategoriesAxis = String.Join(",", "Sched")
        ChrtInOut.ChartTitle = "SRP Scheduled"
        ChrtInOut.DataBind()
    End Sub

Open in new window

0
Comment
Question by:kdeutsch
  • 2
3 Comments
 
LVL 23

Expert Comment

by:Roopesh Reddy
ID: 39267442
Hi,

Here is the Bar Chart filling from database example - http://www.aspsnippets.com/Articles/ASPNet-AJAX-Bar-Chart-Control-Populate-from-Database-example.aspx

Cross check what's going wrong!

Hope it helps u...
0
 

Author Comment

by:kdeutsch
ID: 39271462
Hi,

I already tried this site and got errors as well with his example.  With that example it would not bind the y value, it would always show me 0 in the chart.
0
 
LVL 23

Accepted Solution

by:
Roopesh Reddy earned 500 total points
ID: 39272329
Hi,

Oops!!!

Similar question answered in ASP.NET Forums - http://forums.asp.net/t/1897279.aspx/1?Bar+Chart+Ajax+Toolkit

Unfortunately, i personally didn't work with Charts! Let me have a look at it mean while!

Hope it helps u...
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now