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

            return(data_.SuggestYAxis());
        }
Exemple #2
0
        /// <summary>
        /// Returns a y-axis that is suitable for drawing this plot.
        /// </summary>
        /// <returns>A suitable y-axis.</returns>
        public Axis SuggestYAxis()
        {
            SequenceAdapter dataBottom_ = new SequenceAdapter(DataSource, DataMember, OrdinateDataBottom, AbscissaData);
            SequenceAdapter dataTop_    = new SequenceAdapter(DataSource, DataMember, OrdinateDataTop, AbscissaData);

            Axis axis = dataTop_.SuggestYAxis();

            axis.LUB(dataBottom_.SuggestYAxis());
            return(axis);
        }
Exemple #3
0
        /// <summary>
        /// Returns a y-axis that is suitable for drawing this plot.
        /// </summary>
        /// <returns>A suitable y-axis.</returns>
        public Axis SuggestYAxis()
        {
            if (IsStacked)
            {
                double    tmpMax      = 0.0f;
                ArrayList adapterList = new ArrayList();

                HistogramPlot currentPlot = this;
                do
                {
                    adapterList.Add(new SequenceAdapter(
                                        currentPlot.DataSource,
                                        currentPlot.DataMember,
                                        currentPlot.OrdinateData,
                                        currentPlot.AbscissaData)
                                    );
                } while ((currentPlot = currentPlot.stackedTo) != null);

                SequenceAdapter[] adapters = (SequenceAdapter[])adapterList.ToArray(typeof(SequenceAdapter));

                for (int i = 0; i < adapters[0].Count; ++i)
                {
                    double tmpHeight = 0.0f;
                    for (int j = 0; j < adapters.Length; ++j)
                    {
                        tmpHeight += adapters[j][i].Y;
                    }
                    tmpMax = Math.Max(tmpMax, tmpHeight);
                }

                Axis a = new LinearAxis(0.0, tmpMax);
                // TODO make 0.08 a parameter.
                a.IncreaseRange(0.08);
                return(a);
            }
            else
            {
                SequenceAdapter data = new SequenceAdapter(DataSource, DataMember, OrdinateData, AbscissaData);
                return(data.SuggestYAxis());
            }
        }
Exemple #4
0
 /// <summary>
 /// Returns a y-axis that is suitable for drawing this plot.
 /// </summary>
 /// <returns>A suitable y-axis.</returns>
 public Axis SuggestYAxis()
 {
     SequenceAdapter data_ =
         new SequenceAdapter (DataSource, DataMember, OrdinateData, AbscissaData);
     return data_.SuggestYAxis();
 }
Exemple #5
0
        /// <summary>
        /// Returns a y-axis that is suitable for drawing this plot.
        /// </summary>
        /// <returns>A suitable y-axis.</returns>
        public Axis SuggestYAxis()
        {
            if (IsStacked) {
                double tmpMax = 0.0f;
                ArrayList adapterList = new ArrayList();

                HistogramPlot currentPlot = this;
                do {
                    adapterList.Add (new SequenceAdapter (
                        currentPlot.DataSource,
                        currentPlot.DataMember,
                        currentPlot.OrdinateData,
                        currentPlot.AbscissaData)
                    );
                } while ((currentPlot = currentPlot.stackedTo) != null);

                SequenceAdapter[] adapters = (SequenceAdapter[])adapterList.ToArray (typeof(SequenceAdapter));

                for (int i=0; i<adapters[0].Count; ++i) {
                    double tmpHeight = 0.0f;
                    for (int j=0; j<adapters.Length; ++j) {
                        tmpHeight += adapters[j][i].Y;
                    }
                    tmpMax = Math.Max (tmpMax, tmpHeight);
                }

                Axis a = new LinearAxis (0.0,tmpMax);
                // TODO make 0.08 a parameter.
                a.IncreaseRange (0.08);
                return a;
            }
            else {
                SequenceAdapter data = new SequenceAdapter (DataSource, DataMember, OrdinateData, AbscissaData);
                return data.SuggestYAxis();
            }
        }
Exemple #6
0
        /// <summary>
        /// Returns a y-axis that is suitable for drawing this plot.
        /// </summary>
        /// <returns>A suitable y-axis.</returns>
        public Axis SuggestYAxis()
        {
            SequenceAdapter dataBottom_ = new SequenceAdapter( DataSource, DataMember, OrdinateDataBottom, AbscissaData );
            SequenceAdapter dataTop_ = new SequenceAdapter( DataSource, DataMember, OrdinateDataTop, AbscissaData );

            Axis axis = dataTop_.SuggestYAxis ();
            axis.LUB(dataBottom_.SuggestYAxis ());
            return axis;
        }