SubPriceData.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace Muchinfo.MTPClient.Data.Model.Analysis
  6. {
  7. public class SubPriceData
  8. {
  9. /// <summary>
  10. /// 价格
  11. /// </summary>
  12. public decimal Price { get; set; }
  13. /// <summary>
  14. /// 成交量
  15. /// </summary>
  16. public long CompleteQte
  17. {
  18. get;
  19. set;
  20. }
  21. /// <summary>
  22. /// 总成交量
  23. /// </summary>
  24. public decimal TotalQte
  25. {
  26. get;
  27. set;
  28. }
  29. /// <summary>
  30. /// 柱形图长度
  31. /// </summary>
  32. public double Width
  33. {
  34. get { return Convert.ToDouble(CompleteQte / 2) < 3 ? 3 : Convert.ToDouble(CompleteQte / 2); }
  35. }
  36. /// <summary>
  37. /// 占比
  38. /// </summary>
  39. public string Scale
  40. {
  41. get
  42. {
  43. if (TotalQte == 0)
  44. {
  45. return "0%";
  46. }
  47. decimal scale = CompleteQte / TotalQte * 100;
  48. if (scale < 0)
  49. {
  50. scale = 0;
  51. }
  52. return scale.ToString("f2") + "%";
  53. }
  54. }
  55. }
  56. }