///------------显示页面---------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using OWC11;
using OWCTable;
namespace OWCTable
{
/// <summary>
/// Show 的摘要说明。
/// </summary>
public class Show : System.Web.UI.Page
{
// OWC11.ChartSpaceClass oChartSpace = new OWC11.ChartSpaceClass ();
OWC11.ChartSpaceClass oChartSpace = new ChartSpaceClass();
// ————————————————————————
// Give pie and doughnut charts a legend on the bottom. For the rest of
// them let the control figure it out on its own.
// ————————————————————————
// ————————————————————————
// If you’re charting a pie or a variation thereof percentages make a lot
// more sense than values…
// ————————————————————————
if (chartType == ChartChartTypeEnum.chChartTypePie ||
chartType == ChartChartTypeEnum.chChartTypePie3D ||
chartType == ChartChartTypeEnum.chChartTypeDoughnut)
{
oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].HasPercentage = true;
oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].HasValue = false;
}
// ————————————————————————
// Not so for other chart types where values have more meaning than
// percentages.
// ————————————————————————
else
{
oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].HasPercentage = false;
oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].HasValue = true;
}
// ————————————————————————
// Plug your own visual bells and whistles here
// ————————————————————————
oChartSpace.Charts[0].SeriesCollection[0].Caption = String.Empty;
oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].Font.Name = "verdana";
oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].Font.Size = 10;
oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].Font.Bold = true;
oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].Font.Color = "red";
oChartSpace.Charts[0].SeriesCollection[0].DataLabelsCollection[0].Position = ChartDataLabelPositionEnum.chLabelPositionCenter;