Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Chart"/> class.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <param name="legendX">The legend X.</param>
        /// <param name="legendY">The legend Y.</param>
        /// <param name="toolTip">The tool tip.</param>
        /// <param name="charts">The charts.</param>
        /// <param name="xAxisColumns">The x axis columns.</param>
        /// <param name="yAxisColumns">The y axis columns.</param>
        public Chart(ChartStylableTextElement title, ChartStylableTextElement legendX, ChartStylableTextElement legendY
                     , string toolTip, List <ChartBase> charts, int xAxisColumns, int yAxisColumns)
        {
            this.Title   = title;
            this.LegendX = legendX;
            this.LegendY = legendY;
            this.ToolTip = new ChartTextElement(toolTip);

            this.ChartBase = charts;
            this.Y_Axis    = new YAxis();
            this.X_Axis    = new XAxis();

            _MinValueY      = charts.SelectMany(c => c.Values).Min(c => c.Value);
            _MaxValueY      = charts.SelectMany(c => c.Values).Max(c => c.Value);
            _ColumnsX       = xAxisColumns;
            _ColumnsY       = yAxisColumns;
            _MaxValueCountX = (from c in charts
                               select c.Values.Count).Max();

            X_Axis.Steps = ((int)Math.Round((decimal)_MaxValueCountX / (decimal)_ColumnsX));


            _MinValueYFloored = (int)Math.Floor(_MinValueY);
            _MaxValueYCeiled  = (int)Math.Ceiling(_MaxValueY);
            Y_Axis.SetRange(_MinValueYFloored, _MaxValueYCeiled);
            Y_Axis.Steps = ((int)Math.Ceiling(((decimal)_MaxValueYCeiled - (decimal)_MinValueYFloored) / (decimal)_ColumnsY));
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Chart"/> class.
 /// </summary>
 /// <param name="title">The title.</param>
 /// <param name="toolTip">The tool tip.</param>
 /// <param name="charts">The charts.</param>
 public Chart(ChartStylableTextElement title, string toolTip, List <ChartBase> charts)
     : this(title, null, null, toolTip, charts, 10, 10)
 {
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Chart"/> class.
 /// </summary>
 /// <param name="title">The title.</param>
 /// <param name="legendX">The legend X.</param>
 /// <param name="legendY">The legend Y.</param>
 /// <param name="toolTip">The tool tip.</param>
 /// <param name="chart">The chart.</param>
 public Chart(ChartStylableTextElement title, ChartStylableTextElement legendX, ChartStylableTextElement legendY, string toolTip, ChartBase chart)
     : this(title, legendX, legendY, toolTip, new List <ChartBase>() { chart }, 10, 10)
 {
 }
Exemple #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Chart"/> class.
 /// </summary>
 /// <param name="title">The title.</param>
 /// <param name="toolTip">The tool tip.</param>
 /// <param name="chart">The chart.</param>
 public Chart(ChartStylableTextElement title, string toolTip, ChartBase chart)
     : this(title, null, null, toolTip, new List <ChartBase>() { chart }, 10, 10)
 {
 }