📄 defaultcs.aspx.cs
字号:
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 Telerik.QuickStart;
using Telerik.WebControls;
namespace Telerik.ChartExamplesCS.ImageMaps
{
/// <summary>
/// Summary description for _Default.
/// </summary>
public class DefaultCS: XhtmlPage
{
protected Telerik.WebControls.RadChart RadChart1;
private ChartSeriesItem BubbleItem(double x, double y, double width, double height)
{
ChartSeriesItem item = new ChartSeriesItem();
item.XValue = x;
item.YValue = y;
item.XValue2 = width;
item.YValue2 = height;
return item;
}
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
ChartSeries s = new ChartSeries();
s.Type = ChartSeriesType.Bubble;
s.Items.Add(BubbleItem(-10, -10, 5, 5));
s.Items.Add(BubbleItem(10, -10, 5, 10));
s.Items.Add(BubbleItem(-10, 10, 10, 5));
s.Items.Add(BubbleItem(10, 10, 2, 3));
s.Items.Add(BubbleItem(0, 0, 3, 2));
s.Name = "Series 1";
s.ImageMap.ToolTip = "Bubble series";
s.ImageMap.HRef = "http://www.telerik.com";
s.Items[0].Appearance.MainColor = Color.Red;
s.Items[0].Appearance.FillStyle = FillStyle.Solid;
s.Items[0].ItemMap.HRef = "../../ChartTypes/Spline/DefaultCS.aspx";
s.Items[0].ItemMap.ToolTip = "Links to the Spline chart type description.";
s.Items[1].Appearance.MainColor = Color.Blue;
s.Items[1].Appearance.FillStyle = FillStyle.Solid;
s.Items[1].ItemMap.HRef = "../../ChartTypes/Bubble/DefaultCS.aspx";
s.Items[1].ItemMap.ToolTip = "Links to the Bubble chart type description.";
s.Items[2].Appearance.MainColor = Color.Green;
s.Items[2].Appearance.FillStyle = FillStyle.Solid;
s.Items[2].ItemMap.HRef = "../../ChartTypes/Gantt/DefaultCS.aspx";
s.Items[2].ItemMap.ToolTip = "Links to the Gantt chart type description.";
s.Items[3].Appearance.MainColor = Color.Yellow;
s.Items[3].Appearance.FillStyle = FillStyle.Solid;
s.Items[3].ItemMap.HRef = "../../ChartTypes/Bar/DefaultCS.aspx";
s.Items[3].ItemMap.ToolTip = "Links to the Bars chart type description.";
s.Items[4].Appearance.MainColor = Color.Lime;
s.Items[4].Appearance.FillStyle = FillStyle.Solid;
s.Items[4].ItemMap.HRef = "../../ChartTypes/BarStacked/DefaultCS.aspx";
s.Items[4].ItemMap.ToolTip = "Links to the Stacked Bars type description.";
RadChart1.AddChartSeries(s);
RadChart1.XAxis.AutoScale = false;
RadChart1.XAxis.LayoutStyle = ChartAxisLayoutStyle.Normal;
RadChart1.XAxis.AddRange(-20, 20, 10);
RadChart1.YAxis.AutoScale = false;
RadChart1.YAxis.AddRange(-20, 20, 10);
}
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -