chart_rulers_data.h 999 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. This file is part of Telegram Desktop,
  3. the official desktop application for the Telegram messaging service.
  4. For license and copyright information please follow this link:
  5. https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
  6. */
  7. #pragma once
  8. #include "statistics/statistics_types.h"
  9. namespace Statistic {
  10. struct ChartRulersData final {
  11. public:
  12. ChartRulersData(
  13. ChartValue newMaxHeight,
  14. ChartValue newMinHeight,
  15. bool useMinHeight,
  16. float64 rightRatio,
  17. Fn<QString(float64)> leftCustomCaption = nullptr,
  18. Fn<QString(float64)> rightCustomCaption = nullptr);
  19. void computeRelative(
  20. ChartValue newMaxHeight,
  21. ChartValue newMinHeight);
  22. [[nodiscard]] static ChartValue LookupHeight(ChartValue maxValue);
  23. struct Line final {
  24. float64 absoluteValue = 0.;
  25. float64 relativeValue = 0.;
  26. QString caption;
  27. QString scaledLineCaption;
  28. float64 rightCaptionWidth = 0.;
  29. };
  30. std::vector<Line> lines;
  31. float64 alpha = 0.;
  32. float64 fixedAlpha = 1.;
  33. };
  34. } // namespace Statistic