Hi,
I've put a circular gauge into a bootstrap 5 carousel, and only the active slide is centered. I've tried putting different divs around the slide divs and looked at your other similar examples.
Can you explain how to center non-active slide please? Note that resizing the window will center it, but i don't even know how to add that automatically.
Video: https://youtu.be/5pqCrwL7jDw
Images of issue:
Please see attached sfCircularGaugeInCarousel.sln.
Thanks,
Brent
My Versions:
Syncfusion v19.3.57
Bootstrap v 5.1.3
VS 2022
Attachment: sfCircularGaugeInCarousel_bfb2f370.zip
@if (AllowVisible)
{
<SfCircularGauge @ref="@gauge"> </SfCircularGauge>
}
<a role="button" data-slide="next" @onclick="GaugeRefresh"> </a> @code { SfCircularGauge gauge;
public bool AllowVisible = false;
public async void GaugeRefresh(){
AllowVisible = true;
await Task.Delay(1000);
this.gauge.RefreshAsync();
}
} |
<div class="carousel-indicators">
…
<button type="button" data-bs-target="#supSlides" data-bs-slide-to="1" @onclick="GaugeRefreshSlideTwo" aria-label="Slide 2"></button>
<button type="button" data-bs-target="#supSlides" data-bs-slide-to="2" @onclick="GaugeRefreshSlideThree" aria-label="Slide 3"></button> </div>
<div class="carousel-inner" style="border:0px solid green;">
…
<SfCircularGauge @ref="@gauge1"> </SfCircularGauge>
<SfCircularGauge @ref="@gauge2"> </SfCircularGauge>
<SfCircularGauge @ref="@gauge3"> </SfCircularGauge>
</div>
<span class="carousel-control-prev-icon" aria-hidden="true" @onclick="GaugeRefresh"></span>
<span class="carousel-control-next-icon" aria-hidden="true" @onclick="GaugeRefresh"></span>
@code { SfCircularGauge gauge;
public void GaugeRefresh(){
this.gauge2.RefreshAsync();
this.gauge3.RefreshAsync();
}
public void GaugeRefreshSlideTwo(){
this.gauge2.RefreshAsync();
}
public void GaugeRefreshSlideThree(){
this.gauge3.RefreshAsync();
}
} |
How would you get your sample app to animate after each pressing of Next > ?
https://www.syncfusion.com/downloads/support/forum/171136/ze/CarouselSample-1030188727
Thanks,
Brent
<div class="carousel-indicators">
… <button type="button" data-bs-target="#supSlides" data-bs-slide-to="1" @onclick="GaugeSlideOne" aria-label="Slide 1"></button> <button type="button" data-bs-target="#supSlides" data-bs-slide-to="1" @onclick="GaugeSlideTwo" aria-label="Slide 2"></button> <button type="button" data-bs-target="#supSlides" data-bs-slide-to="2" @onclick="GaugeSlideThree" aria-label="Slide 3"></button> </div> <div class="carousel-inner" style="border:0px solid green;"> … <SfCircularGauge @ref="@gauge1"> </SfCircularGauge> <SfCircularGauge @ref="@gauge2"> </SfCircularGauge> <SfCircularGauge @ref="@gauge3"> </SfCircularGauge> </div> <span class="carousel-control-prev-icon" aria-hidden="true" @onclick="GaugeSlidePrev"></span> <span class="carousel-control-next-icon" aria-hidden="true" @onclick="GaugeSlideNext"></span> ... <div> @if (AllowVisibleOne) { <SfCircularGauge></SfCircularGauge> } </div> <div>
@if (AllowVisibleTwo) { <SfCircularGauge></SfCircularGauge> } </div> <div>
@if (AllowVisibleThree) { <SfCircularGauge></SfCircularGauge> } </div> @code { SfCircularGauge gauge1, gauge2, gauge3;
public bool AllowVisibleOne = true; public bool AllowVisibleTwo = false; public bool AllowVisibleThree = false; public double NextSlideValue = 1; public double PreviousSlideValue = 1; public void GaugeSlidePrev(){ // Perform calculation } public void GaugeSlideNext(){
// Perform calculation } } |