//public ColumnChartSettings ColumnChartSettings { get; set; }
 public ParetoChart(DashboardHelper dashboardHelper, ParetoChartParameters parameters, List<XYParetoChartData> dataList)
 {
     InitializeComponent();
     //this.Settings = settings;
     //this.ColumnChartSettings = settings;
     ParetoChartParameters = parameters;
     this.DashboardHelper = dashboardHelper;
     SetChartProperties();
     SetChartData(dataList);
     xyChart.Legend.BorderBrush = Brushes.Gray;
 }
        /// <summary>
        /// Copy Constructor
        /// </summary>
        public ParetoChartParameters(ParetoChartParameters parameters)
            : base(parameters)
        {
            //MainVariableNames = parameters.MainVariableNames;
            ColumnNames = parameters.ColumnNames;
            //GadgetStatusUpdate = parameters.GadgetStatusUpdate;
            InputVariableList = parameters.InputVariableList;
            CustomFilter = parameters.CustomFilter;
            CustomSortColumnName = parameters.CustomSortColumnName;
            IncludeFullSummaryStatistics = parameters.IncludeFullSummaryStatistics;
            ShowAllListValues = parameters.ShowAllListValues;
            ShowCommentLegalLabels = parameters.ShowCommentLegalLabels;
            SortHighToLow = parameters.SortHighToLow;
            IncludeMissing = parameters.IncludeMissing;
            CrosstabVariableName = parameters.CrosstabVariableName;
            WeightVariableName = parameters.WeightVariableName;
            StrataVariableNames = parameters.StrataVariableNames;
            IgnoreRowLimits = parameters.IgnoreRowLimits;
            SortVariables = parameters.SortVariables;

            //from ColumnChartGadgetParametersBase
            UseDiffColors = parameters.UseDiffColors ;
            Composition = parameters.Composition ;
            //BarSpacing = parameters.BarSpacing;
            Orientation = parameters.Orientation ;
            BarKind = parameters.BarKind;

            //from ChartGadgetParametersBase
            //Advanced options
            ChartWidth = parameters.ChartWidth;
            ChartHeight = parameters.ChartHeight;
            Y2AxisType = parameters.Y2AxisType;

            //Display options
            //  Color and styles
            UseRefValues = parameters.UseRefValues;
            ShowAnnotations = parameters.ShowAnnotations;
            Y2ShowAnnotations = parameters.Y2ShowAnnotations;
            ShowGridLines = parameters.ShowGridLines;
            Palette = parameters.Palette;
            //Y2LineType = parameters.Y2LineType;
            Y2LineDashStyle = parameters.Y2LineDashStyle;
            Y2LineThickness = parameters.Y2LineThickness;
            //  Labels
            YAxisLabel = parameters.YAxisLabel;
            YAxisFormat = parameters.YAxisFormat;
            Y2AxisLabel = parameters.Y2AxisLabel;
            Y2AxisLegendTitle = parameters.Y2AxisLegendTitle;
            Y2AxisFormat = parameters.Y2AxisFormat;
            XAxisLabelType = parameters.XAxisLabelType;
            XAxisLabel = parameters.XAxisLabel;
            XAxisAngle = parameters.XAxisAngle;
            ChartTitle = parameters.ChartTitle;
            ChartSubTitle = parameters.ChartSubTitle;
            ChartStrataTitle = parameters.ChartStrataTitle;
            //  Legend
            ShowLegend = parameters.ShowLegend;
            ShowLegendBorder = parameters.ShowLegendBorder;
            ShowLegendVarNames = parameters.ShowLegendVarNames;
            //LegendFontSize in ChartGadgetParametersBase.cs
            LegendDock = parameters.LegendDock;
            Y2IsCumulativePercent = parameters.Y2IsCumulativePercent;
        }
        /// <summary>
        /// Copy Constructor
        /// </summary>
        public ParetoChartParameters(ParetoChartParameters parameters)
            : base(parameters)
        {
            //MainVariableNames = parameters.MainVariableNames;
            ColumnNames = parameters.ColumnNames;
            //GadgetStatusUpdate = parameters.GadgetStatusUpdate;
            InputVariableList            = parameters.InputVariableList;
            CustomFilter                 = parameters.CustomFilter;
            CustomSortColumnName         = parameters.CustomSortColumnName;
            IncludeFullSummaryStatistics = parameters.IncludeFullSummaryStatistics;
            ShowAllListValues            = parameters.ShowAllListValues;
            ShowCommentLegalLabels       = parameters.ShowCommentLegalLabels;
            SortHighToLow                = parameters.SortHighToLow;
            IncludeMissing               = parameters.IncludeMissing;
            CrosstabVariableName         = parameters.CrosstabVariableName;
            WeightVariableName           = parameters.WeightVariableName;
            StrataVariableNames          = parameters.StrataVariableNames;
            IgnoreRowLimits              = parameters.IgnoreRowLimits;
            SortVariables                = parameters.SortVariables;

            //from ColumnChartGadgetParametersBase
            UseDiffColors = parameters.UseDiffColors;
            Composition   = parameters.Composition;
            //BarSpacing = parameters.BarSpacing;
            Orientation = parameters.Orientation;
            BarKind     = parameters.BarKind;

            //from ChartGadgetParametersBase
            //Advanced options
            ChartWidth  = parameters.ChartWidth;
            ChartHeight = parameters.ChartHeight;
            Y2AxisType  = parameters.Y2AxisType;

            //Display options
            //  Color and styles
            UseRefValues      = parameters.UseRefValues;
            ShowAnnotations   = parameters.ShowAnnotations;
            Y2ShowAnnotations = parameters.Y2ShowAnnotations;
            ShowGridLines     = parameters.ShowGridLines;
            Palette           = parameters.Palette;
            //Y2LineType = parameters.Y2LineType;
            Y2LineDashStyle = parameters.Y2LineDashStyle;
            Y2LineThickness = parameters.Y2LineThickness;
            //  Labels
            YAxisLabel        = parameters.YAxisLabel;
            YAxisFormat       = parameters.YAxisFormat;
            Y2AxisLabel       = parameters.Y2AxisLabel;
            Y2AxisLegendTitle = parameters.Y2AxisLegendTitle;
            Y2AxisFormat      = parameters.Y2AxisFormat;
            XAxisLabelType    = parameters.XAxisLabelType;
            XAxisLabel        = parameters.XAxisLabel;
            XAxisAngle        = parameters.XAxisAngle;
            ChartTitle        = parameters.ChartTitle;
            ChartSubTitle     = parameters.ChartSubTitle;
            ChartStrataTitle  = parameters.ChartStrataTitle;
            //  Legend
            ShowLegend         = parameters.ShowLegend;
            ShowLegendBorder   = parameters.ShowLegendBorder;
            ShowLegendVarNames = parameters.ShowLegendVarNames;
            //LegendFontSize in ChartGadgetParametersBase.cs
            LegendDock         = parameters.LegendDock;
            YAxisFontSize      = parameters.YAxisFontSize;
            YAxisLabelFontSize = parameters.YAxisLabelFontSize;
            XAxisFontSize      = parameters.XAxisFontSize;
            XAxisLabelFontSize = parameters.XAxisLabelFontSize;
            PaletteColors      = parameters.PaletteColors;
        }
        public ParetoChartProperties(
            DashboardHelper dashboardHelper, 
            IGadget gadget, 
            ParetoChartParameters parameters, 
            List<Grid> strataGridList
            )
        {
            InitializeComponent();
            this.DashboardHelper = dashboardHelper;
            this.Gadget = gadget;
            this.Parameters = parameters;
            this.StrataGridList = strataGridList;

            List<string> fields = new List<string>();
            List<string> weightFields = new List<string>();
            List<string> strataItems = new List<string>();

            //Variable fields
            fields.Add(String.Empty);
            ColumnDataType columnDataType = ColumnDataType.Boolean | ColumnDataType.DateTime | ColumnDataType.Numeric | ColumnDataType.Text | ColumnDataType.UserDefined;
            foreach (string fieldName in DashboardHelper.GetFieldsAsList(columnDataType))
            {
                if (DashboardHelper.IsUsingEpiProject)
                {
                    if (!(fieldName == "RecStatus")) fields.Add(fieldName);
                }
                else
                {
                    fields.Add(fieldName);
                }
            }
            cmbField.ItemsSource = fields;

            //Weight Fields
            weightFields.Add(String.Empty);
            columnDataType = ColumnDataType.Numeric | ColumnDataType.UserDefined;
            foreach (string fieldName in DashboardHelper.GetFieldsAsList(columnDataType))
            {
                if (DashboardHelper.IsUsingEpiProject)
                {
                    if (!(fieldName == "RecStatus")) weightFields.Add(fieldName);
                }
                else
                {
                    weightFields.Add(fieldName);
                }
            }
            weightFields.Sort();
            cmbFieldWeight.ItemsSource = weightFields;

            //Strata Fields
            strataItems.Add(String.Empty);
            columnDataType = ColumnDataType.Numeric | ColumnDataType.Boolean | ColumnDataType.Text | ColumnDataType.UserDefined;
            foreach (string fieldName in DashboardHelper.GetFieldsAsList(columnDataType))
            {
                if (DashboardHelper.IsUsingEpiProject)
                {
                    if (!(fieldName == "RecStatus" || fieldName == "FKEY" || fieldName == "GlobalRecordId")) strataItems.Add(fieldName);
                }
                else
                {
                    strataItems.Add(fieldName);
                }
            }

            cmbBarSpacing.SelectedIndex = 0;
            txtYAxisLabelValue.Text = "Count";
            txtXAxisLabelValue.Text = String.Empty;
            cmbLegendDock.SelectedIndex = 1;

            CollectionView view = (CollectionView)CollectionViewSource.GetDefaultView(cmbField.ItemsSource);
            PropertyGroupDescription groupDescription = new PropertyGroupDescription("VariableCategory");
            view.GroupDescriptions.Add(groupDescription);

            RowFilterControl = new RowFilterControl(this.DashboardHelper, Dialogs.FilterDialogMode.ConditionalMode, (gadget as ParetoChartGadget).DataFilters, true);
            RowFilterControl.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
            panelFilters.Children.Add(RowFilterControl);

            txtWidth.PreviewKeyDown += new KeyEventHandler(txtInput_PositiveIntegerOnly_PreviewKeyDown);
            txtHeight.PreviewKeyDown += new KeyEventHandler(txtInput_PositiveIntegerOnly_PreviewKeyDown);
            txtLegendFontSize.PreviewKeyDown += new KeyEventHandler(txtInput_PositiveIntegerOnly_PreviewKeyDown);
            txtXAxisAngle.PreviewKeyDown += new KeyEventHandler(txtInput_IntegerOnly_PreviewKeyDown);

            #region Translation

            #endregion // Translation
        }