public SpotChartColumn(SpotChart chart, string prop, double maxVal, Color color) { Chart = chart; Property = prop; MaxValue = maxVal; Color = color; ValueSelector = f => f[Property].TryParseToDouble(); }
public virtual void ApplySpotChart(SpotChart chart) { for (int i = 0; i < Features.Count; i++) { var feature = LayerData.Features[i]; for (int j = 0; j < chart.Columns.Count; j++) { var column = chart.Columns[j]; this.AddOverlayChildren(column.GetShape(feature, j)); } } }
public void ShowParcelMiniChart() { var chart = new Dreambuild.Gis.Display.SpotChart(50, 50); string[] props = { "容积率", "建筑密度" }; double max = MapDataManager.LatestMap.Layers["地块"].Features.Select(f => f["容积率"].TryParseToDouble()).Max(); foreach (var prop in props) { var col = new Dreambuild.Gis.Display.SpotChartColumn(chart, prop, max, Colors.DarkRed); chart.Columns.Add(col); } MapControl.Current.FindMapLayers("地块").ForEach(x => x.ApplySpotChart(chart)); }