Nevron 的第一个实例

本文介绍如何使用Nevron.NETVisionChart库在Windows Forms应用程序中创建并显示3D饼图。文章提供了从设置许可证到图表样式的完整示例代码,并展示了如何添加交互工具。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

今天建立第一个实例试试

参考此处
http://www.haogongju.net/art/809569

知道序列号可以写在文件中

然后,到 http://helpdotnetvision.nevron.com/

About Nevron .NET Vision
Chart for .NET
About Nevron Chart for .NET
[color=red]Getting Started[/color]
Integrating in Windows Forms
Overview
Integrating in Windows Forms
NChartCommandBarsManager
NChartGridControl
Integrating in Web Forms
Integrating ThinWeb Chart
User's Guide
Diagram for .NET
User Interface for .NET
Framework
这里面,抄一个例子

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Nevron;
using Nevron.Chart;
using Nevron.Chart.WinForm;
using Nevron.GraphicsCore;


namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
NLicense license = new NLicense("******************");//序列号
NLicenseManager.Instance.SetLicense(license);
NLicenseManager.Instance.LockLicense = true;
//Application.EnableVisualStyles();
////Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());


}

private void button1_Click(object sender, EventArgs e)
{
nChartControl1.Controller.Tools.Add(new NSelectorTool());
nChartControl1.Controller.Tools.Add(new NTrackballTool());

NPieChart chart = new NPieChart();
nChartControl1.Charts.Clear();
nChartControl1.Charts.Add(chart);
chart.Enable3D = true;
chart.Width = 70;
chart.Depth = 10;
chart.Projection.SetPredefinedProjection(PredefinedProjection.PerspectiveElevated);
chart.LightModel.SetPredefinedLightModel(PredefinedLightModel.ShinyCameraLight);

NPieSeries pie = (NPieSeries)chart.Series.Add(SeriesType.Pie);
pie.PieStyle = PieStyle.SmoothEdgePie;
pie.LabelMode = PieLabelMode.SpiderNoOverlap;

pie.AddDataPoint(new NDataPoint(12, "Cars"));
pie.AddDataPoint(new NDataPoint(42, "Trains"));
pie.AddDataPoint(new NDataPoint(56, "Airplanes"));
pie.AddDataPoint(new NDataPoint(23, "Buses"));
pie.AddDataPoint(new NDataPoint(32, "Bikes"));
pie.AddDataPoint(new NDataPoint(29, "Boats"));

NStyleSheet styleSheet = NStyleSheet.CreatePredefinedStyleSheet(PredefinedStyleSheet.NevronMultiColor);
styleSheet.Apply(nChartControl1.Document);

nChartControl1.Refresh();
}
}
}



可以看到下图
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值