- Notifications
You must be signed in to change notification settings - Fork 80
docs(chart): drilldown chart documentation #1592
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
21 commits Select commit Hold shift + click to select a range
a33e10a docs(chart): drilldown chart documentation
yanisslav c6f154c Update components/chart/overview.md
yanisslav 6c2d6c9 Update components/chart/events.md
yanisslav 00d256b Update components/chart/drilldown.md
yanisslav 2da8fe5 Update components/chart/drilldown.md
yanisslav 7a8b1fc Update components/chart/drilldown.md
yanisslav 4ed90d5 Update components/chart/drilldown.md
yanisslav cbb0059 Update components/chart/drilldown.md
yanisslav 205d4aa Update components/chart/drilldown.md
yanisslav 4191922 Update components/chart/drilldown.md
yanisslav 889ee74 Update components/chart/drilldown.md
yanisslav 042f83d Update components/chart/overview.md
yanisslav 2cccf80 Update components/chart/drilldown.md
yanisslav 0678cb7 Update components/chart/drilldown.md
yanisslav 2a1d934 Update components/chart/drilldown.md
yanisslav 22fc602 chore: applying suggested changes
yanisslav 1b74d1c chore: removing unnecessary paragraph
yanisslav e010109 Update components/chart/drilldown.md
yanisslav a45fded Update components/chart/drilldown.md
yanisslav 6ad0789 chore: applying suggested changes
yanisslav 3ff903a PR polishing
dimodi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,207 @@ | ||
| --- | ||
| title: Drilldown Charts | ||
| page_title: Drilldown Charts | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| description: The drilldown Chart feature allows users to explore hierarchical data by initially displaying summarized information and enabling users to "drill down" into specific categories or data points for more detailed insights. | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| slug: chart-drilldown | ||
| tags: telerik,blazor,chart,drill,down,drilldown | ||
| published: true | ||
| position: 55 | ||
| --- | ||
| | ||
| # DrillDown Charts | ||
| | ||
| The Telerik UI Chart supports drilldown functionality for exploring data. | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| The drilldown function allows users to click on a point (bar, pie segment, etc.) in order to navigate to a different view. The new view usually contains finer grained data about the selected item, like breakdown by product of the selected category. | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| The view hierarchy can be displayed in a breadcrumb for easy navigation back to previous views. | ||
| | ||
| ## Configuring Drilldown Charts | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| To configure a chart series for drilldown: | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| 1. Prepare the data in the appropriate format. Each series data that will be drilled down should contain a property of type `ChartSeriesDescriptor`. The descriptor includes all the parameters of the `ChartSeries` tag and acts as a container holding information about the series displayed upon user-initiated drilldown. | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| 1. Specify the drilldown field (the `ChartSeriesDescriptor` field) of the series data by using the `ChartSeries.DrillDownField` or `ChartSeriesDescriptor.DrillDownField` property. | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| ````CSHTML | ||
| @* Configuring Drilldown Charts *@ | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| <TelerikChart> | ||
| <ChartSeriesItems> | ||
| <ChartSeries Type="ChartSeriesType.Column" | ||
| Name="Total Sales By Company" | ||
| Data="@Data" | ||
| Field="@nameof(CompanyModel.Sales)" | ||
| CategoryField="@nameof(CompanyModel.Name)" | ||
| DrilldownField="@nameof(CompanyModel.Details)"> | ||
| </ChartSeries> | ||
| </ChartSeriesItems> | ||
| </TelerikChart> | ||
| @code { | ||
| public List<CompanyModel> Data { get; set; } = new List<CompanyModel>(); | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| protected override Task OnInitializedAsync() | ||
| { | ||
| Data = GetSeriesData(); | ||
| return base.OnInitializedAsync(); | ||
| } | ||
| public static List<CompanyModel> GetSeriesData() | ||
| { | ||
| var data = new List<CompanyModel>() | ||
| { | ||
| new CompanyModel() | ||
| { | ||
| Name = "Company A", | ||
| Sales = 100M, | ||
| Details = new ChartSeriesDescriptor() | ||
| { | ||
| Name = "Company A Sales By Product", | ||
| Type = ChartSeriesType.Column, | ||
| Field = nameof(ProductModel.Sales), | ||
| CategoryField = nameof(ProductModel.Name), | ||
| Data = new List<ProductModel>() | ||
| { | ||
| new ProductModel() { Name = "Product 1", Sales = 10M }, | ||
| new ProductModel() { Name = "Product 2", Sales = 20M }, | ||
| new ProductModel() { Name = "Product 3", Sales = 30M }, | ||
| } | ||
| } | ||
| }, | ||
| new CompanyModel() | ||
| { | ||
| Name = "Company B" , | ||
| Sales = 200M, | ||
| Details = new ChartSeriesDescriptor() | ||
| { | ||
| Name = "Company B Sales By Product", | ||
| Type = ChartSeriesType.Column, | ||
| Field = nameof(ProductModel.Sales), | ||
| CategoryField = nameof(ProductModel.Name), | ||
| Data = new List<ProductModel>() | ||
| { | ||
| new ProductModel() { Name = "Product 1", Sales = 30M }, | ||
| new ProductModel() { Name = "Product 2", Sales = 20M }, | ||
| new ProductModel() { Name = "Product 3", Sales = 10M }, | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| return data; | ||
| } | ||
| public class CompanyModel | ||
| { | ||
| public string Name { get; set; } | ||
| public decimal Sales { get; set; } | ||
| public ChartSeriesDescriptor Details { get; set; } | ||
| } | ||
| public class ProductModel | ||
| { | ||
| public string Name { get; set; } | ||
| public decimal Sales { get; set; } | ||
| } | ||
| } | ||
| ```` | ||
| | ||
| ## DrillDown Chart Breadcrumb | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| Optionally you can display a breadcrumb that shows the drilldown levels. To add breadcrumb: | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| 1. Declare a `TelerikChartBreadcrumb` component. | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| 1. Set the `ChartId` parameter of the breadcrumb component. It should match the `Id` of the chart that will be associated with the breadcrumb. | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
| | ||
| ````CSHTML | ||
| @* Configuring Drilldown Chart Breadcrumb *@ | ||
| <TelerikChartBreadcrumb ChartId="@ChartId"></TelerikChartBreadcrumb> | ||
| <TelerikChart Id="@ChartId"> | ||
| <ChartSeriesItems> | ||
| <ChartSeries Type="ChartSeriesType.Column" | ||
| Name="Total Sales By Company" | ||
| Data="@Data" | ||
| Field="@nameof(CompanyModel.Sales)" | ||
| CategoryField="@nameof(CompanyModel.Name)" | ||
| DrilldownField="@nameof(CompanyModel.Details)"> | ||
| </ChartSeries> | ||
| </ChartSeriesItems> | ||
| </TelerikChart> | ||
| @code { | ||
| public const string ChartId = "chart1"; | ||
| public List<CompanyModel> Data { get; set; } = new List<CompanyModel>(); | ||
| protected override Task OnInitializedAsync() | ||
| { | ||
| Data = GetSeriesData(); | ||
| return base.OnInitializedAsync(); | ||
| } | ||
| public static List<CompanyModel> GetSeriesData() | ||
| { | ||
| var data = new List<CompanyModel>() | ||
| { | ||
| new CompanyModel() | ||
| { | ||
| Name = "Company A", | ||
| Sales = 100M, | ||
| Details = new ChartSeriesDescriptor() | ||
| { | ||
| Name = "Company A Sales By Product", | ||
| Type = ChartSeriesType.Column, | ||
| Field = nameof(ProductModel.Sales), | ||
| CategoryField = nameof(ProductModel.Name), | ||
| Data = new List<ProductModel>() | ||
| { | ||
| new ProductModel() { Name = "Product 1", Sales = 10M }, | ||
| new ProductModel() { Name = "Product 2", Sales = 20M }, | ||
| new ProductModel() { Name = "Product 3", Sales = 30M }, | ||
| } | ||
| } | ||
| }, | ||
| new CompanyModel() | ||
| { | ||
| Name = "Company B" , | ||
| Sales = 200M, | ||
| Details = new ChartSeriesDescriptor() | ||
| { | ||
| Name = "Company B Sales By Product", | ||
| Type = ChartSeriesType.Column, | ||
| Field = nameof(ProductModel.Sales), | ||
| CategoryField = nameof(ProductModel.Name), | ||
| Data = new List<ProductModel>() | ||
| { | ||
| new ProductModel() { Name = "Product 1", Sales = 30M }, | ||
| new ProductModel() { Name = "Product 2", Sales = 20M }, | ||
| new ProductModel() { Name = "Product 3", Sales = 10M }, | ||
| } | ||
| } | ||
| } | ||
| }; | ||
| return data; | ||
| } | ||
| public class CompanyModel | ||
| { | ||
| public string Name { get; set; } | ||
| public decimal Sales { get; set; } | ||
| public ChartSeriesDescriptor Details { get; set; } | ||
| } | ||
| public class ProductModel | ||
| { | ||
| public string Name { get; set; } | ||
| public decimal Sales { get; set; } | ||
| } | ||
| } | ||
| ```` | ||
| | ||
| ## See Also | ||
| | ||
| * [Live Demo: Drilldown Charts](https://demos.telerik.com/blazor-ui/chart/drilldown) | ||
yanisslav marked this conversation as resolved. Outdated Show resolved Hide resolved | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.