Skip to content

Commit 9eef2e0

Browse files
author
Kendo Bot
committed
Sync with Kendo UI Professional
1 parent 0ff0e43 commit 9eef2e0

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

docs/api/javascript/dataviz/ui/chart.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9639,6 +9639,12 @@ The supported values are:
96399639
});
96409640
</script>
96419641

9642+
### series.autoFit `Boolean` *(default: false)*
9643+
9644+
If set to true, the Chart automatically scales down to fit the content area. Applicable for the Pie and Donut series ([see example]({% slug pietypecharts_widget %}#auto-fit-labels)).
9645+
9646+
> The `autoFit` option is supported when [series.type](/api/javascript/dataviz/ui/chart#configuration-series.type) is set to "pie" or "donut".
9647+
96429648
### series.axis `String` *(default: "primary")*
96439649

96449650
The name of the value axis to use.

docs/controls/charts/chart-types/pie-charts.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,48 @@ The following example demonstrates how to define a single series of type `"pie"`
5858

5959
![A sample Pie Chart](chart-pie.png)
6060

61+
## Auto-Fit Labels
62+
63+
Use the Series [autoFit option](/api/javascript/dataviz/ui/chart/configuration/series.autofit) to avoid clipping of the labels' content.
64+
65+
```dojo
66+
<div id="chart" style="width: 200px;"></div>
67+
<script>
68+
var data = [{
69+
kind: 'Solar', share: 0.052
70+
}, {
71+
kind: 'Wind', share: 0.225
72+
}, {
73+
kind: 'Other', share: 0.192
74+
}, {
75+
kind: 'Hydroelectric', share: 0.175
76+
}, {
77+
kind: 'Nuclear', share: 0.238
78+
}, {
79+
kind: 'Coal', share: 0.118
80+
}];
81+
82+
$("#chart").kendoChart({
83+
dataSource: { data: data },
84+
series: [{
85+
type: "pie",
86+
field: "share",
87+
categoryField: "kind",
88+
autoFit: true,
89+
labels: {
90+
color: "#000",
91+
position: "outsideEnd",
92+
template: "#: category #",
93+
visible: true
94+
}
95+
}],
96+
legend: {
97+
visible: false
98+
}
99+
});
100+
</script>
101+
```
102+
61103
## Configuring the Effects Overlay
62104

63105
Each segment has a transparent effect overlay that adds depth to the two-dimensional shape. The overlay transparent gradient is configurable.

0 commit comments

Comments
 (0)