FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace > TagCloudCellType Class > TagCloudCellType Constructor : TagCloudCellType Constructor() |
'Declaration Public Function New()
'Usage Dim instance As New TagCloudCellType()
public TagCloudCellType()
// Use first tag cloud cell type constructor. FarPoint.Web.Spread.TagCloudCellType tagCell = new FarPoint.Web.Spread.TagCloudCellType(); tagCell.DataSource = GetData();//refer to the data source part. tagCell.DataTextField = "Name"; tagCell.DataWeightField = "Weight"; tagCell.DataTitleField = "University"; tagCell.DataHrefField = "Favorite site"; tagCell.DataTextFormatString = "UserName:{0}"; tagCell.DataTitleFormatString = "Graduate from:[{0}]"; tagCell.DataHrefFormatString = "http://{0}"; tagCell.DataDisplayTextField = "University"; tagCell.DataItemDataField = "Weight"; FpSpread1.ActiveSheetView.Cells[0, 0].CellType = tagCell; // Use second tag cloud cell type constructor. FarPoint.Web.Spread.TagCloudCellType tagCell1 = new FarPoint.Web.Spread.TagCloudCellType(new string[] { "SEARCH", "ASP.NET", "JAVASCRIPT" }, new string[] { "20", "50", "30" }); FpSpread1.ActiveSheetView.Cells[1, 0].CellType = tagCell1; // Use third tag cloud cell type constructor. FarPoint.Web.Spread.TagCloudCellType tagCell2 = new FarPoint.Web.Spread.TagCloudCellType(new string[] { "SEARCH", "ASP.NET", "JAVASCRIPT" }, new string[] { "20", "50", "30" }, new string[] { "http://www.google.com", "http://gcdn.grapecity.com/cs/tags/ASP.NET/default.aspx", "http://gcdn.grapecity.com/cs/tags/JavaScript/default.aspx" }); FpSpread1.ActiveSheetView.Cells[2, 0].CellType = tagCell2; } private DataTable GetData() { DataTable table = new DataTable("Demo"); table.Columns.Add("ID", typeof(int)); table.Columns.Add("Name", typeof(string)); table.Columns.Add("University", typeof(string)); table.Columns.Add("Favorite site", typeof(string)); table.Columns.Add("Weight", typeof(int)); table.Rows.Add(new object[] { 1, "Spread User", "FarPoint", "www.clubfarpoint.com", 20 }); table.Rows.Add(new object[] { 2, "Google User", "Google", "www.google.com", 3 }); table.Rows.Add(new object[] { 3, "Microsoft Developer", "Microsoft", "www.microsoft.com", 1 }); table.Rows.Add(new object[] { 4, "Code Project User", "CodeProject", "www.codeproject.com", 10 }); return table; }
' Use first tag cloud cell type constructor. Dim tagCell As New FarPoint.Web.Spread.TagCloudCellType() tagCell.DataSource = GetData() 'refer to the data source part. tagCell.DataTextField = "Name" tagCell.DataWeightField = "Weight" tagCell.DataTitleField = "University" tagCell.DataHrefField = "Favorite site" tagCell.DataTextFormatString = "UserName:{0}" tagCell.DataTitleFormatString = "Graduate from:{0}" tagCell.DataHrefFormatString = "http://{0}" tagCell.DataDisplayTextField = "University" tagCell.DataItemDataField = "Weight" FpSpread1.ActiveSheetView.Cells(0, 0).CellType = tagCell ' ' Use second tag cloud cell type constructor. Dim tagCell1 As New FarPoint.Web.Spread.TagCloudCellType(New String() {"SEARCH", "ASP.NET", "JAVASCRIPT"}, New String() {"20", "50", "30"}) FpSpread1.ActiveSheetView.Cells(1, 0).CellType = tagCell1 ' ' Use third tag cloud cell type constructor. Dim tagCell2 As New FarPoint.Web.Spread.TagCloudCellType(New String() {"SEARCH", "ASP.NET", "JAVASCRIPT"}, New String() {"20", "50", "30"}, New String() {"http://www.google.com", "http://gcdn.grapecity.com/cs/tags/ASP.NET/default.aspx", "http://gcdn.grapecity.com/cs/tags/JavaScript/default.aspx"}) FpSpread1.ActiveSheetView.Cells(2, 0).CellType = tagCell2 ' Private Function GetData() As DataTable Dim table As New DataTable("Demo") table.Columns.Add("ID", GetType(Integer)) table.Columns.Add("Name", GetType(String)) table.Columns.Add("University", GetType(String)) table.Columns.Add("Favorite site", GetType(String)) table.Columns.Add("Weight", GetType(Integer)) table.Rows.Add(New Object() {1, "Spread User", "FarPoint", "www.clubfarpoint.com", 20}) table.Rows.Add(New Object() {2, "Google User", "Google", "www.google.com", 3}) table.Rows.Add(New Object() {3, "Microsoft Developer", "Microsoft", "www.microsoft.com", 1}) table.Rows.Add(New Object() {4, "Code Project User", "CodeProject", "www.codeproject.com", 10}) Return table End Function 'GetData
Target Platforms: Windows 7, Windows 8, Windows Vista, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6