From 14010530d7cf92b57a3db55b9270632a879081e7 Mon Sep 17 00:00:00 2001 From: stockiNail Date: Wed, 30 Oct 2019 23:42:15 +0100 Subject: [PATCH] Added the global datasets defaults for new extended chart type (#6649) Added documentation to create a global datasets default for new extended chart type. This is currently mandatory for BAR/HORIZONTALBAR charts (see issue [#6636](https://github.com/chartjs/Chart.js/issues/6636)) --- docs/developers/charts.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/developers/charts.md b/docs/developers/charts.md index bf63b5f02..e3949b064 100644 --- a/docs/developers/charts.md +++ b/docs/developers/charts.md @@ -67,6 +67,7 @@ Extending or replacing an existing controller type is easy. Simply replace the c The built in controller types are: * `Chart.controllers.line` * `Chart.controllers.bar` +* `Chart.controllers.horizontalBar` * `Chart.controllers.radar` * `Chart.controllers.doughnut` * `Chart.controllers.polarArea` @@ -80,6 +81,10 @@ For example, to derive a new chart type that extends from a bubble chart, you wo // It looks like a bug exists when the defaults don't exist Chart.defaults.derivedBubble = Chart.defaults.bubble; +// Sets the default dataset config for 'derivedBubble' to be the same as the bubble dataset defaults. +// It looks like a bug exists when the dataset defaults don't exist +Chart.defaults.global.datasets.derivedBubble = Chart.defaults.global.datasets.bubble; + // I think the recommend using Chart.controllers.bubble.extend({ extensions here }); var custom = Chart.controllers.bubble.extend({ draw: function(ease) { -- 2.47.2