Example #1
0
        public static Color[] GetChartColorPaletteColors(ChartColorPalette ChartColorPalette)
        {
            string[] ColorValues;

            switch (ChartColorPalette)
            {
                case ChartColorPalette.Berry:
                    ColorValues = new string[] { "#8A2BE2", "#BA55D3", "#4169E1", "#C71585", "#0000FF", "#8019E0", "#DA70D6", "#7B68EE", "#C000C0", "#0000CD", "#800080" };
                    break;
                case ChartColorPalette.Bright:
                    ColorValues = new string[] { "#008000", "#0000FF", "#800080", "#800080", "#FF00FF", "#008080", "#FFFF00", "#808080", "#00FFFF", "#000080", "#800000", "#FF3939", "#7F7F00", "#C0C0C0", "#FF6347", "#FFE4B5" };
                    break;
                case ChartColorPalette.BrightPastel:
                    ColorValues = new string[] { "#418CF0", "#FCB441", "#DF3A02", "#056492", "#BFBFBF", "#1A3B69", "#FFE382", "#129CDD", "#CA6B4B", "#005CDB", "#F3D288", "#506381", "#F1B9A8", "#E0830A", "#7893BE" };
                    break;
                case ChartColorPalette.Chocolate:
                    ColorValues = new string[] { "#A0522D", "#D2691E", "#8B0000", "#CD853F", "#A52A2A", "#F4A460", "#8B4513", "#C04000", "#B22222", "#B65C3A" };
                    break;
                case ChartColorPalette.EarthTones:
                    ColorValues = new string[] { "#33023", "#B8860B", "#C04000", "#6B8E23", "#CD853F", "#C0C000", "#228B22", "#D2691E", "#808000", "#20B2AA", "#F4A460", "#00C000", "#8FBC8B", "#B22222", "#843A05", "#C00000" };
                    break;
                case ChartColorPalette.Excel:
                    ColorValues = new string[] { "#9999FF", "#993366", "#FFFFCC", "#CCFFFF", "#660066", "#FF8080", "#0063CB", "#CCCCFF", "#000080", "#FF00FF", "#FFFF00", "#00FFFF", "#800080", "#800000", "#007F7F", "#0000FF" };
                    break;
                case ChartColorPalette.Fire:
                    ColorValues = new string[] { "#FFD700", "#FF0000", "#FF1493", "#DC143C", "#FF8C00", "#FF00FF", "#FFFF00", "#FF4500", "#C71585", "#DDE221" };
                    break;
                case ChartColorPalette.Grayscale:
                    ColorValues = new string[] { "#C8C8C8", "#BDBDBD", "#B2B2B2", "#A7A7A7", "#9C9C9C", "#919191", "#868686", "#7A7A7A", "#707070", "#656565", "#565656", "#4F4F4F", "#424242", "#393939", "#2E2E2E", "#232323" };
                    break;
                case ChartColorPalette.Light:
                    ColorValues = new string[] { "#E6E6FA", "#FFF0F5", "#FFDAB9", "#", "#FFFACD", "#", "#FFE4E1", "#F0FFF0", "#F0F8FF", "#F5F5F5", "#FAEBD7", "#E0FFFF" };
                    break;
                case ChartColorPalette.Pastel:
                    ColorValues = new string[] { "#87CEEB", "#32CD32", "#BA55D3", "#F08080", "#4682B4", "#9ACD32", "#40E0D0", "#FF69B4", "#F0E68C", "#D2B48C", "#8FBC8B", "#6495ED", "#DDA0DD", "#5F9EA0", "#FFDAB9", "#FFA07A" };
                    break;
                case ChartColorPalette.SeaGreen:
                    ColorValues = new string[] { "#2E8B57", "#66CDAA", "#4682B4", "#008B8B", "#5F9EA0", "#38B16E", "#48D1CC", "#B0C4DE", "#8FBC8B", "#87CEEB" };
                    break;
                case ChartColorPalette.SemiTransparent:
                    ColorValues = new string[] { "#FF6969", "#69FF69", "#6969FF", "#FFFF5D", "#69FFFF", "#FF69FF", "#CDB075", "#FFAFAF", "#AFFFAF", "#AFAFFF", "#FFFFAF", "#AFFFFF", "#FFAFFF", "#E4D5B5", "#A4B086", "#819EC1" };
                    break;
                default:
                    //return typeof(SystemColors).GetProperties(BindingFlags.Static | BindingFlags.DeclaredOnly | BindingFlags.Public)
                    //    .Select(c => (SystemColors)c.GetValue(null, null))
                    //    .ToList()
                    //    .ToArray();
                    return typeof(Color).GetProperties(BindingFlags.Static | BindingFlags.DeclaredOnly | BindingFlags.Public)
                        .Select(c => (Color)c.GetValue(null, null))
                        .ToList()
                        .ToArray();
            }

            var ColorList = new List<Color>();
            foreach (var ColorValue in ColorValues)
                ColorList.Add(ColorTranslator.FromHtml(ColorValue));

            return ColorList.ToArray();
        }
        public static Color[] GetPaletteColors(ChartColorPalette palette)
        {
            switch (palette)
            {
            case ChartColorPalette.None:
                throw new ArgumentException(SR.ExceptionPaletteIsEmpty);

            case ChartColorPalette.Default:
                return(colorsDefault);

            case ChartColorPalette.Grayscale:
                return(colorsGrayScale);

            case ChartColorPalette.Excel:
                return(colorsExcel);

            case ChartColorPalette.Pastel:
                return(colorsPastel);

            case ChartColorPalette.Light:
                return(colorsLight);

            case ChartColorPalette.EarthTones:
                return(colorsEarth);

            case ChartColorPalette.Semitransparent:
                return(colorsSemiTransparent);

            case ChartColorPalette.Berry:
                return(colorsBerry);

            case ChartColorPalette.Chocolate:
                return(colorsChocolate);

            case ChartColorPalette.Fire:
                return(colorsFire);

            case ChartColorPalette.SeaGreen:
                return(colorsSeaGreen);

            case ChartColorPalette.BrightPastel:
                return(colorsDundas);

            case ChartColorPalette.Pacific:
                return(colorsPacific);

            case ChartColorPalette.PacificLight:
                return(colorsPacificLight);

            case ChartColorPalette.PacificSemiTransparent:
                return(colorsPacificSemitransparent);

            default:
                return(null);
            }
        }
        private static void SetInitialParameters(Chart chart, ChartColorPalette colorPalette, SeriesChartType chartType)
        {
            chart.Series.Clear();
            chart.Palette = colorPalette;

            chart.Series.Add(FirstNumber);
            chart.Series.Add(SecondNumber);

            chart.Series[FirstNumber].ChartType  = chartType;
            chart.Series[SecondNumber].ChartType = chartType;
        }
Example #4
0
 private void setPalette(ChartColorPalette palette)
 {
     avgChart0.Palette = palette;
     avgChart1.Palette = palette;
     avgChart2.Palette = palette;
     avgChart3.Palette = palette;
     avgChart4.Palette = palette;
     avgChart5.Palette = palette;
     avgChart6.Palette = palette;
     avgChart7.Palette = palette;
 }
Example #5
0
        /// <summary>
        /// Returns the collection of brushes for specified pallete
        /// </summary>
        /// <param name="palette">ChartColorPalette</param>
        /// <returns>List of brushes</returns>
        public List <Brush> GetBrushes(ChartColorPalette palette)
        {
            switch (palette)
            {
            case ChartColorPalette.Metro:
                return(GetMetroBrushes());

            case ChartColorPalette.AutumnBrights:
                return(GetAutumnBrushes());

            case ChartColorPalette.BlueChrome:
                return(GetBlueChromeBrushes());

            case ChartColorPalette.Elite:
                return(GetEliteBrushes());

            case ChartColorPalette.FloraHues:
                return(GetFloraHuesBrushes());

            case ChartColorPalette.GreenChrome:
                return(GetGreenChromeBrushes());

            case ChartColorPalette.LightCandy:
                return(GetLightCandyBrushes());

            case ChartColorPalette.Pineapple:
                return(GetPineappleBrushes());

            case ChartColorPalette.PurpleChrome:
                return(GetPurpleChromeBrushes());

            case ChartColorPalette.RedChrome:
                return(GetRedChromeBrushes());

            case ChartColorPalette.SandyBeach:
                return(GetSandyBeachBrushes());

#if WINDOWS_UAP
            case ChartColorPalette.TomatoSpectrum:
#else
            case ChartColorPalette.TomotoSpectrum:
#endif
                return(GetTomatoSpectrumBrushes());

            case ChartColorPalette.Custom:
                return(CustomBrushes);

            case ChartColorPalette.None:
                return(new List <Brush>());
            }

            return(null);
        }
Example #6
0
        protected void Page_Load(object sender, System.EventArgs e)
        {
            if (this.FontNameList.SelectedItem.ToString() == "Custom")
            {
                this.Dropdownlist1.Enabled = true;
                Chart1.Palette             = ChartColorPalette.None;
                UpdateCustomPalette();
            }

            else
            {
                this.Dropdownlist1.Enabled = false;
                Chart1.PaletteCustomColors = new Color[0];
                this.Chart1.Palette        = (ChartColorPalette)ChartColorPalette.Parse(typeof(ChartColorPalette), this.FontNameList.SelectedItem.ToString());
            }
        }
Example #7
0
        /// <summary>
        /// Return array of colors for the specified palette. Number of
        /// colors returned varies depending on the palette selected.
        /// </summary>
        /// <param name="palette">Palette to get the colors for.</param>
        /// <returns>Array of colors.</returns>
        public static Color[] GetPaletteColors(ChartColorPalette palette)
        {
            switch (palette)
            {
            case (ChartColorPalette.None):
            {
                throw (new ArgumentException(SR.ExceptionPaletteIsEmpty));
            }

            case (ChartColorPalette.Bright):
                return(_colorsDefault);

            case (ChartColorPalette.Grayscale):
                return(_colorsGrayScale);

            case (ChartColorPalette.Excel):
                return(_colorsExcel);

            case (ChartColorPalette.Pastel):
                return(_colorsPastel);

            case (ChartColorPalette.Light):
                return(_colorsLight);

            case (ChartColorPalette.EarthTones):
                return(_colorsEarth);

            case (ChartColorPalette.SemiTransparent):
                return(_colorsSemiTransparent);

            case (ChartColorPalette.Berry):
                return(_colorsBerry);

            case (ChartColorPalette.Chocolate):
                return(_colorsChocolate);

            case (ChartColorPalette.Fire):
                return(_colorsFire);

            case (ChartColorPalette.SeaGreen):
                return(_colorsSeaGreen);

            case (ChartColorPalette.BrightPastel):
                return(_colorsBrightPastel);
            }
            return(null);
        }
Example #8
0
        public static System.Drawing.Color[] GetPaletteColors(this ChartColorPalette value)
        {
            switch (value)
            {
            case ChartColorPalette.Berry:
                return(GetPColors(0x8a2be2, 0xba55d3, 0x4169e1, 0xc71585, 0x0000ff, 0x8a2be2, 0xda70d6, 0x7b68ee, 0xc000c0, 0x0000cd, 0x800080));

            case ChartColorPalette.Bright:
                return(GetPColors(0x008000, 0x0000ff, 0x800080, 0x00ff00, 0xff00ff, 0x008080, 0xffff00, 0x808080, 0x00ffff, 0x000080, 0x800000, 0xff0000, 0x808000, 0xc0c0c0, 0xff6347, 0xffe4b5));

            case ChartColorPalette.BrightPastel:
                return(GetPColors(0x418cf0, 0xfcb441, 0xe0400a, 0x056492, 0xbfbfbf, 0x1a3b69, 0xffe382, 0x129cdd, 0xca6b4b, 0x005cdb, 0xf3d288, 0x506381, 0xf1b9a8, 0xe0830a, 0x7893be));

            case ChartColorPalette.Chocolate:
                return(GetPColors(0xa0522d, 0xd2691e, 0x8b0000, 0xcd853f, 0xa52a2a, 0xf4a460, 0x8b4513, 0xc04000, 0xb22222, 0xb65c3a));

            case ChartColorPalette.EarthTones:
                return(GetPColors(0xff8000, 0xb8860b, 0xc04000, 0x6b8e23, 0xcd853f, 0xc0c000, 0x228b22, 0xd2691e, 0x808000, 0x20b2aa, 0xf4a460, 0x00c000, 0x8fbc8b, 0xb22222, 0x8b4513, 0xc00000));

            case ChartColorPalette.Excel:
                return(GetPColors(0x9999ff, 0x993366, 0xffffcc, 0xccffff, 0x660066, 0xff8080, 0x0066cc, 0xccccff, 0x000080, 0xff00ff, 0xffff00, 0x00ffff, 0x800080, 0x800000, 0x008080, 0x0000ff));

            case ChartColorPalette.Fire:
                return(GetPColors(0xffd700, 0xff0000, 0xff1493, 0xdc143c, 0xff8c00, 0xff00ff, 0xffff00, 0xff4500, 0xc71585, 0xdde221));

            case ChartColorPalette.Grayscale:
                return(GetPColors(0xc8c8c8, 0xbdbdbd, 0xb2b2b2, 0xa7a7a7, 0x9c9c9c, 0x919191, 0x868686, 0x7b7b7b, 0x707070, 0x656565, 0x5a5a5a, 0x4f4f4f, 0x444444, 0x393939, 0x2e2e2e, 0x232323));

            case ChartColorPalette.Light:
                return(GetPColors(0xe6e6fa, 0xfff0f5, 0xffdab9, 0xfffacd, 0xffe4e1, 0xf0fff0, 0xf0f8ff, 0xf5f5f5, 0xfaebd7, 0xe0ffff));

            case ChartColorPalette.Pastel:
                return(GetPColors(0x87ceeb, 0x32cd32, 0xba55d3, 0xf08080, 0x4682b4, 0x9acd32, 0x40e0d0, 0xff69b4, 0xf0e68c, 0xd2b48c, 0x8fbc8b, 0x6495ed, 0xdda0dd, 0x5f9ea0, 0xffdab9, 0xffa07a));

            case ChartColorPalette.SeaGreen:
                return(GetPColors(0x2e8b57, 0x66cdaa, 0x4682b4, 0x008b8b, 0x5f9ea0, 0x3cb371, 0x48d1cc, 0xb0c4de, 0xffffff, 0x87ceeb));

            case ChartColorPalette.SemiTransparent:
                return(GetPColors(0xff6969, 0x69ff69, 0x6969ff, 0xffff69, 0x69ffff, 0xff69ff, 0xcdb075, 0xffafaf, 0xafffaf, 0xafafff, 0xffffaf, 0xafffff, 0xffafff, 0xe4d5b5, 0xa4b086, 0x819ec1));

            case ChartColorPalette.None:
            default:
                return(GetPColors(0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000));
            }
        }
    /// <summary>
    /// 生成共用方法
    /// </summary>
    /// <param name="bools"></param>
    /// <param name="chartp"></param>
    /// <param name="col"></param>
    /// <param name="msa"></param>
    private void ChartHandle(bool bools, ChartColorPalette chartp, SeriesChartType col, MarkerStyle msa, bool legend)
    {
        FillDeptIdList(BindDT);
        if (BindDT.Rows.Count > 0)
        {
            Chart1.Series["Series1"].Points.DataBindXY(BindDT.DefaultView, BindX, BindDT.DefaultView, BindY);
            this.Chart1.ChartAreas["Default"].AxisY.Title = TitleY;
            Chart1.Series["Series1"].Palette = chartp;
            if (BindIndex != null)
            {
                Chart1.Series["Series1"].Href = "javascript:LinkDetail('#INDEX')";
            }
            else
            {
                ImageButton1.Visible = false;
            }
            this.Chart1.ChartAreas["Default"].AxisX.Title = TitleX;

            if (legend)
            {
                Chart1.Series["Series1"].LegendText = LegendText;
            }
            else
            {
                Chart1.Series["Series1"].LegendText = "";
            }
            Chart1.ChartAreas["Default"].Area3DStyle.Enable3D = bools;
            foreach (Series series in Chart1.Series)
            {
                series.Type             = col;
                series.MarkerStyle      = msa;
                series.MarkerSize       = 15;
                series.ToolTip          = "点击查看明细";
                series.ShowLabelAsValue = true;
            }
            Chart1.Visible = true;
            nodata.Visible = false;
        }
        else
        {
            Chart1.Visible = false;
            nodata.Visible = true;
        }
    }
Example #10
0
        /// <summary>
        /// Apply palette colors to the data series if UsePaletteColors property is set.
        /// </summary>
        internal void ApplyPaletteColors()
        {
            ChartColorPalette palette = this.Palette;

            // switch to default pallette if is none and custom collors array is empty.
            if (palette == ChartColorPalette.None && this.PaletteCustomColors.Length == 0)
            {
                palette = ChartColorPalette.BrightPastel;
            }

            // Get palette colors
            int colorIndex = 0;

            Color[] paletteColors = (palette == ChartColorPalette.None) ?
                                    this.PaletteCustomColors : ChartPaletteColors.GetPaletteColors(palette);

            foreach (Series dataSeries in _series)
            {
                // Check if chart area name is valid
                bool validAreaName = false;
                if (Chart != null)
                {
                    validAreaName = Chart.ChartAreas.IsNameReferenceValid(dataSeries.ChartArea);
                }

                // Change color of the series only if valid chart area name is specified
                if (validAreaName)
                {
                    // Change color of the series only if default color is set
                    if (dataSeries.Color == Color.Empty || dataSeries.tempColorIsSet)
                    {
                        dataSeries.color          = paletteColors[colorIndex++];
                        dataSeries.tempColorIsSet = true;
                        if (colorIndex >= paletteColors.Length)
                        {
                            colorIndex = 0;
                        }
                    }
                }
            }
        }
        public void ChartDashB(Chart chrt)
        {
            string query = @"Select Top 5 count(*) as 'yValue', 
                            (Registered_Patient.Patient_Name + ' (' + CONVERT(varchar, Patient_Channel.Patient_Contact) + ')') as 'xValue'                            
                            from Patient_Channel 
                            inner join Registered_Patient 
                            on Registered_Patient.Patient_Contact = Patient_Channel.Patient_Contact
                            group by Patient_Channel.Patient_Contact, Registered_Patient.Patient_Name 
                            order by yValue desc";

            string title        = "Top 5 Requested Doctors";
            string legendsTitle = "Doctors";
            string seriesName   = "Doctors";

            Font  fnt     = new Font("Microsoft Sans Serif", 15);
            Color foreClr = Color.DimGray;

            ChartColorPalette chrtColPlt = ChartColorPalette.BrightPastel;
            SeriesChartType   chrtType   = SeriesChartType.Doughnut;

            ChartWhat(chrt, query, title, legendsTitle, seriesName, chrtColPlt, chrtType, fnt, foreClr);
        }
        public void ChartDashD(Chart chrt)
        {
            string query = @"Select top 5
                            Doctor.Specialization as 'xValue', 
                            count(*) as 'yValue'
                            from Patient_Channel 
                            inner join Doctor
                            on Doctor.Doctor_ID = Patient_Channel.Doctor_ID
                            group by Doctor.Specialization
                            order by yValue desc";

            string title        = "Top 5 Medical Specialties";
            string legendsTitle = "Specialty";
            string seriesName   = "Specialty";

            Font  fnt     = new Font("Microsoft Sans Serif", 15);
            Color foreClr = Color.DimGray;

            ChartColorPalette chrtColPlt = ChartColorPalette.BrightPastel;
            SeriesChartType   chrtType   = SeriesChartType.Doughnut;

            ChartWhat(chrt, query, title, legendsTitle, seriesName, chrtColPlt, chrtType, fnt, foreClr);
        }
        public void ChartWhat(Chart chrt, string query, string title, string legendsTitle, string seriesName, ChartColorPalette chrtColPlt, SeriesChartType chrtType, Font fnt, Color foreClr)
        {
            try
            {
                chrt.Titles.Clear();
                chrt.Series.Clear();
                chrt.Legends.Clear();
                chrt.ChartAreas.Clear();

                chrt.ChartAreas.Add("Default");

                chrt.Titles.Add(title);
                chrt.Titles[0].Font      = fnt;
                chrt.Titles[0].ForeColor = foreClr;

                chrt.Legends.Add("MyLegend");
                chrt.Legends[0].LegendStyle = LegendStyle.Table;
                chrt.Legends[0].Docking     = Docking.Bottom;
                chrt.Legends[0].Alignment   = StringAlignment.Center;
                chrt.Legends[0].Title       = legendsTitle;
                chrt.Legends[0].BorderColor = Color.Black;

                chrt.BackColor               = Color.Transparent;
                chrt.Legends[0].BackColor    = Color.Transparent;
                chrt.ChartAreas[0].BackColor = Color.Transparent;

                chrt.Palette = chrtColPlt;

                using (DataSet ds = commonDAO.GetDataFromDb(query))
                {
                    chrt.DataSource = ds.Tables["tmpTable"];

                    chrt.Series.Add(seriesName);
                    chrt.Series[seriesName].XValueMember        = "xValue";
                    chrt.Series[seriesName].YValueMembers       = "yValue";
                    chrt.Series[seriesName].ChartType           = chrtType;
                    chrt.Series[seriesName].IsValueShownAsLabel = true;
                    //chrt.Legends["Legend1"].Position = chrt.
                    //chrt.Series[seriesName].Font = new Font("Microsoft Sans Serif", 50);
                    //chrt.Series[seriesName]["3DLabelLineSize"] = "5";
                }
            }
            catch (Exception err)
            {
                MessageBox.Show(err.Message, "PIMS", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #14
0
        private static Color[] getPalette(ChartColorPalette palette)
        {
            var result = (Color[])_getPaletteColorsMethod.Invoke(null, new object[] { palette });

            return(result);
        }
 // <summary>
 //Creates chart control based on the passed parameters
 // </summary>
 // <param name="barThickness"> How thick the bar or column</param>
 // <param name="chartType">Bar, Column, Pie or Line</param>
 // <param name="usePalette">If true - uses Palette, otherwise - single color. For Pie chart palette is used regardless of this parameter</param>
 // <param name="palette">One of the palette in Windows.Forms.DataVisualization.ChartColorPalette </param>
 // <param name="color">One of the colors in Drawing.Color. Used for the bars, columns, or line</param>
 // <param name="fontFamily">One of the font familie as defined in Drawinf.FontFamily (string)</param>
 // <param name="fontColor">color of the font used for all texts - labels and values (from Drawing.color)</param>
 // <param name="backGroundColor">Background on the chart area. From Drawing.Color</param>
 // <param name="gridColor">The color used on all grid lines and markers. From Drawing.Color</param>
 // <param name="title">Title of the chart</param>
 // <param name="indexAxisTitle">Title on the Axis with labels</param>
 // <param name="valueAxisTitle">Title on the axis with values</param>
 // <param name="indexArray">Array of labels (String)</param>
 // <param name="valueArray">Array of values (Decimal)</param>
 // <param name="labelAngle">If 0, label on the X axis is shown horizontally, if negative, it is tilted counter clock wize, if positive,
 // tilted colck wise. Could be from -90 to 90. (degrees)</param>
 // <param name="showValueAtEdge">If set to truw, will show numeric value at the tip of the bar of column</param>
 // <param name="showLabelInside">If set to true, will show label inside the bar. Can be only set if showValueAtEdge is false</param>
 // <param name="SetIndexLabelBold">Used to show SELECT! word on the index axis in Index step.</param>
 // <param name="customProperties">Added to custom properties to series. To the list of supported properties refer to
 // http://msdn.microsoft.com/en-us/library/dd456764.aspx</param>
 // <returns>chart control or Nothing</returns>
 // <remarks></remarks>
 public virtual void InitializeChartControl(Chart chartControl,
     string[] indexArray,
     decimal[] valueArray,
     int barThickness,
     string chartType,
     bool usePalette,
     ChartColorPalette palette,
     System.Drawing.Color color,
     System.Drawing.Color backGroundColor,
     System.Drawing.Color gridColor,
     string fontFamily,
     System.Drawing.Color fontColor,
     System.Drawing.Color internalLabelColor,
     string showInsideBar,
     string title,
     string indexAxisTitle,
     string valueAxisTitle,
     int labelAngle,
     bool generatePercentage,
     string labelFormat,
     string customProperties)
 {
     System.Collections.Generic.List<object> args = new System.Collections.Generic.List<object>();
     args.Add(chartControl);
     args.Add(indexArray);
     args.Add(valueArray);
     args.Add(null);
     args.Add(null);
     args.Add(barThickness);
     args.Add(chartType);
     args.Add(usePalette);
     args.Add(palette);
     args.Add(color);
     args.Add(backGroundColor);
     args.Add(gridColor);
     args.Add(fontFamily);
     args.Add(fontColor);
     args.Add(internalLabelColor);
     args.Add(showInsideBar);
     args.Add(title);
     args.Add(indexAxisTitle);
     args.Add(valueAxisTitle);
     args.Add(labelAngle);
     args.Add(generatePercentage);
     args.Add(labelFormat);
     args.Add("");
     args.Add("");
     args.Add("");
     args.Add("");
     args.Add("");
     args.Add(customProperties);
     InitializeChartControl(args.ToArray());
 }
Example #16
0
        /// <summary>
        /// Se selecciona otra paleta de colores.
        /// </summary
        private void cboColores_SelectedIndexChanged(object sender, EventArgs e)
        {
            ChartColorPalette paleta = (ChartColorPalette)cboColores.SelectedItem;

            crtGrafico.Palette = paleta;
        }
    /// <summary>
    /// 生成共用方法
    /// </summary>
    /// <param name="bools"></param>
    /// <param name="chartp"></param>
    /// <param name="col"></param>
    /// <param name="msa"></param>
    private void ChartHandle(bool bools, ChartColorPalette chartp, SeriesChartType col, MarkerStyle msa, bool legend)
    {
        FillDeptIdList(BindDT);
        if (BindDT.Rows.Count > 0)
        {

            Chart1.Series["Series1"].Points.DataBindXY(BindDT.DefaultView, BindX, BindDT.DefaultView, BindY);
            this.Chart1.ChartAreas["Default"].AxisY.Title =TitleY;
            Chart1.Series["Series1"].Palette = chartp;
            if (BindIndex != null)
            {
                Chart1.Series["Series1"].Href = "javascript:LinkDetail('#INDEX')";

            }
            else 
            {
                ImageButton1.Visible = false;
            }
            this.Chart1.ChartAreas["Default"].AxisX.Title =TitleX;

            if (legend)
            {
                Chart1.Series["Series1"].LegendText =LegendText;
            }
            else
            {
                Chart1.Series["Series1"].LegendText = "";
            }
            Chart1.ChartAreas["Default"].Area3DStyle.Enable3D = bools;
            foreach (Series series in Chart1.Series)
            {
                series.Type = col;
                series.MarkerStyle = msa;
                series.MarkerSize = 15;
                series.ToolTip = "点击查看明细";
                series.ShowLabelAsValue = true;
            }
            Chart1.Visible = true;
            nodata.Visible = false;
        }
        else
        {
            Chart1.Visible = false;
            nodata.Visible = true;
        }
    }
 public void Initialize(Chart chart, ChartColorPalette colorPalette, SeriesChartType chartType, IDictionary <int, int[]> data)
 {
     SetInitialParameters(chart, colorPalette, chartType);
     FillChartWithHistory(chart, data);
 }
 public ColorOption(ReadOnlyDictionary <CalculationsMode, IChart> charts, ChartColorPalette color)
     : base(color, charts)
 {
     this.color = color;
     Checked    = chart2d.Palette == color;
 }
 private void UpdatePalette()
 {
     chart2.PaletteCustomColors = new Color[0];
     chart2.Palette             = (ChartColorPalette)ChartColorPalette.Parse(typeof(ChartColorPalette), this.cb_Palette.SelectedItem.ToString());
 }
Example #21
0
        internal void ApplyPalette(ChartColorPalette palette)
        {
            switch (palette)
            {
            case ChartColorPalette.Metro:
                currentBrushes = GetMetroBrushes();
                break;

            case ChartColorPalette.Custom:
                currentBrushes = CustomBrushes;
                break;

            case ChartColorPalette.AutumnBrights:
                currentBrushes = GetAutumnBrushes();
                break;

            case ChartColorPalette.FloraHues:
                currentBrushes = GetFloraHuesBrushes();
                break;

            case ChartColorPalette.Pineapple:
                currentBrushes = GetPineappleBrushes();
                break;

#if WINDOWS_UAP
            case ChartColorPalette.TomatoSpectrum:
#else
            case ChartColorPalette.TomotoSpectrum:
#endif
                currentBrushes = GetTomatoSpectrumBrushes();
                break;

            case ChartColorPalette.RedChrome:
                currentBrushes = GetRedChromeBrushes();
                break;

            case ChartColorPalette.PurpleChrome:
                currentBrushes = GetPurpleChromeBrushes();
                break;

            case ChartColorPalette.BlueChrome:
                currentBrushes = GetBlueChromeBrushes();
                break;

            case ChartColorPalette.GreenChrome:
                currentBrushes = GetGreenChromeBrushes();
                break;

            case ChartColorPalette.Elite:
                currentBrushes = GetEliteBrushes();
                break;

            case ChartColorPalette.SandyBeach:
                currentBrushes = GetSandyBeachBrushes();
                break;

            case ChartColorPalette.LightCandy:
                currentBrushes = GetLightCandyBrushes();
                break;
            }
        }