Last post Apr 10, 2014 04:17 AM by JPW05
Apr 09, 2014 04:30 PM|JPW05|LINK
Can someone help me with the asp.net chart control. I am trying to create a pie chart that is linked to stored procedure. I want it to show the status of tickets in the helpdesk.
Below is what I've got written so far:
ALTER PROCEDURE [dbo].[sp_HelpdeskOpenTickets]
-- Add the parameters for the stored procedure here
SET NOCOUNT ON;
SELECT DISTINCT DBO.tblhelpdesk_Tickets.TicketNumber,DBO.tblHelpdesk_Statuses.StatusText
FROM DBO.tblhelpdesk_Tickets INNER JOIN
WHERE (DBO.tblHelpdesk_Statuses.StatusText <> N'Closed')
AND (DBO.tblHelpdesk_Tickets.AccountID = @AccountID)
Chart Control (ASP.NET)
<asp:Chart ID="Chart1" runat="server" DataSourceID="SqlDataSource1">
<asp:Series Name="Status" ChartType="Pie" XValueMember="StatusText" YValueMembers="StatusText"></asp:Series>
Many thanks in advance everyone!
Apr 09, 2014 09:10 PM|asif iqbal|LINK
please see the links below.
Apr 10, 2014 12:56 AM|Paul Linton|LINK
Break your problem in half.
1) Get data
You need to produce data that you could create a pie chart from. The size of a 'wedge' of a pie chart is determined by a number (and what percentage that number is of the total). The label for a 'wedge' is text. So, you are going to need a query which
produces two columns - one column is the label for the wedge, the other column is the corresponding number. This is not what your current query does. Fire up sql server management studio or linqpad and start experimenting with sql. (Hint, you will need
the 'GROUP BY' clause as part of your SELECT statement) Once you have worked out the SQL then you can wrap it in a SP if you want (a view would work just as well, I imagine).
2) Graph the data
My guess is that there would be an enormous number of samples showing you how to draw a pie chart from suitable data that a simple internet search would reveal.
Apr 10, 2014 04:17 AM|JPW05|LINK
I searched around Google, but couldn't find anything that helped. You've pushed md in the right direction though, thanls!