Skip to content

Setting maximum and minimum value in LineChart Y-Axis #1925

Answered by stsrki
AlexKlueh asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, sorry for not answering your question before.

I have looked at some examples on stackoverflow. You can see in the example below that I only converted JSON to C# object and apply it to OptionsObject. With this you can create any object structure and it will be properly serialized.

<LineChart TItem="double" OptionsObject="@chartOptions" />
@code{
    object chartOptions = new
    {
        Scales = new
        {
            YAxes = new[] {
                new {
                    Ticks = new
                    {
                        BeginAtZero = true,
                        Min = 0,
                        Max = 500,
                    }
                }
            }
        }…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
6 replies
@stsrki
Comment options

@AlexKlueh
Comment options

@stsrki
Comment options

@AlexKlueh
Comment options

@edgarssults
Comment options

Answer selected by AlexKlueh
Comment options

You must be logged in to vote
1 reply
@stsrki
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants