C# + Chart Control - Server.HTMLDECODE Label

I have a simple Bar graph that is populated from database, the labels on the X Axis i want to use Server.HTMLDECODE so they display correctly, how can I do this ?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Robert SchuttSoftware EngineerCommented:
Maybe using the DataBound event. Here's an example page:
<%@ Page Language="C#" AutoEventWireup="true" Inherits="EE_Q_28630178_WEB.Default" %>

<%@ Register Assembly="System.Web.DataVisualization, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %>

<script runat="server">

        protected void Page_Load(object sender, EventArgs e) {
            System.Data.DataTable dt = new System.Data.DataTable();
            dt.Columns.AddRange(new System.Data.DataColumn[] { new System.Data.DataColumn("name", typeof(string)), new System.Data.DataColumn("count", typeof(int)) });
            dt.Rows.Add(new object[] { "Peter", 123 });
            dt.Rows.Add(new object[] { "Paul", 456 });
            dt.Rows.Add(new object[] { "M&aacute;ry", 789 });
            Chart1.DataSource = dt;
            Chart1.Series[0].XValueMember = "name";
            Chart1.Series[0].YValueMembers = "count";

        protected void Chart1_DataBound(object sender, EventArgs e) {
            Chart c1 = (Chart)sender;
            for (int s = 0; s < c1.Series.Count; s++) {
                for (int i = 0; i < c1.Series[s].Points.Count; i++) {
                    c1.Series[s].Points[i].AxisLabel = Server.HtmlDecode(c1.Series[s].Points[i].AxisLabel);


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <title> EE Q_28630178 </title>
    <form id="form1" runat="server">
        <asp:Chart ID="Chart1" runat="server" ImageStorageMode="UseImageLocation" OnDataBound="Chart1_DataBound">
                <asp:Series Name="Series1">
                <asp:ChartArea Name="ChartArea1">

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dkilbyAuthor Commented:
Worked perfect - thank you
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.