stack_linear_chart_common.h 920 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. namespace Data {
  9. struct StatisticalChart;
  10. } // namespace Data
  11. namespace Statistic {
  12. struct Limits;
  13. class LinesFilterController;
  14. struct PiePartData final {
  15. struct Part final {
  16. float64 roundedPercentage = 0; // 0.XX.
  17. float64 stackedAngle = 0.;
  18. QString percentageText;
  19. };
  20. std::vector<Part> parts;
  21. bool pieHasSinglePart = false;
  22. };
  23. [[nodiscard]] PiePartData PiePartsPercentage(
  24. const std::vector<float64> &sums,
  25. float64 totalSum,
  26. bool round);
  27. [[nodiscard]] PiePartData PiePartsPercentageByIndices(
  28. const Data::StatisticalChart &chartData,
  29. const std::shared_ptr<LinesFilterController> &linesFilter,
  30. const Limits &xIndices);
  31. } // namespace Statistic