BarSeriesBar.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. #nullable disable
  2. namespace Terminal.Gui.Views;
  3. /// <summary>A single bar in a <see cref="BarSeries"/></summary>
  4. public class BarSeriesBar
  5. {
  6. /// <summary>
  7. /// Creates a new instance of a single bar rendered in the given <paramref name="fill"/> that extends out
  8. /// <paramref name="value"/> graph space units in the default <see cref="Orientation"/>
  9. /// </summary>
  10. /// <param name="text"></param>
  11. /// <param name="fill"></param>
  12. /// <param name="value"></param>
  13. public BarSeriesBar (string text, GraphCellToRender fill, float value)
  14. {
  15. Text = text;
  16. Fill = fill;
  17. Value = value;
  18. }
  19. /// <summary>The color and character that will be rendered in the console when the bar extends over it</summary>
  20. public GraphCellToRender Fill { get; set; }
  21. /// <summary>
  22. /// Optional text that describes the bar. This will be rendered on the corresponding <see cref="Axis"/> unless
  23. /// <see cref="BarSeries.DrawLabels"/> is false
  24. /// </summary>
  25. public string Text { get; set; }
  26. /// <summary>The value in graph space X/Y (depending on <see cref="Orientation"/>) to which the bar extends.</summary>
  27. public float Value { get; }
  28. }