.NET Framework Bookmark and Share   
 index > Chart Controls for .NET Framework > How can I change the fonts of Legend on pie chart?
 

How can I change the fonts of Legend on pie chart?

I create a pie chart from reading an excel file. There are percentage on circle chart area,but the same percentage character showed on legend. Some codes as below. How can I fill the label of legend with the other data (title_label) ?


=====================================================
String strCon = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source=d:\\wwwroot_adams_test\\db\\2009.xls; Extended Properties=\"Excel 8.0; HDR=NO\"";
OleDbConnection objConn = new OleDbConnection(strCon);
string strCom = " SELECT * FROM [job$] ";
objConn.Open();

OleDbDataAdapter objCmd = new OleDbDataAdapter(strCom, objConn);
DataSet objDS = new DataSet();
objCmd.Fill(objDS);
objConn.Close();

string data, title_label;
for (int i = 0; i < objDS.Tables[0].Columns.Count-1; i++ )
{
data = objDS.Tables[0].Rows[54][i].ToString();
title_label = objDS.Tables[0].Rows[1][i].ToString();
Chart2.Series["Series1"].Points.Add(Convert.ToDouble(data));

}
======================================================

kerokero9921
	Chart2.Series["Series1"].Points[i].LegendText = title_label; //after you've added the point to the series
  • Marked As Answer bykerokero9921 Tuesday, September 22, 2009 9:56 AM
  •  
sipla
	Chart2.Series["Series1"].Points[i].LegendText = title_label; //after you've added the point to the series
  • Marked As Answer bykerokero9921 Tuesday, September 22, 2009 9:56 AM
  •  
sipla

You can use google to search for other answers

Custom Search

More Threads

• Deploying charts with older Framework versions
• Can I use the Chart Control & Samples With VB.net Express?
• How to fix margin and padding of chart when dinamic resize occurs
• asp.net Chart Controls on a user control in MVC
• MS Chart disappears after print
• The RPC server is unavailable. (Exception from HRESULT: 0x800706BA) Word interop on RE-open
• .Net chart change y-axis label from milliseconds to seconds
• How to get/track Browser's refresh button click event?
• stock Intraday chart on multiple day
• Avoid flickering