BVB Source Codes

PDF file browser Show HorizontalStackedYAxisRenderer.cs Source code

Return Download PDF file browser: download HorizontalStackedYAxisRenderer.cs Source code - Download PDF file browser Source code - Type:.cs
  1. //
  2. // PDFsharp.Charting - A charting library based on PDFsharp
  3. //
  4. // Authors:
  5. //   Niklas Schneider (mailto:Niklas.Schneider@pdfsharp.com)
  6. //
  7. // Copyright (c) 2005 empira Software GmbH, Cologne (Germany)
  8. //
  9. // http://www.pdfsharp.com
  10. //
  11. // Permission is hereby granted, free of charge, to any person obtaining
  12. // a copy of this software and associated documentation files (the
  13. // "Software"), to deal in the Software without restriction, including
  14. // without limitation the rights to use, copy, modify, merge, publish,
  15. // distribute, sublicense, and/or sell copies of the Software, and to
  16. // permit persons to whom the Software is furnished to do so, subject to
  17. // the following conditions:
  18. //
  19. // The above copyright notice and this permission notice shall be
  20. // included in all copies or substantial portions of the Software.
  21. //
  22. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  23. // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  24. // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  25. // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  26. // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  27. // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  28. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  29.  
  30. using System;
  31. using System.Diagnostics;
  32. using PdfSharp.Drawing;
  33.  
  34. namespace PdfSharp.Charting.Renderers
  35. {
  36.   /// <summary>
  37.   /// Represents a Y axis renderer used for charts of type BarStacked2D.
  38.   /// </summary>
  39.   internal class HorizontalStackedYAxisRenderer : HorizontalYAxisRenderer
  40.   {
  41.     /// <summary>
  42.     /// Initializes a new instance of the HorizontalStackedYAxisRenderer class with the
  43.     /// specified renderer parameters.
  44.     /// </summary>
  45.     internal HorizontalStackedYAxisRenderer(RendererParameters parms) : base(parms)
  46.     {
  47.     }
  48.  
  49.     /// <summary>
  50.     /// Determines the sum of the smallest and the largest stacked bar
  51.     /// from all series of the chart.
  52.     /// </summary>
  53.     protected override void CalcYAxis(out double yMin, out double yMax)
  54.     {
  55.       yMin = double.MaxValue;
  56.       yMax = double.MinValue;
  57.  
  58.       ChartRendererInfo cri = (ChartRendererInfo)this.rendererParms.RendererInfo;
  59.  
  60.       int maxPoints = 0;
  61.       foreach (SeriesRendererInfo sri in cri.seriesRendererInfos)
  62.         maxPoints = Math.Max(maxPoints, sri.series.seriesElements.Count);
  63.  
  64.       for (int pointIdx = 0; pointIdx < maxPoints; ++pointIdx)
  65.       {
  66.         double valueSumPos = 0, valueSumNeg = 0;
  67.         foreach (SeriesRendererInfo sri in cri.seriesRendererInfos)
  68.         {
  69.           if (sri.pointRendererInfos.Length <= pointIdx)
  70.             break;
  71.  
  72.           ColumnRendererInfo column = (ColumnRendererInfo)sri.pointRendererInfos[pointIdx];
  73.           if (column.point != null && !double.IsNaN(column.point.value))
  74.           {
  75.             if (column.point.value < 0)
  76.               valueSumNeg += column.point.value;
  77.             else
  78.               valueSumPos += column.point.value;
  79.           }
  80.         }
  81.         yMin = Math.Min(valueSumNeg, yMin);
  82.         yMax = Math.Max(valueSumPos, yMax);
  83.       }
  84.     }
  85.   }
  86. }
  87.  
downloadHorizontalStackedYAxisRenderer.cs Source code - Download PDF file browser Source code
Related Source Codes/Software:
Campus id - This system includes a campus dormitory management... 2015-04-10
ShopXP online system source code - ShopXP ShoppingNet online system source code infor... 2015-04-10
TOM cat demo in learning to speak - 实现汤米猫学说话的演示,即实现变声功能鲜豔,,,,,,,开发者说:自己经常来看code4app,看看... 2015-04-10
Another OpenFolder - Implements can commence in the middle of the scree... 2015-04-10
Bus query system - A simple bus query system. Can be divided into rou... 2015-04-10
Customer service management system - To a store and development of customer service man... 2015-04-10
OA office automation system - OA office automation system is tomorrow technology... 2015-04-10
Chapters novel divider (ChapCuttor) - Chapter divider (ChapCuttor) by & have spent Black... 2015-04-10
Graduation design file (graphics algorithm design) - Reference image effect algorithm design the softwa... 2015-04-10
CheatEngine5.6 source code - Game cheat the 5.6 version of the source code, it ... 2015-04-10
Online ZhaXunWang science formula query V1.0 - Including junior middle school and high school sci... 2016-10-20
Observe science formula query v1.0 - Observe network science formulas 2016-10-20
Lele v1.1 QQ login system - "Le Le QQ Group landing system Ver1.1" * Fix QQ ... 2016-10-20
The new network domain name host distribution system V1.0 - Use Notepad to open \Global.asa idc1688 into your ... 2016-10-20
QQ group v2.1 release system - ha ha - "Copyright" This system is based on the Wu Meng de... 2016-10-20
Interesting content ASPCMS v1.0 - Update log: 2016-10-20
Residential feng shui fortune-telling v1.0 - The project according to the orientation of the ar... 2016-10-20
The self-help chain home beautiful - The self-help chain home beautiful 2016-10-20
EXW FLASH web site management system v2.0 - EXW FLASH introduction: EXW website management sys... 2016-10-20
WAP2.0 web site management system V1.0 - System installation steps 1, install the QuickWAP ... 2016-10-20

 Back to top