Exemplo n.º 1
0
 public void CopyFrom(FormulaAxisX fax)
 {
     this.Visible            = fax.Visible;
     this.DateFormatProvider = fax.DateFormatProvider;
     this.AutoScale          = fax.AutoScale;
     this.Format             = fax.Format;
     this.MajorTick          = (FormulaTick)fax.MajorTick.Clone();
     this.MinorTick          = (FormulaTick)fax.MinorTick.Clone();
     this.Back           = (FormulaBack)fax.Back.Clone();
     this.LabelFont      = (Font)fax.LabelFont.Clone();
     this.LabelBrush     = (Brush)fax.LabelBrush.Clone();
     this.AxisLabelAlign = fax.AxisLabelAlign;
     this.DataCycle      = fax.DataCycle;
 }
Exemplo n.º 2
0
 public FormulaSkin()
 {
     Brush[] brushArray = new Brush[3];
     brushArray[2]       = Brushes.Blue;
     this.BarBrushes     = brushArray;
     this.NameBrush      = new SolidBrush(Color.Black);
     this.NameFont       = new Font("Verdana", 7f);
     this.TextFont       = new Font("Verdana", 7f);
     this.CursorPen      = new Pen(Color.Black);
     this.ShowValueLabel = true;
     this.AxisX          = new FormulaAxisX();
     this.AxisXs         = new AxisXCollection();
     this.AxisXs.Add(this.AxisX);
     this.AxisY = new FormulaAxisY();
     this.Back  = new FormulaBack();
 }
Exemplo n.º 3
0
 public virtual void Add(FormulaAxisX fax)
 {
     base.List.Add(fax);
 }
Exemplo n.º 4
0
 public void Remove(FormulaAxisX value)
 {
     base.List.Remove(value);
 }
Exemplo n.º 5
0
        public void DrawXAxisTick(FormulaCanvas Canvas, double[] Date, FormulaData fdDate, PointF[] pfs, FormulaAxisX fax, ExchangeIntraday ei)
        {
            if (this.DataCycle != null)
            {
                int      num          = 0;
                int      sequence     = 0;
                string   str          = "";
                int      num3         = -10000;
                int      num4         = -1;
                Graphics currentGraph = Canvas.CurrentGraph;
                double   num5         = 0.0;
                if (Date.Length > 0)
                {
                    num5 = Date[Date.Length - 1] - Date[0];
                }
                double[] numArray = Date;
                if ((ei != null) && ei.NativeCycle)
                {
                    numArray = new double[Date.Length];
                    for (int j = 0; j < numArray.Length; j++)
                    {
                        numArray[j] = ((int)Date[j]) + ei.OneDayTime(Date[j]);
                    }
                }
                for (int i = pfs.Length - 1; i >= 0; i--)
                {
                    int      index = ((Date.Length - 1) - Canvas.Start) - i;
                    double   d     = Date[index];
                    DateTime time  = DateTime.FromOADate(d);
                    sequence = this.DataCycle.GetSequence(numArray[index]);
                    if (sequence != num)
                    {
                        PointF tf = pfs[i];
                        num = sequence;
                        if (this.ShowLine)
                        {
                            int bottom = Canvas.Rect.Bottom;
                            if (!fax.Visible)
                            {
                                bottom = Canvas.FrameRect.Bottom;
                            }
                            currentGraph.DrawLine(this.LinePen, tf.X, (float)Canvas.FrameRect.Top, tf.X, (float)bottom);
                        }
                        if (fax.Visible && this.ShowTick)
                        {
                            int tickWidth = this.TickWidth;
                            if (this.FullTick)
                            {
                                tickWidth = fax.Rect.Height;
                            }
                            if (this.Inside)
                            {
                                tickWidth = -tickWidth;
                            }
                            currentGraph.DrawLine(this.TickPen, tf.X, (float)fax.Rect.Top, tf.X, (float)(tickWidth + fax.Rect.Top));
                        }
                        string text       = time.ToString(this.Format, this.DateFormatProvider);
                        int    startIndex = text.IndexOf('{');
                        int    num13      = text.IndexOf('}');
                        if (num13 > startIndex)
                        {
                            string str2 = text.Substring(startIndex + 1, (num13 - startIndex) - 1);
                            if (str2 != str)
                            {
                                text = text.Remove(startIndex, 1).Remove(num13 - 1, 1);
                            }
                            else
                            {
                                text = text.Substring(0, startIndex) + text.Substring(num13 + 1);
                            }
                            str = str2;
                        }
                        Font  labelFont = fax.LabelFont;
                        float width     = currentGraph.MeasureString(text, labelFont).Width;
                        float x         = tf.X;
                        switch (fax.AxisLabelAlign)
                        {
                        case AxisLabelAlign.TickCenter:
                            x -= width / 2f;
                            break;

                        case AxisLabelAlign.TickLeft:
                            x -= width;
                            break;
                        }
                        if (x < fax.Rect.Left)
                        {
                            x = fax.Rect.Left;
                        }
                        if ((fax.Visible && this.ShowText) && ((num3 + this.MinimumPixel) < x))
                        {
                            if (((ei == null) || ei.ShowFirstXLabel) || ((i < (pfs.Length - 1)) || (num5 > 1.0)))
                            {
                                currentGraph.DrawString(text, labelFont, fax.LabelBrush, x, (float)fax.Rect.Top);
                                num3 = (int)(x + width);
                            }
                            num4 = i;
                        }
                    }
                }
            }
        }