Vous êtes sur la page 1sur 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

Vous aimerez peut-être aussi