-
Notifications
You must be signed in to change notification settings - Fork 80
docs(radial-gauge) #262
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
docs(radial-gauge) #262
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
8adf2da
docs(radial-gauge):overview, scale articles
ntacheva 0e87e08
docs(radial-gauge):pointers and ranges articles
ntacheva 5b0bec3
docs(radial-gauge):labels article + minor improvements
ntacheva 00fc21d
chore(radial-gauge):final touches
ntacheva bc8d611
chore(gauges): minor fixes and typos
marin-bratanov 7ba38a1
chore(radial-gauge):minor fixes as per comments
ntacheva 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+8.98 KB
components/gauge-radial/images/minor-and-major-units-radial-gauge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+5.77 KB
components/gauge-radial/images/remove-minorunit-ticks-radial-gauge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,145 @@ | ||
| --- | ||
| title: Labels | ||
| page_title: Labels | ||
| description: Radial Gauge for Blazor - Labels. | ||
| slug: radial-gauge-labels | ||
| tags: telerik,blazor,radial,gauge,labels | ||
| published: True | ||
| position: 20 | ||
| --- | ||
|
|
||
| # Radial Gauge Labels | ||
|
|
||
| You can customize the appearance of the labels rendered on the [scale]({%slug radial-gauge-scale%}) of the Radial Gauge by using the `<RadialGaugeScaleLabels>`, child tag of the `<RadialGaugeScale>`, and the parameters it exposes: | ||
|
|
||
| * [Format](#format) | ||
|
|
||
| * [Color](#color) | ||
|
|
||
| * [Visible](#visible) | ||
|
|
||
| * [Additional Customization](#additional-customization) | ||
|
|
||
| ## Format | ||
|
|
||
| The `Format` (`string`) parameter allows you to customize the rendering of the labels by using the <a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings" target="_blank">standard numeric format strings</a>. You can set the values of the labels to showcase, for example, currency, percentage, and so on. | ||
|
|
||
| >caption Use the Format parameter to showcase currency. The result from the code snippet below. | ||
|
|
||
|  | ||
|
|
||
| ````CSHTML | ||
| @* Use the {0:C0} format string to format the values of the labels as currency. *@ | ||
|
|
||
| <TelerikRadialGauge> | ||
| <RadialGaugeScales> | ||
|
|
||
| <RadialGaugeScale> | ||
| <RadialGaugeScaleLabels Format="{0:C0}"> | ||
| </RadialGaugeScaleLabels> | ||
| </RadialGaugeScale> | ||
|
|
||
| </RadialGaugeScales> | ||
|
|
||
| <RadialGaugePointers> | ||
|
|
||
| <RadialGaugePointer Value="30"> | ||
| </RadialGaugePointer> | ||
|
|
||
| </RadialGaugePointers> | ||
| </TelerikRadialGauge> | ||
| ```` | ||
|
|
||
| ## Color | ||
|
|
||
| The `Color` (`string`) parameter controls the color of the labels. It accepts **CSS**, **HEX** and **RGB** colors. | ||
|
|
||
| >caption Change the color of the labels. The result from the code snippet below. | ||
|
|
||
|  | ||
|
|
||
| ````CSHTML | ||
| @* Change the color of the labels to blue *@ | ||
|
|
||
| <TelerikRadialGauge> | ||
| <RadialGaugeScales> | ||
| <RadialGaugeScale> | ||
| <RadialGaugeScaleLabels Color="blue"> | ||
| </RadialGaugeScaleLabels> | ||
| </RadialGaugeScale> | ||
| </RadialGaugeScales> | ||
|
|
||
| <RadialGaugePointers> | ||
|
|
||
| <RadialGaugePointer Value="30"> | ||
| </RadialGaugePointer> | ||
|
|
||
| </RadialGaugePointers> | ||
| </TelerikRadialGauge> | ||
| ```` | ||
|
|
||
| ## Visible | ||
|
|
||
| The `Visible` (`bool`) parameter controls wether the labels will be rendered. | ||
|
|
||
| >caption Hide the labels by using the Visible parameter. The result from the code snippet below | ||
|
|
||
|  | ||
|
|
||
| ````CSHTML | ||
| @* Set the Visible parameter to false to hide the labels *@ | ||
|
|
||
| <TelerikRadialGauge> | ||
| <RadialGaugeScales> | ||
| <RadialGaugeScale> | ||
| <RadialGaugeScaleLabels Visible="false"> | ||
| </RadialGaugeScaleLabels> | ||
| </RadialGaugeScale> | ||
| </RadialGaugeScales> | ||
|
|
||
| <RadialGaugePointers> | ||
|
|
||
| <RadialGaugePointer Value="30"> | ||
| </RadialGaugePointer> | ||
|
|
||
| </RadialGaugePointers> | ||
| </TelerikRadialGauge> | ||
| ```` | ||
|
|
||
| ## Additional Customization | ||
|
|
||
| @[template](/_contentTemplates/gauges/additional-customization.md#radial-gauge-additional-customization) | ||
|
|
||
| >caption Customize the background and the margin of the Labels. The result from the code snippet below. | ||
|
|
||
|  | ||
|
|
||
| ````CSHTML | ||
| @* Provide background color and margin to the labels *@ | ||
|
|
||
| <TelerikRadialGauge> | ||
| <RadialGaugeScales> | ||
|
|
||
| <RadialGaugeScale> | ||
| <RadialGaugeScaleLabels Background="yellow"> | ||
| <RadialGaugeScaleLabels Margin Top="10" Bottom="10" Left="10" Right="10"></RadialGaugeScaleLabelsMargin> | ||
| </RadialGaugeScaleLabels> | ||
| </RadialGaugeScale> | ||
| </RadialGaugeScales> | ||
|
|
||
| <RadialGaugePointers> | ||
|
|
||
| <RadialGaugePointer Value="30"> | ||
| </RadialGaugePointer> | ||
|
|
||
| </RadialGaugePointers> | ||
| </TelerikRadialGauge> | ||
| ```` | ||
|
|
||
| ## See Also | ||
|
|
||
| * [Radial Gauge: Live Demo](https://demos.telerik.com/blazor-ui/radial-gauge) | ||
| * [Radial Gauge: Overview]({%slug radial-gauge-overview%}) | ||
| * [Radial Gauge: Scale]({%slug radial-gauge-scale%}) | ||
| * [Radial Gauge: Pointers]({%slug radial-gauge-pointers%}) | ||
| * [Radial Gauge: Ranges]({%slug radial-gauge-ranges%}) |
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 |
|---|---|---|
| @@ -1,147 +1,113 @@ | ||
| --- | ||
| title: Overview | ||
| page_title: Chart Overview | ||
| description: Overview of the Chart for Blazor. | ||
| page_title: Radial Gauge Overview | ||
| description: Overview of the Radial Gauge for Blazor. | ||
| slug: radial-gauge-overview | ||
| tags: telerik,blazor,chart,overview | ||
| tags: telerik,blazor,radial,gauge,overview | ||
| published: True | ||
| position: 0 | ||
| --- | ||
|
|
||
| # Chart Overview | ||
| # Radial Gauge Overview | ||
|
|
||
| The <a href="https://www.telerik.com/blazor-ui/chart" target="_blank">Blazor Chart component</a> allows you to visualize data to your users in a meaningful way so they can draw conclusions. You can use a variety of chart types and control all aspects of the chart's appearance - from colors and fonts, to paddings, margins and templates. | ||
| The Telerik Radial Gauge for Blazor represents numerical values on a [scale]({%slug radial-gauge-scale%}) of ranges in a radial format. | ||
|
|
||
| #### To use a Telerik chart for Blazor, add the `TelerikChart` tag. | ||
| #### This article is separated in the following sections: | ||
|
|
||
| >caption Basic chart with series and category axis [data binding](data-bind), and a few commonly used appearance settings | ||
| * [Basics](#basics) | ||
|
|
||
| ````CSHTML | ||
| Basic chart and common settings/elements | ||
|
|
||
| <TelerikChart> | ||
| <ChartSeriesItems> | ||
| <ChartSeries Type="ChartSeriesType.Line" Name="Product 1 (bound to simple data)" Data="@simpleData"> | ||
| </ChartSeries> | ||
| <ChartSeries Type="ChartSeriesType.Line" Name="Product 2 (bound to model)" Data="@modelData" Field="@nameof(MyDataModel.SecondSeriesValue)"> | ||
| <ChartSeriesLabels Template="#=value# in #=dataItem.ExtraData# quarter" Visible="true"></ChartSeriesLabels> | ||
| </ChartSeries> | ||
| </ChartSeriesItems> | ||
| * [Features](#features) | ||
|
|
||
| <ChartValueAxes> | ||
| <ChartValueAxis Color="red"></ChartValueAxis> | ||
| </ChartValueAxes> | ||
| * [Methods](#methods) | ||
|
|
||
| <ChartCategoryAxes> | ||
| <ChartCategoryAxis Categories="@xAxisItems"></ChartCategoryAxis> | ||
| </ChartCategoryAxes> | ||
| ## Basics | ||
|
|
||
| <ChartTitle Text="Quarterly sales trend"></ChartTitle> | ||
| >caption To add a Telerik Radial Gauge for Blazor to your application: | ||
|
|
||
| <ChartLegend Position="Telerik.Blazor.ChartLegendPosition.Bottom"> | ||
| </ChartLegend> | ||
| </TelerikChart> | ||
| 1. Add the `<TelerikRadialGauge>` tag. | ||
|
|
||
| @code { | ||
| public class MyDataModel | ||
| { | ||
| public int SecondSeriesValue { get; set; } | ||
| public string ExtraData { get; set; } | ||
| 1. Add one or more instances of the `<RadialGaugePointer>` to the `<RadialGaugePointers>` collection. | ||
|
|
||
| } | ||
| 1. Provide a `Value` for each `<RadialGaugePointer>`. | ||
|
|
||
| public List<MyDataModel> modelData = new List<MyDataModel>() | ||
| { | ||
| new MyDataModel() { SecondSeriesValue = 1, ExtraData = "first" }, | ||
| new MyDataModel() { SecondSeriesValue = 5, ExtraData = "second" }, | ||
| new MyDataModel() { SecondSeriesValue = 3, ExtraData = "third" }, | ||
| new MyDataModel() { SecondSeriesValue = 2, ExtraData = "fourth" }, | ||
| }; | ||
| >caption Basic Telerik Radial Gauge for Blazor. | ||
|
|
||
| public List<object> simpleData = new List<object>() { 10, 2, 7, 5 }; | ||
|  | ||
|
|
||
| public string[] xAxisItems = new string[] { "Q1", "Q2", "Q3", "Q4" }; | ||
| } | ||
| ````CSHTML | ||
| @* Setup a basic radial gauge *@ | ||
|
|
||
| <TelerikRadialGauge> | ||
| <RadialGaugePointers> | ||
| <RadialGaugePointer Value="20"> | ||
| </RadialGaugePointer> | ||
| </RadialGaugePointers> | ||
| </TelerikRadialGauge> | ||
| ```` | ||
|
|
||
| >caption The result from the code snippet above | ||
|
|
||
|  | ||
|
|
||
| ## Features | ||
|
|
||
| The Telerik Radial Gauge for Blazor exposes the following features: | ||
|
|
||
| @[template](/_contentTemplates/chart/link-to-basics.md#configurable-nested-chart-settings) | ||
| #### Radial Gauge Size | ||
|
|
||
| >caption Component namespace and reference | ||
| * `Width` - `string` - controls the width of the component. You can read more on how they work in the [Dimensions]({%slug common-features/dimensions%}) article. | ||
|
|
||
| ````CSHTML | ||
| @using Telerik.Blazor.Components | ||
| * `Height` - `string` - controls the height of the component. You can read more on how they work in the [Dimensions]({%slug common-features/dimensions%}) article. | ||
|
|
||
| <TelerikChart @ref="myChartRef"> | ||
| </TelerikChart> | ||
| You can also set the Gauge size in percentage values so it occupies its container when it renderes. If the parent container size changes, you must call the gauge's `Refresh()` C# [method](#methods) after the DOM has been redrawn and the new container dimensions are rendered. | ||
|
|
||
| @code { | ||
| Telerik.Blazor.Components.TelerikChart myChartRef; | ||
| } | ||
| ```` | ||
| #### Other Features | ||
|
|
||
| ## Chart Size | ||
| * `Class` - renders a custom CSS class on the topmost wrapping element of the component. You can use that class to reposition the component on the page. | ||
|
|
||
| To control the chart size, use its `Width` and `Height` properties. You can read more on how they work in the [Dimensions]({%slug common-features/dimensions%}) article. | ||
| * [Scale]({%slug radial-gauge-scale%}) - The scale of the radial gauge renders the values of the [pointers]({%slug radial-gauge-pointers%}), different [ranges]({%slug radial-gauge-ranges%}) and [labels]({%slug radial-gauge-labels%}). | ||
|
|
||
| You can also set the chart size in percentage values so it occupies its container when it renderes. If the parent container size changes, you must call the chart's `Refresh()` C# method after the DOM has been redrawn and the new container dimensions are rendered. You can do this when you explicitly change container sizes (like in the example below), or from code that gets called by events like `window.resize`. You can find an example of making charts redraw on `window.resize` in the [Responsive Chart](https://github.com/telerik/blazor-ui/tree/master/chart/responsive-chart) sample. | ||
| * [Ranges]({%slug radial-gauge-ranges%}) - The ranges are used to visually distinguish particular values on the scale. | ||
|
|
||
| * [Labels]({%slug radial-gauge-labels%}) - The labels are rendered on the scale of the component to give information to the users. | ||
|
|
||
| >caption Change the 100% chart size dynamically to have a responsive chart | ||
| * [Pointers]({%slug radial-gauge-pointers%}) - The pointers indicate the values on the scale of the component. | ||
|
|
||
| ````CSHTML | ||
| You can make a responsive chart | ||
| ## Methods | ||
|
|
||
| <TelerikButton OnClick="@ResizeChart">Resize the container and redraw the chart</TelerikButton> | ||
| The Radial Gauge reference exposes the `Refresh` method which allows you to programatically re-render the component. | ||
|
|
||
| <div style="border: 1px solid red;width:@ContainerWidth; height: @ContainerHeight"> | ||
| >caption Get a component reference and use the Refresh method | ||
|
|
||
| <TelerikChart Width ="100%" Height="100%" @ref="theChart"> | ||
| ````CSHTML | ||
| @* Change the Height of the component *@ | ||
|
|
||
| <ChartSeriesItems> | ||
| <ChartSeries Type="ChartSeriesType.Column" Name="Product 1" Data="@someData"> | ||
| </ChartSeries> | ||
| </ChartSeriesItems> | ||
| <ChartCategoryAxes> | ||
| <ChartCategoryAxis Categories="@xAxisItems"></ChartCategoryAxis> | ||
| </ChartCategoryAxes> | ||
| <ChartTitle Text="Quarterly sales trend"></ChartTitle> | ||
| <TelerikButton OnClick="@ChangeHeight">Change the height</TelerikButton> | ||
|
|
||
| </TelerikChart> | ||
| <TelerikRadialGauge @ref="@RadialGaugeRef" Height="@Height"> | ||
| <RadialGaugePointers> | ||
| <RadialGaugePointer Value="20"> | ||
| </RadialGaugePointer> | ||
| </RadialGaugePointers> | ||
| </TelerikRadialGauge> | ||
|
|
||
| </div> | ||
| @code{ | ||
| Telerik.Blazor.Components.TelerikRadialGauge RadialGaugeRef { get; set; } | ||
|
|
||
| @code { | ||
| string ContainerWidth { get; set; } = "400px"; | ||
| string ContainerHeight { get; set; } = "300px"; | ||
| Telerik.Blazor.Components.TelerikChart theChart { get; set; } | ||
| public string Height { get; set; } = "200px"; | ||
|
|
||
| async Task ResizeChart() | ||
| async Task ChangeHeight() | ||
| { | ||
| //resize the container | ||
| ContainerHeight = "500px"; | ||
| ContainerWidth = "800px"; | ||
| Height = "400px"; | ||
|
|
||
| //give time to the framework and browser to resize the actual DOM so the chart can use the expected size | ||
| await Task.Delay(20); | ||
| //give time to the framework and browser to resize the actual DOM so the gauge can use the expected size | ||
| await Task.Delay(30); | ||
|
|
||
| //redraw the chart | ||
| theChart.Refresh(); | ||
| RadialGaugeRef.Refresh(); | ||
| } | ||
|
|
||
| public List<object> someData = new List<object>() { 10, 2, 7, 5 }; | ||
|
|
||
| public string[] xAxisItems = new string[] { "Q1", "Q2", "Q3", "Q4" }; | ||
| } | ||
| ```` | ||
|
|
||
| ## See Also | ||
|
|
||
| * [Data Binding]({%slug components/chart/databind%}) | ||
| * [Live Demos: Chart](https://demos.telerik.com/blazor-ui/chart/index) | ||
| * [API Reference](https://docs.telerik.com/blazor-ui/api/Telerik.Blazor.Components.TelerikChart) | ||
| * [Radial Gauge: Live Demo](https://demos.telerik.com/blazor-ui/radial-gauge) | ||
| * [Radial Gauge: Scale]({%slug radial-gauge-scale%}) | ||
| * [Radial Gauge: Pointers]({%slug radial-gauge-pointers%}) | ||
| * [Radial Gauge: Ranges]({%slug radial-gauge-ranges%}) | ||
| * [Radial Gauge: Labels]({%slug radial-gauge-labels%}) | ||
Oops, something went wrong.
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.