ChartStripline accessible

Hello,

I have a quesiton regarding using ChartStripline in a Chart componenet. I want to make the ChartStriplline accessible and movable within the chart using a keyboard.


Is there a way to achieve this using ara-label or similar methods?


3 Replies

DG Durga Gopalakrishnan Syncfusion Team March 4, 2024 01:57 PM UTC

Hi Jylee,


Greetings from Syncfusion.


Currently, we do not have support for aria labels with chart stripline navigation using the keyboard. We recommend binding the onkeydown and onkeyup events to the chart div container and adjusting the stripline start and end values according to your needs. Please refer to the snippet and screenshot below for more information.


<div @onkeydown="KeyDown" @onkeyup="KeyUp">

  <SfChart>

     <ChartPrimaryXAxis>

       <ChartStriplines>

         <ChartStripline Start=@start End=@end />

       </ChartStriplines>

    </ChartPrimaryXAxis

  </SfChart>

</div>

@code {

    public double start = 2;

    public double end = 3;

    public void KeyUp(KeyboardEventArgs args)

    {

            if (args.Key == "ArrowRight")

            {

                start = start + 1;

                end = end + 1;

            }

            StateHasChanged();

    }

    public void KeyDown(KeyboardEventArgs args)

    {

            if (args.Key == "ArrowLeft")

            {

                start = start - 1;

                end = end - 1;

            }

            StateHasChanged();

    }

}


Video : https://www.syncfusion.com/downloads/support/directtrac/general/ze/Strip272460558.zip


Sample : https://blazorplayground.syncfusion.com/rNLpZKZpzRdfKjaa


Kindly revert us if you have any concerns.


Regards,

Durga Gopalakrishnan.



JY JY March 6, 2024 01:34 AM UTC

It's works fine!


Thank you for your help.



DG Durga Gopalakrishnan Syncfusion Team March 6, 2024 11:28 AM UTC

Most welcome. Please get back to us if you need any further assistance. We are always happy in assisting you.


Loader.
Up arrow icon