Solved

asp.net chart, multiple series?

Posted on 2014-03-06
2
1,589 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

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…
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…
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 video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

746 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