Solved

asp.net chart, multiple series?

Posted on 2014-03-06
2
1,647 Views
Last Modified: 2014-03-07
Hi all,

I'm trying to setup an asp.net vb chart control to use multiple series.

Here's my code:

    <asp:Chart ID="chtMovies" runat="server" DataSourceID="srcMovies">
            <Series>
                <asp:Series Name="MovieCategorySeries" ChartType="Line"
                                  XValueMember="Category" YValueMembers="Count">
                </asp:Series>
            </Series>
            <ChartAreas>
                <asp:ChartArea Name="MovieChartArea">
                </asp:ChartArea>
            </ChartAreas>
        </asp:Chart>
    
    <asp:SqlDataSource
        id="srcMovies"
        ConnectionString="<%$ ConnectionStrings:Movies %>"
        SelectCommand="CountMoviesInCategory"
        SelectCommandType="StoredProcedure"
        Runat="server" /> 

Open in new window


As you can see i have the one series which pulls two columns from a stored procedure (which only returns two columns)

So how do i go about adding another series?


Thanks,
0
Comment
Question by:ErinTheCoderGirl
2 Comments
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39909014
Change the stored procedure to return the third column and add another one of these

            <Series>
                <asp:Series Name="MovieCategorySeries" ChartType="Line"
                                  XValueMember="Category" YValueMembers="Count">
                </asp:Series>
            </Series>
0
 

Author Closing Comment

by:ErinTheCoderGirl
ID: 39911976
Perfect thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 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

22 Experts available now in Live!

Get 1:1 Help Now