${iServerJava6R_ThemeDotDensity_Title}
${iServerJava6R_ThemeDotDensity_Description}
//点击生成专题图触发事件 private void commit_Click(object sender, RoutedEventArgs e) { ThemeDotDensity themeDotDensity = new ThemeDotDensity { //专题图中每一个点所代表的数值 Value = 10000000, //1994年人口字段 DotExpression = "Pop_1994", Style = new ServerStyle { //设置点符号 MarkerSize = 2, MarkerSymbolID = 1, FillForeColor = System.Windows.Media.Color.FromArgb(255,0,180,150), } }; //专题图参数设置 ThemeParameters dotDensityParams = new ThemeParameters { //数据集名称 DatasetName = "Countries", //数据源名称 DataSourceName = "World", Themes = new List<Theme> { themeDotDensity } }; //与服务器交互 ThemeService dotDensityService = new ThemeService(url); dotDensityService.ProcessAsync(dotDensityParams); dotDensityService.ProcessCompleted += new EventHandler<ThemeEventArgs>(dotDensityService_ProcessCompleted); dotDensityService.Failed += new EventHandler<ServiceFailedEventArgs>(dotDensityService_Failed); }
internal static ThemeDotDensity FromJson(JsonObject json) { if (json == null) return null; ThemeDotDensity dotDensity = new ThemeDotDensity(); dotDensity.DotExpression = (string)json["dotExpression"]; dotDensity.Style = ServerStyle.FromJson((JsonObject)json["style"]); dotDensity.Value = (double)json["value"]; return dotDensity; }
internal static string ToJson(ThemeDotDensity dotDensity) { string json = "{"; List<string> list = new List<string>(); if (!string.IsNullOrEmpty(dotDensity.DotExpression)) { list.Add(string.Format("\"dotExpression\":\"{0}\"", dotDensity.DotExpression)); } else { list.Add("\"dotExpression\":\"\""); } if (dotDensity.Style != null) { list.Add(string.Format("\"style\":{0}", ServerStyle.ToJson(dotDensity.Style))); } else { list.Add(string.Format("\"style\":{0}", ServerStyle.ToJson(new ServerStyle()))); } list.Add(string.Format("\"value\":{0}", dotDensity.Value.ToString(System.Globalization.CultureInfo.InvariantCulture))); list.Add("\"type\":\"DOTDENSITY\""); if (dotDensity.MemoryData!=null) { list.Add( "\"memoryData\":" + dotDensity.ToJson(dotDensity.MemoryData)); } else { list.Add("\"memoryData\":null"); } json += string.Join(",", list.ToArray()); json += "}"; return json; }
private void compositionTheme_Click(object sender, RoutedEventArgs e) { List<ThemeUniqueItem> items = new List<ThemeUniqueItem> { new ThemeUniqueItem { Caption="A", Unique="1", Style=new ServerStyle { FillForeColor=Colors.Red, }, Visible=true, }, new ThemeUniqueItem { Caption="B", Unique="247", Style=new ServerStyle { FillForeColor=Colors.Blue, }, Visible=true, } }; ThemeUnique themeUnique = new ThemeUnique { Items = items, UniqueExpression = "SmID", DefaultStyle = new ServerStyle { FillOpaqueRate = 100, FillForeColor = Colors.Orange, FillBackOpaque = true, FillBackColor = Colors.Transparent } }; ThemeDotDensity themeDonDensity = new ThemeDotDensity { Value = 10000000, DotExpression = "Pop_1994", Style = new ServerStyle { MarkerSize = 5, } }; ThemeParameters compostionThemeParameters = new ThemeParameters { DatasetName = "World", DataSourceName = "World", Themes = new List<Theme> { themeDonDensity, themeUnique } }; ThemeService compositeService = new ThemeService(url); compositeService.ProcessAsync(compostionThemeParameters); compositeService.Failed += new EventHandler<ServiceFailedEventArgs>(compositeService_Failed); compositeService.ProcessCompleted += new EventHandler<ThemeEventArgs>(compositeService_ProcessCompleted); }
private void ThemeDotDensityButton_Click(object sender, RoutedEventArgs e) { ThemeDotDensity themeDonDensity = new ThemeDotDensity { Value = 1000000, DotExpression = "Cap_Pop", Style = new ServerStyle { MarkerSize = 5, FillBackColor = Colors.Red, FillForeColor = Colors.Red, MarkerSymbolID = 10 } }; /* ThemeParameters dotDensityParams = new ThemeParameters { DatasetName = "Countries", DataSourceName = "World", Themes = new List<Theme> { themeDonDensity } };*/ ThemeParameters dotDensityParams = new ThemeParameters { DatasetName = "Countries", DataSourceName = "World", Themes = new List<Theme> { themeDonDensity } }; dotDensityParams.JoinItems.Add(new JoinItem { ForeignTableName = "Capitals", JoinFilter = "Countries.Country=Capitals.Country", JoinType = JoinType.LEFTJOIN }); ThemeService dotDensityService = new ThemeService(url); dotDensityService.ProcessAsync(dotDensityParams); dotDensityService.ProcessCompleted += new EventHandler<ThemeEventArgs>(dotDensityService_ProcessCompleted); dotDensityService.Failed += new EventHandler<ServiceFailedEventArgs>(dotDensityService_Failed); }
private void commit_Click(object sender, RoutedEventArgs e) { //专题图子项数组 List<ThemeUniqueItem> items = new List<ThemeUniqueItem> { //专题图子项 new ThemeUniqueItem { //SmID字段值 Unique="1", Style=new ServerStyle { FillForeColor = new Color {R=1,G=128,B=171}, LineWidth = 0.1 }, Visible=true, }, new ThemeUniqueItem { //SmID字段值 Unique="247", Style=new ServerStyle { FillForeColor= new Color {R=192,G=214,B=54}, LineWidth = 0.1 }, Visible=true, } }; //设置其他 SmID 字段显示风格 ThemeUnique themeUnique = new ThemeUnique { Items = items, UniqueExpression = "SmID", DefaultStyle = new ServerStyle { FillOpaqueRate = 100, FillForeColor = new Color { R = 250, G = 237, B = 195 }, LineWidth = 0.1, FillBackOpaque = true, FillBackColor = Colors.Transparent } }; ThemeDotDensity themeDotDensity = new ThemeDotDensity { //专题图中每一个点所代表的数值 Value = 10000000, //1994年人口字段 DotExpression = "Pop_1994", Style = new ServerStyle { //设置点符号 MarkerSize = 2, MarkerSymbolID = 1, FillForeColor = System.Windows.Media.Color.FromArgb(255, 0, 180, 150), } }; //专题图参数设置 ThemeParameters compostionThemeParameters = new ThemeParameters { DatasetName = "Countries", DataSourceName = "World", Themes = new List<Theme> { themeDotDensity, themeUnique } }; //与服务器交互 ThemeService compositeService = new ThemeService(url); compositeService.ProcessAsync(compostionThemeParameters); compositeService.Failed += new EventHandler<ServiceFailedEventArgs>(compositeService_Failed); compositeService.ProcessCompleted += new EventHandler<ThemeEventArgs>(compositeService_ProcessCompleted); }