mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 12:19:08 +02:00
Doughnut chart options have an offset property (#9916)
This commit is contained in:
parent
7cbc47becc
commit
f8992a6168
10
types/index.esm.d.ts
vendored
10
types/index.esm.d.ts
vendored
@ -244,6 +244,11 @@ export interface DoughnutControllerDatasetOptions
|
||||
*/
|
||||
circumference: number;
|
||||
|
||||
/**
|
||||
* Arc offset (in pixels).
|
||||
*/
|
||||
offset: number;
|
||||
|
||||
/**
|
||||
* Starting angle to draw this dataset from.
|
||||
* @default 0
|
||||
@ -292,6 +297,11 @@ export interface DoughnutControllerChartOptions {
|
||||
*/
|
||||
cutout: Scriptable<number | string, ScriptableContext<'doughnut'>>;
|
||||
|
||||
/**
|
||||
* Arc offset (in pixels).
|
||||
*/
|
||||
offset: number;
|
||||
|
||||
/**
|
||||
* The outer radius of the chart. String ending with '%' means percentage of maximum radius, number means pixels.
|
||||
* @default '100%'
|
||||
|
15
types/tests/controllers/doughnut_offset.ts
Normal file
15
types/tests/controllers/doughnut_offset.ts
Normal file
@ -0,0 +1,15 @@
|
||||
import { Chart, ChartMeta, Element } from '../../index.esm';
|
||||
|
||||
const chart = new Chart('id', {
|
||||
type: 'doughnut',
|
||||
data: {
|
||||
labels: [],
|
||||
datasets: [{
|
||||
data: [],
|
||||
offset: 40,
|
||||
}]
|
||||
},
|
||||
options: {
|
||||
offset: 20,
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue
Block a user