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 to determine if a given device is on a USB port
SQL Insert trigger if one field is changed
How do I calculate the slope of a line?
Powershell Syntax for Exchange 2007
Access 03 using Windows 7
Write in file
Switch between HTTP and HTTPS pages using vb.net
What CSS Do I Need To Keep a Table TD Selector From Overriding TDs in Nested Tables?
Internet Explorer Maintenance GPO issue
Windows Server 2008 R2 - Easy Print remote desktop