Microsoft
Software
Hardware
Network
Question : ASP.NET ChartControl
Hello,
I have the following ChartControl Markup and Code below and I'm in the need of some help with removing values inside of the PieChart/Doughnut Chart. In other words I have a legend that displays the value but the ChartControl has the labels inside each color which i want to remove since i have a legend showing the user what each color is associated to its value.
<asp:Chart ID="chtCountHearAboutValue
s" runat="server"
OnLoad="chtCountHearAboutV
alues_Load
" Palette="None" Height="461px"
Width="715px"
PaletteCustomColors="Red; 255, 128, 0; Yellow; Lime; Cyan; Blue; Fuchsia"
BackGradientStyle="Diagona
lRight" BackHatchStyle="DashedHori
zontal"
BackImageTransparentColor=
"224, 224, 224">
<Series>
<asp:Series Name="Series1" YValuesPerPoint="4" ChartType="Doughnut"
Font="Microsoft Sans Serif, 8pt" Legend="Legend1">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1" Area3DStyle-Enable3D="true
" Area3DStyle-LightStyle="Si
mplistic">
<Area3DStyle Enable3D="True" IsClustered="True"></Area3
DStyle>
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="Legend1" BackGradientStyle="None" BackHatchStyle="None" Docking="Bottom" Title="How did you hear about PA Cyber?" TitleSeparator="None" ForeColor="#666666" TitleFont="Microsoft Sans Serif, 10pt, style=Bold" Font="Microsoft Sans Serif, 10pt">
</asp:Legend>
</Legends>
</asp:Chart>
protected void chtCountHearAboutValues_Lo
ad(object sender, EventArgs e)
{
SqlConnection conn = new SqlConnection(Configuratio
nManager.C
onnectionS
trings["Ad
missions"]
.Connectio
nString);
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "Admissions_ChartReportCou
ntHearAbou
tValues";
cmd.CommandType = CommandType.StoredProcedur
e;
cmd.Connection = conn;
try
{
conn.Open();
SqlDataReader rdr = cmd.ExecuteReader(CommandB
ehavior.Cl
oseConnect
ion);
chtCountHearAboutValues.Se
ries["Seri
es1"].Poin
ts.DataBin
dXY(rdr, "hear_description", rdr, "total");
// Create a new legend called "Legend1".
chtCountHearAboutValues.Le
gends.Add(
new Legend("Legend1"));
// Set Docking of the Legend chart to the Default Chart Area.
chtCountHearAboutValues.Le
gends["Leg
end1"].Doc
kedToChart
Area = "Default";
// Assign the legend to Series1.
chtCountHearAboutValues.Se
ries["Seri
es1"].Lege
nd = "Legend1";
chtCountHearAboutValues.Se
ries["Seri
es1"].IsVi
sibleInLeg
end = true;
}
catch (Exception ex)
{
ex.Message.ToString();
}
finally
{
conn.Close();
}
}
Answer : ASP.NET ChartControl
I tried to find a solution for you, and if you are still having a problem, I don't believe that I can help you.
Random Solutions
Interpretation of load average vs. CPU utilization
MSSQL proble with insert statement - query will not compile
DFS Namespace Replication Issue
Master Rolesholding DNS
help: how to use dao to update excel file?
I am looking for vmware interview questions..
Update Outlook 2003 profile after mailbox moved from Cross-forest Ex2K3 to Ex2K10
How can I add a route in windows 7 to make my two nics use thier own gateway?
Using a CTE with multiple queries
Itextsharp merge documents in VB.NET