Why Generate Excel Chart?
In Microsoft Excel, we can generate different charts based on our data information. These excel charts can easily relay your messages that may otherwise go unnoticed by your audience. Most excel charts can help international audiences to understand because they are universally known and easily explained. On the other hand, it’s very easy to generate excel charts.
How to Use .NET to Generate Excel Chart?
With Microsoft Excel, users can generate Excel charts including Pie Chart, Column Chart, Bar Chart, Line Chart, Radar Chart, etc. And with Spire.XLS for .NET, users can use .NET generate those charts either. Spire.XLS for .NET is .NET Excel component which enables your .NET applications to fast generate, read, write and modify Excel document without Microsoft Office Excel Automation.
Suppose we are generating an excel pie chart. Spire.XLS presents you an easy way to create a pie chart in the Excel workbook. First, you should create a pie chart with the sheet.Charts.Add method. You may control the resource of the data and title of the chart by setting DataRange and ChartTitle properties. What's more, we create an object to operate more about the chart. You may set the label and value of the pie with the properties cs.CategoryLabels and cs.Values. If you want to hide the value of the pie, you may set the cs.DataPoints.DefaultDataPoint.DataLabels.HasValue property false. In this demo, in order to reflect the effect of the chart, we set the grid lines of the worksheet invisible by assigning the sheet.GridLinesVisible false.
After running the demo, you may find a pie appear in the document:
Spire.XLS allows users use .NET generate excel charts including Pie Chart, Column Chart, bar chart, line chart, radar chart, Cone chart, Cylinder chart, Doughnut chart, pyramid chart, scatter chart, stock chart and surface chart.
Spire.XLS use .NET Generate Bar Chart:
Spire.XLS use .NET Generate Column Chart:
Spire.XLS use .NET Generate Line Chart:
Spire.XLS use .NET Generate Radar Chart: