?
Solved

asp.net pie chart  -> dynamic title from db?

Posted on 2014-03-07
6
Medium Priority
?
1,021 Views
Last Modified: 2014-03-24
Hi  all,

I'm using the below asp.net vb.net pie chart code.  It's all fine except for two things:

1. How do i dynamically assign a field from the sql database to the title of the pie chart?  As you can see I have an X where I'd like a field called 'theDate' to be inserted, how do i do that?

2. the BackImage property is a transparent 1x1px gif...  however, when applied to the pie chart as below i only get a solid white background and not transparent as expected - any ideas why?


            <asp:Chart ID="Chart1" runat="server" Width="676px" Height="410px" 
                       BackImage="../img/spacer_clear.gif" BackImageTransparentColor="White" 
                       DataSourceID="srcWBUsage_ByDate">
                <series>
                    <asp:Series Name="Series1" ChartType="Pie" Legend="Legend1" XValueMember="name" YValueMembers="percent"></asp:Series>  
                </series>
                <chartareas>
                    <asp:ChartArea Name="ChartArea1">
                        <Area3DStyle
                            rotation="10"
                            Perspective="10"
                            Enable3D="true"
                            Inclination="15"
                            IsRightAngleAxes="false"
                            WallWidth="0"
                            IsClustered="false" />
                        <AxisY IsLogarithmic="true" />
                    </asp:ChartArea>
                </chartareas>
                       <Legends>
                           <asp:Legend Name="Legend1">
                           </asp:Legend>
                       </Legends>
                       <Titles>
                           <asp:Title Name="Title1" Text="Chart Date: X">
                           </asp:Title>
                       </Titles>
            </asp:Chart>  

Open in new window


Thanks,
0
Comment
Question by:ErinTheCoderGirl
  • 3
  • 2
6 Comments
 

Author Comment

by:ErinTheCoderGirl
ID: 39914324
Any ideas in how I can assign a chart title from the database?
0
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 39914368
Hi,
which .Net Framework version?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39914523
You can write code in code behind to get the field from DB and then use something like

Chart1.Titles(0).Text = Field
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:ErinTheCoderGirl
ID: 39915175
Hi, I'm using version 4.
0
 

Author Comment

by:ErinTheCoderGirl
ID: 39915555
Codecruiser - I'm not able to just implement that vague answer, do you have a link to an article I can reference and learn from?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 39940190
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

807 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