diff --git a/docs/docs/charts/bar.mdx b/docs/docs/charts/bar.mdx index bf49cc6ef94..142e752bef2 100644 --- a/docs/docs/charts/bar.mdx +++ b/docs/docs/charts/bar.mdx @@ -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 diff --git a/src/controllers/controller.bar.js b/src/controllers/controller.bar.js index 89d4d591802..24bd6756659 100644 --- a/src/controllers/controller.bar.js +++ b/src/controllers/controller.bar.js @@ -522,6 +522,7 @@ BarController.defaults = { 'categoryPercentage', 'maxBarThickness', 'minBarLength', + 'pointStyle' ], interaction: { mode: 'index' diff --git a/test/specs/plugin.legend.tests.js b/test/specs/plugin.legend.tests.js index 79d149c210b..198c3785af7 100644 --- a/test/specs/plugin.legend.tests.js +++ b/test/specs/plugin.legend.tests.js @@ -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() { }); }); }); - diff --git a/types/index.esm.d.ts b/types/index.esm.d.ts index a018fa5ef24..cf2d6dd50eb 100644 --- a/types/index.esm.d.ts +++ b/types/index.esm.d.ts @@ -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 {