Gallery
JS Mapping Thematic Partial
<%@ Import Namespace="System.Drawing" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Page Language="C#" Description="dotnetCHARTING Component" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>.netCHARTING Sample</title>
<script runat="server">
void Page_Load(Object sender,EventArgs e)
{
// Demonstrates a thematic map with only select elements being counted.
Chart.Type = ChartType.Map;//Horizontal;
Chart.Width = 600;
Chart.Height = 350;
Chart.TempDirectory = "temp";
Chart.Debug = false;
Chart.Title = "Partial Thematic Shapes";
Chart.JS.Enabled = true;
// *DYNAMIC DATA NOTE*
// This sample uses random data to populate the chart. To populate
// a chart with database data see the following resources:
// - Classic samples folder
// - Help File > Data Tutorials
// - Sample: features/DataEngine.aspx
Chart.SmartPalette.Add("*", new SmartColor(Color.Green, Color.Yellow, new ScaleRange(0, 50), ElementValue.ZValue));
Chart.SeriesCollection.Add(getMapData());
}
SeriesCollection getMapData()
{
Random myR = new Random(1);
SeriesCollection SC = new SeriesCollection();
Series s = new Series();
s.JsMap = "US";
s.Elements.Add(getElement("US.IL",myR.Next(50)));
s.Elements.Add(getElement("US.IN", myR.Next(50)));
s.Elements.Add(getElement("US.WI", myR.Next(50)));
SC.Add(s);
return SC;
}
Element getElement(string code, int zVal)
{
Element el = new Element();
el.JsMap = code;
el.ZValue = zVal;
el.Outline.Color = Color.White;
return el;
}
</script>
</head>
<body>
<div align="center">
<dotnet:Chart id="Chart" runat="server" Width="568px" Height="344px"></dotnet:Chart></div>
</body>
</html>
<%@ Import Namespace="System.Drawing" %>
<%@ Register TagPrefix="dotnet" Namespace="dotnetCHARTING" Assembly="dotnetCHARTING"%>
<%@ Page Language="vb" Description="dotnetCHARTING Component" %>
<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)
' Demonstrates a thematic map with only select elements being counted.
Chart.Type = ChartType.Map 'Horizontal;
Chart.Width = 600
Chart.Height = 350
Chart.TempDirectory = "temp"
Chart.Debug = False
Chart.Title = "Partial Thematic Shapes"
Chart.JS.Enabled = True
' *DYNAMIC DATA NOTE*
' This sample uses random data to populate the chart. To populate
' a chart with database data see the following resources:
' - Classic samples folder
' - Help File > Data Tutorials
' - Sample: features/DataEngine.aspx
Chart.SmartPalette.Add("*", New SmartColor(Color.Green, Color.Yellow, New ScaleRange(0, 50), ElementValue.ZValue))
Chart.SeriesCollection.Add(getMapData())
End Sub
Function getMapData() As SeriesCollection
Dim myR As Random = New Random(1)
Dim SC As SeriesCollection = New SeriesCollection()
Dim s As Series = New Series()
s.JsMap = "US"
s.Elements.Add(getElement("US.IL",myR.Next(50)))
s.Elements.Add(getElement("US.IN", myR.Next(50)))
s.Elements.Add(getElement("US.WI", myR.Next(50)))
SC.Add(s)
Return SC
End Function
Function getElement(ByVal code As String, ByVal zVal As Integer) As Element
Dim el As Element = New Element()
el.JsMap = code
el.ZValue = zVal
el.Outline.Color = Color.White
Return el
End Function
</script>
</head>
<body>
<div align="center">
<dotnet:Chart id="Chart" runat="server" Width="568px" Height="344px"></dotnet:Chart></div>
</body>
</html>
- Sample FilenameJsMappingThematicPartial.aspx
- Version8.3
- Uses DatabaseNo