2024年4月1日发(作者:)
WebChart 介绍
ComponentOne WebChart for .NET 是一种强大、通用并且使用方便的图表生成工具。程
序员能使用 WebChart 创建完全面向功能,用户交互式图表。应用其广泛的特性和多样的
图表类型能准确的显示复杂的数据集合并创建用户友好,专业级的图表应用程序。
下面是webChart的一个静态页的简单应用:
首先将WebChart的组件添加到bin文件下,然后打开工具箱,点击右键选择“添加移除项”,
浏览到
文件,左侧工具箱里会出现ChartControl空间,然后拖到页面上即可;
后台程序如下:
using System;
using uration;
using ;
using ;
using ;
using ty;
using ;
using ntrols;
using trols;
using ts;
using ;
using WebChart;
using g;
public partial class _Default :
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
doIt();
}
}
private string[] myColor = new string[]{
"Tomato",//西红柿
"Black",
"Gold",
"Blue",
"Green",
"Orange",
"Pink",//粉红
"Violet",//紫罗兰
"Orchid",//淡紫色
"Lime",//亮绿
"Tan",//茶色
"Red",
"Navy"//橘红
};
private void doIt()
{
//创建折线对象
LineChart myChart = new LineChart();
//为折线填充颜色
= me(myColor[0]);
= me(myColor[0]);
rker = new DiamondLineMarker(8, me(myColor[1]),
me(myColor[5]));
//图例说明
= "折线一";
//添加第一个点,参数一为x座标上的名称,参数二为y座标上的值
(new ChartPoint("1", ("100")));
//添加第二个点
(new ChartPoint("2", ("200")));
(new ChartPoint("3", ("50")));
(new ChartPoint("4", ("20")));
(new ChartPoint("5", ("80")));
//chart为控件ID
(myChart);
Chart();
}
}
发布评论