Chart - minimal value on Y axis #686
Ossj400
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I didn't found anything in docs about how to set minimal value on Y axis (to not start from 0), nothing on github and nothing on CoPilot bing, Copilot Github, Chat GPT.
So I started to typing anything and I've found out that this is easy way to achieve that. So easiest way is on creating lineChartOptions just set Scales = null
If you want to set minimal value (like 100 or something) you can achieve it using scales object from this method:
private void SetMinYAxisValue(double minVal) { scales = new Scales() { Y = new ChartAxes() { Min = minVal } }; }
And then use it like this:
lineChartOptions = new() { Responsive = true, Interaction = new Interaction { Mode = InteractionMode.Index } , Scales = scales };
I know it's nothing special but maybe someone will have same problem as I had and will find resolution here :)
Beta Was this translation helpful? Give feedback.
All reactions