Skip to content

Commit 6969b13

Browse files
Merge pull request #6472 from syncfusion-content/970202-ScrollBarCustomize
970202: Added Scrollbar customization in documentation.
2 parents 9d7a0a6 + 54795f6 commit 6969b13

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
36.8 KB
Loading

blazor/chart/zooming.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,66 @@ The [Position](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Charts.Ch
420420
![Blazor Line Chart with customized scrollbar position](./images/zoom/blazor-line-chart-scroll-bar-position.png)
421421
{% previewsample "https://blazorplayground.syncfusion.com/embed/rNryXRBRpKfeaJfn?appbar=false&editor=false&result=true&errorlist=false&theme=bootstrap5" %}
422422

423+
### Customization
424+
425+
Scrollbar appearance and behavior are customizable using [ChartAxisScrollbarSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Charts.ChartAxisScrollbarSettings.html):
426+
427+
- `TrackColor`: Specifies the track color.
428+
- `TrackRadius`: Specifies the track corner radius.
429+
- `ScrollbarColor`: Specifies the scrollbar color.
430+
- `ScrollbarRadius`: Specifies the scrollbar corner radius.
431+
- `GripColor`: Specifies the grip color. The grip is the draggable handle (thumb) within the scrollbar used to move the visible range.
432+
- `Height`: Specifies the scrollbar height.
433+
- `EnableZoom`: Enables or disables zooming via the scrollbar. When enabled, arrows appear at the scrollbar ends to zoom in or out; when disabled, arrows are hidden and zooming via the scrollbar is unavailable.
434+
435+
```cshtml
436+
@using Syncfusion.Blazor.Charts
437+
438+
<SfChart Title="Sales History of Product X" >
439+
<ChartPrimaryXAxis Title="Years" EdgeLabelPlacement="EdgeLabelPlacement.Shift">
440+
<ChartAxisMajorGridLines Width="0"></ChartAxisMajorGridLines>
441+
<ChartAxisScrollbarSettings Enable="false" PointsLength="1000" Height="16" EnableZoom="true"
442+
TrackRadius="8" ScrollbarRadius="8" GripColor="#BD000F" TrackColor="#FF9AA2" ScrollbarColor="#EE5A5A" />
443+
</ChartPrimaryXAxis>
444+
445+
<ChartPrimaryYAxis Title="Profit ($)" RangePadding="ChartRangePadding.None">
446+
<ChartAxisLineStyle Width="0"></ChartAxisLineStyle>
447+
<ChartAxisMajorTickLines Width="0"></ChartAxisMajorTickLines>
448+
<ChartAxisScrollbarSettings Enable="false" PointsLength="1000" Height="16" EnableZoom="true"
449+
TrackRadius="8" ScrollbarRadius="8" GripColor="#BD000F" TrackColor="#FF9AA2" ScrollbarColor="#EE5A5A" />
450+
</ChartPrimaryYAxis>
451+
452+
<ChartLegendSettings Visible="false"></ChartLegendSettings>
453+
454+
<ChartZoomSettings EnableMouseWheelZooming="true" EnableScrollbar="true" EnablePinchZooming="true"
455+
EnableSelectionZooming="true"></ChartZoomSettings>
456+
457+
<ChartSeriesCollection>
458+
<ChartSeries DataSource="@SalesDetails" XName="X" YName="Y" Type="ChartSeriesType.Area">
459+
</ChartSeries>
460+
</ChartSeriesCollection>
461+
462+
</SfChart>
463+
464+
@code {
465+
466+
public class ChartData
467+
{
468+
public double X { get; set; }
469+
public double Y { get; set; }
470+
}
471+
public List<ChartData> SalesDetails = new List<ChartData>
472+
{
473+
new ChartData { X= 1900, Y= 4 },
474+
new ChartData { X= 1920, Y= 3.0 },
475+
new ChartData { X= 1940, Y= 3.8 },
476+
new ChartData { X= 1960, Y= 3.4 },
477+
new ChartData { X= 2000, Y= 3.9 }
478+
};
479+
}
480+
```
481+
![Blazor Area Chart with scrollbar customization](images/zoom/blazor-area-chart-scroll-bar-customization.png)
482+
423483
## Auto interval on zooming
424484

425485
The axis interval will be calculated automatically with respect to the zoomed range, if the [EnableAutoIntervalOnZooming](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Charts.ChartAxis.html#Syncfusion_Blazor_Charts_ChartAxis_EnableAutoIntervalOnZooming) property is set to **true**.

0 commit comments

Comments
 (0)