How do I enable contour labels in OxyPlot

3 weeks ago 28
ARTICLE AD BOX

I have been using OxyPlot in an application for 5+ years. I recently updated to the latest version. Several lines of code broke, which I fixed, but I could not figure out how to regain the contour label, which used to work. The AI suggestions from Edge were not sufficient. I even downloaded the latest source and ran the WPF examples. The example for contours showed no labels, even though the launch button showed a picture with labels. Here is the code for my contour series:

var cs = new ContourSeries { ColumnCoordinates = columnCoordinates, RowCoordinates = _logY, Data = zData, TextColor = _contourTextColor, ContourLevels = contourLevels, LabelBackground = OxyColors.Transparent, LabelFormatString = "{0:0}", LabelStep = 1, LabelSpacing = 10, XAxisKey = "linx", YAxisKey = "liny", ContourColors = new[] { _contourColor }, Tag = "contours" };

As suggested by AI, I added LabelStep, LabelSpacing, and LabelFormatString to the ContourSeries initialization. I guess there is something else I am missing.

Read Entire Article