From: Evert Timberg Date: Fri, 2 Apr 2021 21:25:14 +0000 (-0400) Subject: Clean up a few sample issues (#8790) X-Git-Tag: v3.1.0~47 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=96dd2010288e674b889023866d595e584f1ae875;p=thirdparty%2FChart.js.git Clean up a few sample issues (#8790) --- diff --git a/docs/charts/bar.md b/docs/charts/bar.md index c9806ac70..d71b553de 100644 --- a/docs/charts/bar.md +++ b/docs/charts/bar.md @@ -237,7 +237,7 @@ It is common to want to apply a configuration setting to all created bar charts. The following shows the relationship between the bar percentage option and the category percentage option. -```text +``` // categoryPercentage: 1.0 // barPercentage: 1.0 Bar: | 1.0 | 1.0 | diff --git a/docs/samples/tooltip/interactions.md b/docs/samples/tooltip/interactions.md index 0b1a995bc..2ee3deca8 100644 --- a/docs/samples/tooltip/interactions.md +++ b/docs/samples/tooltip/interactions.md @@ -8,6 +8,7 @@ const actions = [ { name: 'Mode: index', handler(chart) { + chart.options.interaction.axis = 'xy'; chart.options.interaction.mode = 'index'; chart.update(); } @@ -15,6 +16,7 @@ const actions = [ { name: 'Mode: dataset', handler(chart) { + chart.options.interaction.axis = 'xy'; chart.options.interaction.mode = 'dataset'; chart.update(); } @@ -22,6 +24,7 @@ const actions = [ { name: 'Mode: point', handler(chart) { + chart.options.interaction.axis = 'xy'; chart.options.interaction.mode = 'point'; chart.update(); } @@ -29,6 +32,7 @@ const actions = [ { name: 'Mode: nearest', handler(chart) { + chart.options.interaction.axis = 'xy'; chart.options.interaction.mode = 'nearest'; chart.update(); } diff --git a/docs/samples/tooltip/position.md b/docs/samples/tooltip/position.md index e5e1d5fa3..fba8eaa36 100644 --- a/docs/samples/tooltip/position.md +++ b/docs/samples/tooltip/position.md @@ -57,6 +57,12 @@ const data = { // Create a custom tooltip positioner to put at the bottom of the chart area components.Tooltip.positioners.bottom = function(items) { const pos = components.Tooltip.positioners.average(items); + + // Happens when nothing is found + if (pos === false) { + return false; + } + const chart = this._chart; return {