PageRenderTime 50ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 1ms

/Main/src/DynamicDataDisplay.Markers2/Extensions/PointChartBaseExtensions.cs

#
C# | 46 lines | 25 code | 6 blank | 15 comment | 4 complexity | 62f2f5a845992aa91a1a95219e9027f6 MD5 | raw file
Possible License(s): CC-BY-SA-3.0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Microsoft.Research.DynamicDataDisplay.Markers2;
  6. namespace Microsoft.Research.DynamicDataDisplay
  7. {
  8. /// <summary>
  9. /// Contains useful extension methods of PointChartBase class.
  10. /// </summary>
  11. public static class PointChartBaseExtensions
  12. {
  13. /// <summary>
  14. /// Sets the description of chart in the legend.
  15. /// </summary>
  16. /// <param name="chart">The chart.</param>
  17. /// <param name="description">The description.</param>
  18. /// <returns></returns>
  19. public static T WithDescription<T>(this T chart, string description) where T : PointChartBase
  20. {
  21. if (chart == null)
  22. throw new ArgumentNullException("chart");
  23. chart.Description = description;
  24. return chart;
  25. }
  26. /// <summary>
  27. /// Stes the detailed description of chart in the legend.
  28. /// </summary>
  29. /// <param name="chart">The chart.</param>
  30. /// <param name="detailedDescription">The detailed description.</param>
  31. /// <returns></returns>
  32. public static T WithDetailedDescription<T>(this T chart, string detailedDescription) where T : PointChartBase
  33. {
  34. if (chart == null)
  35. throw new ArgumentNullException("chart");
  36. chart.DetailedDescription = detailedDescription;
  37. return chart;
  38. }
  39. }
  40. }