示例#1
0
        private void InitializeInteractiveColorLegend()
        {
            //throw new NotImplementedException();

            interactiveColorLegend = new InteractiveColorLegend();
            interactiveColorLegend.Name = "ColorLegend";
            interactiveColorLegend.ColorMap = colorMap;
            interactiveColorLegend.ShowColorEdgeSliders = true;
            interactiveColorLegend.UseRelativePosition = true;
            interactiveColorLegend.SetPosition(0.1f,0.5f);
            interactiveColorLegend.UseRelativeSize = true;
            interactiveColorLegend.SetLegendSize(10,70);
            interactiveColorLegend.SetHeader(excelDataProvider.ColumnHeaders[choroplethMapSelectedIndex]);
            float [] globalEdge = {2f,0.9f};
            List<float> edges = new List<float>();
            edges.Add(0.4f);
            edges.Add(0.4f);
            edges.Add(0.2f);
            interactiveColorLegend.EdgeValuesList = edges;
            float min = 0;
            float max = 0;
            yearSliceDataTransformer.GetDataCube().GetColumnMaxMin(choroplethMapSelectedIndex, out max, out min);
            interactiveColorLegend.MaxValue = max;
            interactiveColorLegend.MinValue = min;

            interactiveColorLegend.ShowMinMaxValues = true;

            interactiveColorLegend.Enabled = true;
            interactiveColorLegend.ValueSliderValuesChanged += new EventHandler(interactiveColorLegend_ValueSliderValuesChanged);
            interactiveColorLegend.ColorEdgeValuesChanged += new EventHandler(interactiveColorLegend_ColorEdgeValuesChanged);
            interactiveColorLegend.ThresholdValuesChanged += new EventHandler(interactiveColorLegend_ThresholdValuesChanged);
        }