Ejemplo n.º 1
0
        public override void Resize(int nX, int nY, int nWidth, int nHeight)
        {
            m_rcBounds = new Rectangle(nX, nY, nWidth, nHeight);

            m_rgTickPositions = new List <int>();

            for (int x = m_rcBounds.Right - m_config.PlotSpacing; x >= m_rcBounds.Left; x -= m_config.PlotSpacing)
            {
                if (x >= m_rcBounds.Left)
                {
                    m_rgTickPositions.Insert(0, x);
                }
            }

            m_rgTickValues = new List <TickValue>();

            if (m_data.Count == 0)
            {
                return;
            }

            PlotCollection primaryPlot = m_data[m_config.DataIndexForAxisLabel];

            if (m_rgTickPositions.Count < primaryPlot.Count)
            {
                m_nStartPosition = primaryPlot.Count - m_rgTickPositions.Count;
            }

            for (int i = StartPosition; i < primaryPlot.Count; i++)
            {
                double    dfLast = (i == 0) ? 0 : primaryPlot[i - 1].X;
                TickValue tv     = new TickValue(primaryPlot[i], TickValue.TYPE.X, m_config, dfLast, ref m_nDayCount, ref m_nDayLast);
                m_rgTickValues.Add(tv);
                if (m_rgTickValues.Count == m_rgTickPositions.Count)
                {
                    break;
                }
            }

            if (m_data.Count > 0)
            {
                int nCount = m_rgTickPositions.Count;
                if (nCount == 0)
                {
                    nCount = m_data[0].Count;
                }

                m_data.GetMinMaxOverWindow(StartPosition, m_rgTickPositions.Count, out m_dfMin, out m_dfMinY, out m_dfMax, out m_dfMaxY, out m_dfAbsMinY, out m_dfAbsMaxY);
            }
        }
Ejemplo n.º 2
0
 public TickValueArg(TickValue val, int nX)
 {
     m_tickValue = val;
     m_nX        = nX;
 }