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
How do I reset the name of the "Title" column in Sharepoint after it has been renamed in error.
Segregating Users Within SBS 2008
Where in the page lifecycle are cookies created?
Access SELECT Combo box
Network icon problem in Windows 7
Messages forwarded by Outlook rule go nowhere
Block Applications and Internet on Balckberry 8520 Curve
Excel VBA read an Outlook folder into Excel
Decrease load time of tree in vb.net 2003
A Web part with this ID has already been added to this page