-1

enter image description here

enter image description here

Hi All, I am using oxyplot for my WPF application, I wish to show a graph like this. is there a way I can hide the values on the axes like 50/100/150. I also need final values like 255, but what I see from the usage, the Oxyplot ends up showing me 250 instead of 255 and 200 instead of 255 due to space constraint.

Is there a way I can achieve the desired result in pic1.

I am following the source code from this location.

https://oxyplot.readthedocs.io/en/master/getting-started/hello-wpf-xaml.html

Sandepku
  • 861
  • 14
  • 31

1 Answers1

1

You can set MajorStep of LinearAxis to 255.

Example:

<oxy:Plot Title="{Binding Title}">
    <oxy:Plot.Axes>
        <oxy:LinearAxis Position="Left" 
             MajorGridlineStyle="None" MinorGridlineStyle="None" 
             MajorStep="255" TickStyle="None" Minimum="0" Maximum="255" />
        <oxy:LinearAxis Position="Bottom" 
             MajorGridlineStyle="None" MinorGridlineStyle="None" 
             MajorStep="255" TickStyle="None" Minimum="0" Maximum="255" />
    </oxy:Plot.Axes>
    <oxy:Plot.Series>
        <oxy:LineSeries ItemsSource="{Binding Points}"/>
    </oxy:Plot.Series>
</oxy:Plot>

Result:

enter image description here

user2250152
  • 14,658
  • 4
  • 33
  • 57
  • thank you! meanwhile is there a way in oxyplot we get to show min value and max value within the plot instead of outside the plot? – Sandepku Sep 16 '21 at 11:13