示例#1
0
        private void ResetChart()
        {

            Dictionary<int, double> tempDic = GetDictionary();
            Dictionary<int, double> lastYearTempDic = GetLastYearDictionary();
            double total = GetTotal();
            double lastYearTotal = GetLastYearTotal();

            if (tempDic == null || tempDic.Count < 1)
                return;

            if (_isSelectedKilooMegaChanged)
                _kM = GetSelectedKilooMega();
            else
                _kM = Utils.Get_KilooMega(total);

            tempDic = Utils.Implement_KilooMega(KilooMega.One, _kM, tempDic);
            total = Utils.Implement_KilooMega(KilooMega.One, _kM, total);
            lastYearTempDic = Utils.Implement_KilooMega(KilooMega.One, _kM, lastYearTempDic);
            lastYearTotal = Utils.Implement_KilooMega(KilooMega.One, _kM, lastYearTotal);
            SetAxisRanges();
            Set_ItemSource(tempDic, lastYearTempDic, total, lastYearTotal);

            SetTitle();
            SetAxisLabel();
        }
        private void SetItemSources()
        {
            if (_qtyMatOutCollections == null || _valMatOutCollections == null)
                return;
            if (this.MainChart.Series.Count > _qtyMatOutCollections.Count)
            {
               // for (int c = 0; c < _qtyMatOutCollections.Count; c++)
             //       this.MainChart.Series.RemoveAt(this.MainChart.Series.Count - 1);
            }

            if (_isValue)
            {
                if (_valKm == KilooMega.None || _isSelectedKilooMegaChanged)
                {
                    KilooMega from = _valKm;
                    if (_isSelectedKilooMegaChanged)
                    {
                        _isSelectedKilooMegaChanged = false;
                        _valKm = GetSelectedKilooMega();
                    }
                    else
                        _valKm = Utils.Get_KilooMega(_maxMatVal);

                    _maxVal = Utils.Implement_KilooMega(from, _valKm, _maxVal);
                    _maxMatVal = Utils.Implement_KilooMega(from, _valKm, _maxMatVal);
                    foreach (string dn in _valMatOutCollections.Keys)
                        foreach (DateDoubleChartObj item in _valMatOutCollections[dn])
                            item.Value = Utils.Implement_KilooMega(from, _valKm, item.Value);
                }

                int counter = 0;
                foreach (string dn in _valMatOutCollections.Keys)
                {
                    LineSeries lsVal = new LineSeries();
                    lsVal.DependentRangeAxis = GetMatOutAxis(counter == _valMatOutCollections.Count - 1, _maxMatVal + (_maxMatVal / 8), true, _valKm);
                    Style style = Application.Current.Resources["LineDataPointStyle0" + Utils.GetStyleNumber(dn, 0)] as Style;
                    lsVal.DataPointStyle = style;
                    lsVal.DependentValueBinding = new System.Windows.Data.Binding("Value");
                    lsVal.IndependentValueBinding = new System.Windows.Data.Binding("Date");
                    lsVal.LegendItemStyle = Application.Current.Resources["NoLegendItem"] as Style;
                    lsVal.ItemsSource = _valMatOutCollections[dn];
                    this.MainChart.Series.Add(lsVal);
                    counter++;
                }
            }
            else
            {
                if (_qtyKm == KilooMega.None || _isSelectedKilooMegaChanged)
                {
                    KilooMega from = _qtyKm;
                    if (_isSelectedKilooMegaChanged)
                    {
                        _isSelectedKilooMegaChanged = false;
                        _qtyKm = GetSelectedKilooMega();
                    }
                    else
                        _qtyKm = Utils.Get_KilooMega(_maxMatQty);

                    _maxQty = Utils.Implement_KilooMega(from, _qtyKm, _maxQty);
                    _maxMatQty = Utils.Implement_KilooMega(from, _qtyKm, _maxMatQty);
                    foreach (string dn in _qtyMatOutCollections.Keys)
                        foreach (DateDoubleChartObj item in _qtyMatOutCollections[dn])
                            item.Value = Utils.Implement_KilooMega(from, _qtyKm, item.Value);
                }

                int counter = 0;
                foreach (string dn in _qtyMatOutCollections.Keys)
                {
                    LineSeries lsQty = new LineSeries();
                    lsQty.DependentRangeAxis = GetMatOutAxis(counter == _qtyMatOutCollections.Count - 1, _maxMatQty + (_maxMatQty / 8), false, _qtyKm);
                    Style style = Application.Current.Resources["LineDataPointStyle0" + Utils.GetStyleNumber(dn, 0)] as Style;
                    lsQty.DataPointStyle = style;
                    lsQty.DependentValueBinding = new System.Windows.Data.Binding("Value");
                    lsQty.IndependentValueBinding = new System.Windows.Data.Binding("Date");
                    lsQty.LegendItemStyle = Application.Current.Resources["NoLegendItem"] as Style;
                    lsQty.ItemsSource = _qtyMatOutCollections[dn];
                    this.MainChart.Series.Add(lsQty);
                    counter++;
                }
            }
            EnableValueVolumRadios();
        }
示例#3
0
 private void Change_VAL_ItemSouces_For_KilooMega()
 {
     if (_valKM == KilooMega.None || _isSelectedKilooMegaChanged)
     {
         KilooMega from = _valKM;
         if (_isSelectedKilooMegaChanged)
         {
             _isSelectedKilooMegaChanged = false;
             _valKM = GetSelectedKilooMega();
         }
         else
         {
             double max = Utils.Get_MaximumValue_In_Two_Lists(_actualSales_ChartItemSource_VAL,_objective_ChartItemSource_VAL);
             _valKM = Utils.Get_KilooMega(max);
         }
         Utils.Implement_KilooMega(from, _valKM, _actualSales_ChartItemSource_VAL);
         Utils.Implement_KilooMega(from, _valKM, _actualMatOut_ChartItemSource_VAL);
         Utils.Implement_KilooMega(from, _valKM, _objective_ChartItemSource_VAL);
         Utils.Implement_KilooMega(from, _valKM, _objectiveMatOut_ChartItemSource_VAL);
     }
 }
        private void ChangeQtyItemSourcesAccToKilooMegaForYearsChart()
        {
            if (_yearsQtyKM == KilooMega.None || _isSelectedKilooMegaChanged2)
            {
                KilooMega selectedKilooMega = GetSelectedKilooMega2();
                KilooMega from = _yearsQtyKM;
                if (_isSelectedKilooMegaChanged2 || selectedKilooMega != KilooMega.None)
                {
                    _isSelectedKilooMegaChanged2 = false;
                    _yearsQtyKM = GetSelectedKilooMega2();
                }
                else
                {
                    SetUnitCombobox2();
                    _yearsQtyKM = Utils.Get_KilooMega(_yearsQtyMax);   
                }

                _yearsQtyMax = Utils.Implement_KilooMega(from, _yearsQtyKM, _yearsQtyMax);
                foreach (YTDYearItem item in _thisYearColQty)
                    item.YAxisValue = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _yearsQtyKM, item.YAxisValue));
                foreach (YTDYearItem item in _lastYearColQty)
                    item.YAxisValue = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _yearsQtyKM, item.YAxisValue));
            }
        }
 private LinearAxis GetMatOutAxis(bool visible, double maximum, bool isValue, KilooMega km)
 {
     LinearAxis la = new LinearAxis();
     la.Title = "Sales Out " + Utils.GetUnitLabel_Long(_productBrand, isValue, km);
     la.Orientation = AxisOrientation.Y;
     la.Minimum = 0;
     la.Maximum = maximum;
     la.AxisLabelStyle = Application.Current.Resources["NumberFormatAxisStyle"] as Style;
     if (!visible)
     {
         la.Width = 0;
         la.Opacity = 0;
     }
     return la;
 }
示例#6
0
 private void Implement_KilooMega_For_QTY()
 {
     if (_qtyKM == KilooMega.None || _isSelectedKilooMegaChanged)
     {
         KilooMega from = _qtyKM;
         if (_isSelectedKilooMegaChanged)
         {
             _isSelectedKilooMegaChanged = false;
             _qtyKM = GetSelectedKilooMega();
         }
         else
         {
             double max = 0;
             foreach (YTDYTGGridObj item in _qtyViewSource)
             {
                 if (item.YTD > max)
                     max = item.YTD;
             }
             _qtyKM = Utils.Get_KilooMega(max);
         }
         _maxProvinceQty = Utils.Round_to_One_Fraction(Utils.Implement_KilooMega(from, _qtyKM, _maxProvinceQty));
         _maxProvinceObjQty = Utils.Round_to_One_Fraction(Utils.Implement_KilooMega(from, _qtyKM, _maxProvinceObjQty));
         foreach (YTDYTGGridObj item in _qtyViewSource)
         {
             item.YTD = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _qtyKM, item.YTD));
             item.YTDLastYear = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _qtyKM, item.YTDLastYear));
             item.YTG = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _qtyKM, item.YTG));
             item.YTGLastYear = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _qtyKM, item.YTGLastYear));
         }
     }
 }
        private void ChangeQtyItemSourcesAccToKilooMegaForQuartersChart()
        {
            if (_quartersQtyKM == KilooMega.None || _isSelectedKilooMegaChanged)
            {
                KilooMega selectedKilooMega = GetSelectedKilooMega();
                KilooMega from = _quartersQtyKM;
                if (_isSelectedKilooMegaChanged || selectedKilooMega != KilooMega.None)
                {
                    _isSelectedKilooMegaChanged = false;
                    _quartersQtyKM = GetSelectedKilooMega();
                }
                else
                {
                    SetUnitCombobox();
                    _quartersQtyKM = Utils.Get_KilooMega(_quartersQtyMax);
                }

                foreach (QuarterStackItem item in _actualQ1Qty)
                    item.YAxisValue = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _quartersQtyKM, item.YAxisValue));
                foreach (QuarterStackItem item in _actualQ2Qty)
                    item.YAxisValue = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _quartersQtyKM, item.YAxisValue));
                foreach (QuarterStackItem item in _actualQ3Qty)
                    item.YAxisValue = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _quartersQtyKM, item.YAxisValue));
                foreach (QuarterStackItem item in _actualQ4Qty)
                    item.YAxisValue = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _quartersQtyKM, item.YAxisValue));
                foreach (QuarterStackItem item in _objectiveQ1Qty)
                    item.YAxisValue = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _quartersQtyKM, item.YAxisValue));
                foreach (QuarterStackItem item in _objectiveQ2Qty)
                    item.YAxisValue = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _quartersQtyKM, item.YAxisValue));
                foreach (QuarterStackItem item in _objectiveQ3Qty)
                    item.YAxisValue = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _quartersQtyKM, item.YAxisValue));
                foreach (QuarterStackItem item in _objectiveQ4Qty)
                    item.YAxisValue = Utils.Round_to_One_Fraction_Except_Zero(Utils.Implement_KilooMega(from, _quartersQtyKM, item.YAxisValue));
            }
        }
示例#8
0
 public static double Implement_KilooMega(KilooMega from, KilooMega to, double value)
 {
     if (to == KilooMega.None)
         return value;
     if (from == KilooMega.One || from == KilooMega.None)
     {
         if (to == KilooMega.Mega)
             return value / 1000000;
         else if (to == KilooMega.Kiloo)
             return value / 1000;
     }
     else if (from == KilooMega.Kiloo)
     {
         if (to == KilooMega.One)
             return value * 1000;
         else if (to == KilooMega.Mega)
             return value / 1000;
     }
     else if (from == KilooMega.Mega)
     {
         if (to == KilooMega.One)
             return value * 1000000;
         else if (to == KilooMega.Kiloo)
             return value * 1000;
     }
     return value;
 }
示例#9
0
 public static Dictionary<int, double> Implement_KilooMega(KilooMega from, KilooMega to, Dictionary<int, double> dic)
 {
     Dictionary<int, double> temp = new Dictionary<int, double>();
     foreach (int key in dic.Keys)
         temp.Add(key, Utils.Implement_KilooMega(from, to, dic[key]));
     return temp;
 }
示例#10
0
 public static void Implement_KilooMega(KilooMega from, KilooMega to, ObservableCollection<DateDoubleChartObj> list)
 {
     foreach (DateDoubleChartObj item in list)
         item.Value = Utils.Implement_KilooMega(from, to, item.Value);
 }
示例#11
0
 public static string GetUnitLabel_Long(SanofiProductBrands product, bool isvalue, KilooMega KM)
 {
     string valUnit = "(Euro)";
     if (KM == KilooMega.Kiloo)
         valUnit = "(KEuro)";
     else if (KM == KilooMega.Mega)
         valUnit = "(MEuro)";
     string qtyUnit = "";
     if (KM == KilooMega.Kiloo)
         qtyUnit = "(000)";
     else if (KM == KilooMega.Mega)
         qtyUnit = "(000,000)";
     switch (product)
     {
         case SanofiProductBrands.Clexane:
             return "Value " + valUnit;
         case SanofiProductBrands.Eloxatin:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume (Equ. 100)" + qtyUnit;
         case SanofiProductBrands.Lantus:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Plavix:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "QTY (BOX 28)" + qtyUnit;
         case SanofiProductBrands.Targocid:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume (Equ. 400)" + qtyUnit;
         case SanofiProductBrands.Taxotere:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume (Equ. 80)" + qtyUnit;
         case SanofiProductBrands.Telfast:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Depakine:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         /*case SanofiProductBrands.Epilim:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;*/
         case SanofiProductBrands.Jevtana:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Primacor:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Thymo:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Renagel:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Stilnox:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Phenergan:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Rilutek:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Fludara:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Evoltra:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Suprefact:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Glucantime:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Trental:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Mozobil:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Apidra:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.TotalProducts:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Cardio:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Onco:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Diabetes:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.CNS:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.CHC:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.Antibiotic:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.OtherEthical:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
         case SanofiProductBrands.OtherProducts:
             if (isvalue)
                 return "Value " + valUnit;
             else
                 return "Volume " + qtyUnit;
     }
     return "";
 }
示例#12
0
 private void F1Combo_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     switch ((sender as ComboBox).SelectedIndex)
     {
         case 0:
             DBUtils.SetUserF1Month(4);
             break;
         case 1:
             DBUtils.SetUserF1Month(7);
             break;
     }
     _qtyKM = KilooMega.None;
     _valKM = KilooMega.None;
     if (GetSelectedKilooMega() != KilooMega.None)
         _isSelectedKilooMegaChanged = true;
     SetChartWithLoadedData();
 }
示例#13
0
        private void Implement_KilooMega_For_QTY()
        {
            if (_qtyKM == KilooMega.None || _isSelectedKilooMegaChanged)
            {
                KilooMega from = _qtyKM;
                if (_isSelectedKilooMegaChanged)
                {
                    _isSelectedKilooMegaChanged = false;
                    _qtyKM = GetSelectedKilooMega();
                }
                else
                {
                    double max = Utils.Get_MaximumValue_InListOfLists(new object[] { _actualSales_ChartItemSource_QTY, _objective_ChartItemSource_QTY, _salesIn_ChartItemSource_QTY, _f01_ChartItemSource_QTY, _f02_ChartItemSource_QTY, _budget_ChartItemSource_QTY });
                    _maxY = max;
                    _qtyKM = Utils.Get_KilooMega(max);
                }

                Utils.Implement_KilooMega(from, _qtyKM, _actualSales_ChartItemSource_QTY);
                Utils.Implement_KilooMega(from, _qtyKM, _objective_ChartItemSource_QTY);
                Utils.Implement_KilooMega(from, _qtyKM, _budgetMatOut_ChartItemSource_QTY);
                Utils.Implement_KilooMega(from, _qtyKM, _f01MatOut_ChartItemSource_QTY);
                Utils.Implement_KilooMega(from, _qtyKM, _f02MatOut_ChartItemSource_QTY);
                Utils.Implement_KilooMega(from, _qtyKM, _actualMatOut_ChartItemSource_QTY);
                Utils.Implement_KilooMega(from, _qtyKM, _salesIn_ChartItemSource_QTY);
                Utils.Implement_KilooMega(from, _qtyKM, _salesInMat_ChartItemSource_QTY);
                Utils.Implement_KilooMega(from, _qtyKM, _salesInObjectiveMat_ChartItemSource_QTY);
                Utils.Implement_KilooMega(from, _qtyKM, _f01_ChartItemSource_QTY);
                Utils.Implement_KilooMega(from, _qtyKM, _f02_ChartItemSource_QTY);
                Utils.Implement_KilooMega(from, _qtyKM, _budget_ChartItemSource_QTY);
                _maxY = Utils.Implement_KilooMega(from, _qtyKM, _maxY);
                _minY = Utils.Implement_KilooMega(from, _valKM, _minY);
            }
        }
示例#14
0
 private void InitializeKilooMega()
 {
     _valKM = KilooMega.None;
     _qtyKM = KilooMega.None;
 }
        private void SetItemSources()
        {
            if (this.Stack == null || this.Stack.SeriesDefinitions == null)
                return;
            int count = this.Stack.SeriesDefinitions.Count;
            for (int c = 0; c < count; c++)
                this.Stack.SeriesDefinitions.RemoveAt(this.Stack.SeriesDefinitions.Count - 1);

            if (_isValue)
            {

                if (_valKm == KilooMega.None || _isSelectedKilooMegaChanged)
                {
                    KilooMega from = _valKm;
                    if (_isSelectedKilooMegaChanged)
                    {
                        _isSelectedKilooMegaChanged = false;
                        _valKm = GetSelectedKilooMega();
                    }
                    else
                    {
                        SetUnitCombobox();
                        _valKm = Utils.Get_KilooMega(_maxVal);
                    }

                    _maxVal = Utils.Implement_KilooMega(from, _valKm, _maxVal);
                    foreach (string dn in _valViewSource.Keys)
                        foreach (StringDoubleStringChartObj item in _valViewSource[dn])
                        {
                            double value = Utils.Implement_KilooMega(from, _valKm, item.YAxisValue);
                            item.YAxisValue = value;
                        }

                    for (int i = 0; i < _quartersMaxVal.Count; i++)
                        _quartersMaxVal[_quartersMaxVal.Keys.ElementAt<string>(i)] = Utils.Implement_KilooMega(from, _valKm, _quartersMaxVal[_quartersMaxVal.Keys.ElementAt<string>(i)]);
                }

                int counter = 0;
                foreach (string ch in _valViewSource.Keys)
                {
                    foreach (StringDoubleStringChartObj item in _valViewSource[ch])
                        item.ExtraInfo = Utils.Round_to_One_Fraction_Except_Zero((item.YAxisValue / _quartersMaxVal[item.XAxisValue]) * 100) + " %";

                    SeriesDefinition sd = new SeriesDefinition();
                    sd.IndependentValueBinding = new System.Windows.Data.Binding("XAxisValue");
                    sd.DependentValueBinding = new System.Windows.Data.Binding("YAxisValue");
                    sd.Title = ch;
                    Style style = Application.Current.Resources["ColumnStyle" + Utils.GetStyleNumber(ch, counter)] as Style;
                    sd.DataPointStyle = style;
                    sd.ItemsSource = _valViewSource[ch];
                    this.Stack.SeriesDefinitions.Add(sd);
                    counter++;
                }
            }
            else
            {

                if (_qtyKm == KilooMega.None || _isSelectedKilooMegaChanged)
                {
                    KilooMega from = _qtyKm;
                    if (_isSelectedKilooMegaChanged)
                    {
                        _isSelectedKilooMegaChanged = false;
                        _qtyKm = GetSelectedKilooMega();
                    }
                    else
                    {
                        SetUnitCombobox();
                        _qtyKm = Utils.Get_KilooMega(_maxQty);
                    }

                    _maxQty = Utils.Implement_KilooMega(from, _qtyKm, _maxQty);
                    foreach (string dn in _qtyViewSource.Keys)
                        foreach (StringDoubleStringChartObj item in _qtyViewSource[dn])
                        {
                            double value = Utils.Implement_KilooMega(from, _qtyKm, item.YAxisValue);
                            item.YAxisValue = value;
                        }

                    for (int i = 0; i < _quartersMaxQty.Count; i++)
                        _quartersMaxQty[_quartersMaxQty.Keys.ElementAt<string>(i)] = Utils.Implement_KilooMega(from, _qtyKm, _quartersMaxQty[_quartersMaxQty.Keys.ElementAt<string>(i)]);
                }
                int counter = 0;
                foreach (string ch in _qtyViewSource.Keys)
                {
                    foreach (StringDoubleStringChartObj item in _qtyViewSource[ch])
                        item.ExtraInfo = Utils.Round_to_One_Fraction_Except_Zero((item.YAxisValue / _quartersMaxQty[item.XAxisValue]) * 100) + " %";

                    SeriesDefinition sd = new SeriesDefinition();
                    sd.IndependentValueBinding = new System.Windows.Data.Binding("XAxisValue");
                    sd.DependentValueBinding = new System.Windows.Data.Binding("YAxisValue");
                    Style style = Application.Current.Resources["ColumnStyle" + Utils.GetStyleNumber(ch, counter)] as Style;
                    sd.DataPointStyle = style;
                    sd.Title = ch;
                    sd.ItemsSource = _qtyViewSource[ch];
                    this.Stack.SeriesDefinitions.Add(sd);
                    counter++;
                }
            }
            SetAxisLabel();
            EnableValueVolumRadios();
        }
示例#16
0
 private void InitializeKilooMegas()
 {
     _quartersQtyKM = KilooMega.None;
     _quartersValKM = KilooMega.None;
     _yearsQtyKM = KilooMega.None;
     _yearsValKM = KilooMega.None;
 }
 private void InitializeKilooMega()
 {
     _qtyKm = KilooMega.None;
     _valKm = KilooMega.None;
 }
        private void SetItemSources2()
        {
            if (this.Stack2 == null || this.Stack2.SeriesDefinitions == null)
                return;
            int count = this.Stack2.SeriesDefinitions.Count;
            for (int c = 0; c < count; c++)
                this.Stack2.SeriesDefinitions.RemoveAt(this.Stack2.SeriesDefinitions.Count - 1);

            if (_isValue)
            {
                if (_valKm2 == KilooMega.None || _isSelectedKilooMegaChanged)
                {
                    KilooMega from = _valKm2;
                    if (_isSelectedKilooMegaChanged)
                    {
                        _isSelectedKilooMegaChanged = false;
                        _valKm2 = GetSelectedKilooMega();
                    }
                    else
                        _valKm2 = Utils.Get_KilooMega(_maxVal2);
                    _maxVal2 = Utils.Implement_KilooMega(from, _valKm2, _maxVal2);
                    foreach (string dn in _valCollections2.Keys)
                        foreach (DistributorObj item in _valCollections2[dn])
                            item.YAxisValue = Utils.Implement_KilooMega(from, _valKm2, item.YAxisValue);
                }

                int counter = 0;
                foreach (string dn in _valCollections2.Keys)
                {
                    SeriesDefinition sd = new SeriesDefinition();
                    sd.IndependentValueBinding = new System.Windows.Data.Binding("XAxisValue");
                    sd.DependentValueBinding = new System.Windows.Data.Binding("YAxisValue");
                    sd.Title = dn;
                    Style style = Application.Current.Resources["ColumnStyle" + Utils.GetStyleNumber(dn, 0)] as Style;
                    sd.DataPointStyle = style;
                    sd.ItemsSource = _valCollections2[dn];
                    this.Stack2.SeriesDefinitions.Add(sd);
                    counter++;
                }
            }
            else
            {

                if (_qtyKm2 == KilooMega.None || _isSelectedKilooMegaChanged)
                {
                    KilooMega from = _qtyKm2;
                    if (_isSelectedKilooMegaChanged)
                    {
                        _isSelectedKilooMegaChanged = false;
                        _qtyKm2 = GetSelectedKilooMega();
                    }
                    else
                        _qtyKm2 = Utils.Get_KilooMega(_maxQty2);
                    _maxQty2 = Utils.Implement_KilooMega(from, _qtyKm2, _maxQty2);
                    foreach (string dn in _qtyCollections2.Keys)
                        foreach (DistributorObj item in _qtyCollections2[dn])
                            item.YAxisValue = Utils.Implement_KilooMega(from, _qtyKm2, item.YAxisValue);
                }

                int counter = 0;
                foreach (string dn in _qtyCollections2.Keys)
                {
                    SeriesDefinition sd = new SeriesDefinition();
                    sd.IndependentValueBinding = new System.Windows.Data.Binding("XAxisValue");
                    sd.DependentValueBinding = new System.Windows.Data.Binding("YAxisValue");
                    Style style = Application.Current.Resources["ColumnStyle" + Utils.GetStyleNumber(dn, 0)] as Style;
                    sd.DataPointStyle = style;
                    sd.Title = dn;
                    sd.ItemsSource = _qtyCollections2[dn];
                    this.Stack2.SeriesDefinitions.Add(sd);
                    counter++;
                }
            }
            SetAxisLabel2();
            EnableValueVolumRadios();
        }