第一:建立一个项目,添加对WebChart.dll的引用。(如果没有请到网上搜索下载)
第二:把WebChart添加到工具箱里,把WebChart添加到页面,同时在页面上添加两个Button。页面代码如下:
WebPart生成折线图和柱状图body>
WebPart生成折线图和柱状图    
<form id="form1" runat="server">
WebPart生成折线图和柱状图    
<div>
WebPart生成折线图和柱状图        
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
WebPart生成折线图和柱状图        
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Button" />
WebPart生成折线图和柱状图        
<Web:ChartControl ID="ChartControl1" runat="server" BorderStyle="Outset" BorderWidth="5px" Height="328px" Width="700px" YCustomEnd="500" YCustomStart="100">
WebPart生成折线图和柱状图            
<YAxisFont StringFormat="Far,Near,Character,LineLimit" Text="errer" />
WebPart生成折线图和柱状图            
<XTitle StringFormat="Center,Near,Character,LineLimit" Text="erererer" />
WebPart生成折线图和柱状图            
<ChartTitle StringFormat="Center,Near,Character,LineLimit" />
WebPart生成折线图和柱状图            
<XAxisFont StringFormat="Center,Near,Character,LineLimit" />
WebPart生成折线图和柱状图            
<Background Color="LightSteelBlue" />   
WebPart生成折线图和柱状图            
<YTitle StringFormat="Center,Near,Character,LineLimit" />
WebPart生成折线图和柱状图        
</Web:ChartControl></div>
WebPart生成折线图和柱状图    
</form>
WebPart生成折线图和柱状图
</body>

第三:添加WebChart的命名空间:using WebChart;;
第四:在后台添加如下代码:
WebPart生成折线图和柱状图 protected void Button1_Click(object sender, EventArgs e)
    }

运行就OK了。

相关文章:

  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2021-07-12
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2021-11-15
猜你喜欢
  • 2022-01-10
  • 2022-12-23
  • 2021-09-28
  • 2021-12-03
  • 2022-01-03
相关资源
相似解决方案