Solved

asp ajaxtoolkit barchart not filling

Posted on 2013-06-21
3
1,536 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

919 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

14 Experts available now in Live!

Get 1:1 Help Now