Exemple #1
0
        /// <summary>
        /// Returns an x-axis that is suitable for drawing this plot.
        /// </summary>
        /// <returns>A suitable x-axis.</returns>
        public Axis SuggestXAxis()
        {
            SequenceAdapter data_ =
                new SequenceAdapter(this.DataSource, this.DataMember, this.OrdinateData, this.AbscissaData);

            return(data_.SuggestXAxis());
        }
Exemple #2
0
        /// <summary>
        /// Returns an x-axis that is suitable for drawing this plot.
        /// </summary>
        /// <returns>A suitable x-axis.</returns>
        public Axis SuggestXAxis()
        {
            SequenceAdapter data =
                new SequenceAdapter(this.DataSource, this.DataMember, this.OrdinateData, this.AbscissaData);

            Axis a = data.SuggestXAxis();

            if (data.Count == 0)
            {
                return(a);
            }

            PointD p1;
            PointD p2;
            PointD p3;
            PointD p4;

            if (data.Count < 2)
            {
                p1    = data[0];
                p1.X -= 1.0;
                p2    = data[0];
                p3    = p1;
                p4    = p2;
            }
            else
            {
                p1 = data[0];
                p2 = data[1];
                p3 = data[data.Count - 2];
                p4 = data[data.Count - 1];
            }

            double offset1;
            double offset2;

            if (!center_)
            {
                offset1 = 0.0f;
                offset2 = p4.X - p3.X;
            }
            else
            {
                offset1 = (p2.X - p1.X) / 2.0f;
                offset2 = (p4.X - p3.X) / 2.0f;
            }

            a.WorldMin -= offset1;
            a.WorldMax += offset2;

            return(a);
        }
Exemple #3
0
        /// <summary>
        /// Returns an x-axis that is suitable for drawing this plot.
        /// </summary>
        /// <returns>A suitable x-axis.</returns>
        public Axis SuggestXAxis()
        {
            SequenceAdapter dataBottom_ =
                new SequenceAdapter(this.DataSource, this.DataMember, this.OrdinateDataBottom, this.AbscissaData);

            SequenceAdapter dataTop_ =
                new SequenceAdapter(this.DataSource, this.DataMember, this.OrdinateDataTop, this.AbscissaData);

            Axis axis = dataTop_.SuggestXAxis();

            axis.LUB(dataBottom_.SuggestXAxis());
            return(axis);
        }
Exemple #4
0
        /// <summary>
        /// Returns an x-axis that is suitable for drawing this plot.
        /// </summary>
        /// <returns>A suitable x-axis.</returns>
        public Axis SuggestXAxis()
        {
            SequenceAdapter dataBottom_ =
                new SequenceAdapter( this.DataSource, this.DataMember, this.OrdinateDataBottom, this.AbscissaData );

            SequenceAdapter dataTop_ =
                new SequenceAdapter( this.DataSource, this.DataMember, this.OrdinateDataTop, this.AbscissaData );

            Axis axis = dataTop_.SuggestXAxis();
            axis.LUB(dataBottom_.SuggestXAxis());
            return axis;
        }
        /// <summary>
        /// Returns an x-axis that is suitable for drawing this plot.
        /// </summary>
        /// <returns>A suitable x-axis.</returns>
        public Axis SuggestXAxis()
        {
            SequenceAdapter data_ =
                new SequenceAdapter( this.DataSource, this.DataMember, this.OrdinateData, this.AbscissaData );

            return data_.SuggestXAxis();
        }
        /// <summary>
        /// Returns an x-axis that is suitable for drawing this plot.
        /// </summary>
        /// <returns>A suitable x-axis.</returns>
        public Axis SuggestXAxis()
        {
            SequenceAdapter data =
                new SequenceAdapter( this.DataSource, this.DataMember, this.OrdinateData, this.AbscissaData );

            Axis a = data.SuggestXAxis();
            if (data.Count==0)
            {
                return a;
            }

            PointD p1;
            PointD p2;
            PointD p3;
            PointD p4;
            if (data.Count < 2)
            {
                p1 = data[0];
                p1.X -= 1.0;
                p2 = data[0];
                p3 = p1;
                p4 = p2;
            }
            else
            {
                p1 = data[0];
                p2 = data[1];
                p3 = data[data.Count-2];
                p4 = data[data.Count-1];
            }

            double offset1;
            double offset2;

            if (!center_)
            {
                offset1 = 0.0f;
                offset2 = p4.X - p3.X;
            }
            else
            {
                offset1 = (p2.X - p1.X)/2.0f;
                offset2 = (p4.X - p3.X)/2.0f;
            }

            a.WorldMin -= offset1;
            a.WorldMax += offset2;

            return a;
        }