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:
LeeLenaleee 2021-01-30 17:02:08 +01:00 committed by GitHub
parent 8cca4fe5b9
commit bc312d0dbc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 3 deletions

View File

@ -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

View File

@ -522,6 +522,7 @@ BarController.defaults = {
'categoryPercentage',
'maxBarThickness',
'minBarLength',
'pointStyle'
],
interaction: {
mode: 'index'

View File

@ -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() {
});
});
});

View File

@ -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 {