Search code examples
c#winformsoxyplot

C# OxyPlot: How to display point values on chart?


can anyone suggest how to display the values of the points on the chart? something like that. Chart:

chart


Solution

  • Use the LabelFormatString property on your series. This lets you specify what to display, and how to display it.

    To display just the y values like in your screenshot:

      // Show the y value with 1 decimal place.
      series.LabelFormatString = "{1:F1}";
    

    y value

      // Or if you wanted to show (x, y).
      series.LabelFormatString = "({0:F1}, {1:F1})";
    

    (x,y) picture