mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
feature: choose custom point style for bar legend display (#8341)
* add feature to choose custom point style for bar legend display * add documentation and type * the docs are in the right place now
This commit is contained in:
parent
8cca4fe5b9
commit
bc312d0dbc
@ -93,6 +93,7 @@ the color of the bars is generally set this way.
|
||||
| [`indexAxis`](#general) | `string` | - | - | `'x'`
|
||||
| [`label`](#general) | `string` | - | - | `''`
|
||||
| [`order`](#general) | `number` | - | - | `0`
|
||||
| [`pointStyle`](../configuration/elements.md#point-styles) | `string`\|`Image` | Yes | False | `'circle'`
|
||||
| [`xAxisID`](#general) | `string` | - | - | first x axis
|
||||
| [`yAxisID`](#general) | `string` | - | - | first y axis
|
||||
|
||||
|
||||
@ -522,6 +522,7 @@ BarController.defaults = {
|
||||
'categoryPercentage',
|
||||
'maxBarThickness',
|
||||
'minBarLength',
|
||||
'pointStyle'
|
||||
],
|
||||
interaction: {
|
||||
mode: 'index'
|
||||
|
||||
@ -95,7 +95,7 @@ describe('Legend block tests', function() {
|
||||
lineJoin: undefined,
|
||||
lineWidth: 10,
|
||||
strokeStyle: 'green',
|
||||
pointStyle: undefined,
|
||||
pointStyle: 'crossRot',
|
||||
rotation: undefined,
|
||||
datasetIndex: 2
|
||||
}]);
|
||||
@ -311,7 +311,7 @@ describe('Legend block tests', function() {
|
||||
lineJoin: undefined,
|
||||
lineWidth: 10,
|
||||
strokeStyle: 'green',
|
||||
pointStyle: undefined,
|
||||
pointStyle: 'crossRot',
|
||||
rotation: undefined,
|
||||
datasetIndex: 2
|
||||
}]);
|
||||
@ -887,4 +887,3 @@ describe('Legend block tests', function() {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
6
types/index.esm.d.ts
vendored
6
types/index.esm.d.ts
vendored
@ -125,6 +125,12 @@ export interface BarControllerDatasetOptions
|
||||
* Set this to ensure that bars have a minimum length in pixels.
|
||||
*/
|
||||
minBarLength: number;
|
||||
|
||||
/**
|
||||
* Point style for the legend
|
||||
* @default 'circle;
|
||||
*/
|
||||
pointStyle: PointStyle;
|
||||
}
|
||||
|
||||
export interface BarControllerChartOptions {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user