Gallery
View Attributes
<%@ Page Language="C#" Description="dotnetCHARTING Component" debug = "true" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="dotnetCHARTING.Mapping" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<script runat="server">
void Page_Load(Object sender,EventArgs e)
{
//View available attributes for a given shape file
Chart.Type = ChartType.Map;
Chart.TempDirectory = "temp";
Chart.ChartArea.Background.Color = Color.FromArgb(255,243,249,255);
MapLayer layer = MapDataEngine.LoadLayer("../../images/MapFiles/canada.shp");
int line = 0;
foreach(string attributename in layer.AttributeNames)
{
if (line == 3)
{
attributes.Text += attributename + "<br>";
line = 0;
}
else
{
attributes.Text += attributename + ", ";
line++;
}
}
Chart.Mapping.MapLayerCollection.Add(layer);
//Chart.Mapping.ZoomPercentage = 90;
}
</script>
</head>
<body>
<div style="text-align:center">
<dotnet:Chart id="Chart" runat="server" />
<asp:Label ID="attributes" runat="server"></asp:Label>
</div>
</body>
</html>
<%@ Page Language="vb" Description="dotnetCHARTING Component" debug = "true" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Import Namespace="System.Drawing" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<%@ Import Namespace="dotnetCHARTING.Mapping" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<script runat="server">
Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
'View available attributes for a given shape file
Chart.Type = ChartType.Map
Chart.TempDirectory = "temp"
Chart.ChartArea.Background.Color = Color.FromArgb(255,243,249,255)
Dim layer As MapLayer = MapDataEngine.LoadLayer("../../images/MapFiles/canada.shp")
Dim line As Integer = 0
For Each attributename As String In layer.AttributeNames
If line = 3 Then
attributes.Text += attributename & "<br>"
line = 0
Else
attributes.Text += attributename & ", "
line += 1
End If
Next attributename
Chart.Mapping.MapLayerCollection.Add(layer)
'Chart.Mapping.ZoomPercentage = 90;
End Sub
</script>
</head>
<body>
<div style="text-align:center">
<dotnet:Chart id="Chart" runat="server" />
<asp:Label ID="attributes" runat="server"></asp:Label>
</div>
</body>
</html>
- Sample FilenameViewAttributes.aspx
- Version4.0
- Uses DatabaseNo