Solved pie chart  -> dynamic title from db?

Posted on 2014-03-07
Last Modified: 2014-03-24
Hi  all,

I'm using the below 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" 
                    <asp:Series Name="Series1" ChartType="Pie" Legend="Legend1" XValueMember="name" YValueMembers="percent"></asp:Series>  
                    <asp:ChartArea Name="ChartArea1">
                            IsClustered="false" />
                        <AxisY IsLogarithmic="true" />
                           <asp:Legend Name="Legend1">
                           <asp:Title Name="Title1" Text="Chart Date: X">

Open in new window

Question by:ErinTheCoderGirl
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2

Author Comment

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

Expert Comment

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

Expert Comment

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
Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.


Author Comment

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

Author Comment

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?
LVL 83

Accepted Solution

CodeCruiser earned 500 total points
ID: 39940190

Featured Post

Is Your Team Achieving Their Full Potential?

74% of employees feel they are not achieving their full potential. With Linux Academy, not only will you strengthen your team's core competencies but also their knowledge of of the newest IT topics.

With new material every week, we'll make sure that you stay ahead of the game.

Question has a verified solution.

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

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

729 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