100% found this document useful (1 vote)
298 views

Passing A DevExpress PivotGrid Value To A DotSpatial Map Control

This document discusses code for selecting attributes in a pivot grid control and updating a chart and map layers dynamically based on the selection. When an attribute is selected in the pivot grid, the chart will select the corresponding column and the map polygons will change color according to the values of the selected attribute field, with blue representing lowest values and white representing highest values.

Uploaded by

Andy Obregon
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
298 views

Passing A DevExpress PivotGrid Value To A DotSpatial Map Control

This document discusses code for selecting attributes in a pivot grid control and updating a chart and map layers dynamically based on the selection. When an attribute is selected in the pivot grid, the chart will select the corresponding column and the map polygons will change color according to the values of the selected attribute field, with blue representing lowest values and white representing highest values.

Uploaded by

Andy Obregon
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

//////////////////////////////////////////////////////////////////////// /////////// // C# This allows the selected Attribute from the row in the Pivotgrid to be // passed as an attribute parameter

value to the ucPivotChart1 control private void pivotGridControl1_CellSelectionChanged(object sender, Event Args e) { String hitValue = null; PivotGridHitInfo hi = pivotGridControl1.CalcHitInfo(pivotGridControl 1.PointToClient(MousePosition)); if (hi.HitTest == PivotGridHitTest.Value) { if (hi.ValueInfo.Value != null) { hitValue = hi.ValueInfo.Value.ToString(); if (ucPivotChart3.customPivot1.Fields[hitValue] != null) SelectColumn(ucPivotChart3.customPivot1.Fields[hitValue] .AreaIndex); } } ////////////////////////////////////////////////////////////// // COLOR AOI POLYGONS DYNAMICALLY // // Everytime a common Attribute is selected in the pivotgrid from th e left, the AOI polygons will automatically change color // according to their values Blue is Cold (lowest numbers) to White (hot = higher value) // chec the number of layers from map control // if (map1.Layers.Count > 0) { //Declare a MapPolygonLayer MapPolygonLayer AOILayer = default(MapPolygonLayer); //Type cast the FirstLayer of MapControl to MapPolygonLayer AOILayer = (MapPolygonLayer)map1.Layers[1]; //Chec the MapPolygonLayer ( Ma e sure that it has a polygon la yer) if (AOILayer == null) { MessageBox.Show("The layer is not a polygon layer."); } else { //Create a new PolygonScheme PolygonScheme AOIscheme = new PolygonScheme(); //Set the ClassificationType for the PolygonScheme via Edito rSettings AOIscheme.EditorSettings.ClassificationType = Classification Type.UniqueValues; AOIscheme.EditorSettings.IntervalMethod = IntervalMethod.Equ alInterval; AOIscheme.EditorSettings.UseColorRange = true; AOIscheme.EditorSettings.StartColor = (Color.FromArgb(0x00, 0x00, 0x66)); AOIscheme.EditorSettings.EndColor = (Color.FromArgb(0xF5, 0x

F8, 0xFB)); try { //GRAB ATTRIBUTE NAME FROM THE XTRAPIVOTGRID CONTROL string attribute = hi.ValueInfo.Value.ToString(); //Set the UniqueValue field name AOIscheme.EditorSettings.FieldName = attribute; //create categories on the scheme based on the attribute s table and field name AOIscheme.CreateCategories(AOILayer.DataSet.DataTable); //Apply the new scheme AOILayer.Symbology = AOIscheme; } catch { } } } else { MessageBox.Show("Please add a layer to the map."); }

? }

////////////////////////////////////////////////////////////

// END OF POLYGON COLORIZATION...I don't

now if that is a real word

You might also like