2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
In XlsIO you can create multiple charts and set the chart position. The IChartShape interface has four properties "TopRow", "BottomRow","LeftColumn, "RighColumn". You should set all the four positions to display the chart. By using Category Labels property you can display the serie names. C# IChart Chart1 = sheet.Charts.Add(); Chart1.ChartType = ExcelChartType.Bar_Clustered; Chart1.IsSeriesInRows = false; Chart1.DataRange = sheet.Range["B2:B12"]; Chart1.HasLegend = false; IChartSerie serieOne = Chart1.Series[0]; serieOne.Name = "Austin"; //Category Labels serieOne.CategoryLabels = sheet.Range["A3:A12"]; //Position IChartShape shape1 = Chart1 as IChartShape; shape1.TopRow = 13; shape1.LeftColumn = 2; shape1.RightColumn = 14; shape1.BottomRow = 35;
VB Dim Chart1 As IChart = sheet.Charts.Add() Chart1.ChartType = ExcelChartType.Bar_Clustered Chart1.IsSeriesInRows = False Chart1.DataRange = sheet.Range("B2:B12") Chart1.HasLegend = False Dim serieOne As IChartSerie = Chart1.Series(0) serieOne.Name = "Austin" ''Category Labels serieOne.CategoryLabels = sheet.Range("A3:A12") Dim shape1 As IChartShape = TryCast(Chart1, IChartShape) shape1.TopRow = 13 shape1.LeftColumn = 2 shape1.RightColumn = 14 shape1.BottomRow = 35
Here is the sample for your reference:
|
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.