score:-2
Try use:
return tooltip + "<br />" + otherTooltip;
score:7
The way to do it, is just adding a callback function for the tooltip property that returns an array of strings, each one of the strings will be placed in a new line.
tooltips: {
callbacks: {
label: function (tooltipItem, data) {
return ['first thing', 'another thing', 'and another one'];
}
}
}
See this jsfiddle...
Source: stackoverflow.com
Related Query
- Chart js v2 tooltip callback line breaks
- Chartjs Tooltip Line Breaks
- show label in tooltip but not in x axis for chartjs line chart
- Callback after line chart rendered
- Chart.js line chart tooltip shows wrong label when line doesn't start at first label
- Add a text as tooltip for each point on a line chart
- ChartJS (React) Line Chart - How to show single tooltip with data and labels from 3 (multiple) dataset?
- Chart.js tooltip not showing on line chart
- Chart.js v3: Tooltip callback doesn't identify clicked dataset of stacked bar chart
- How to sort XY line chart tooltip items based on value and add thousands separators?
- Chart.js - Horizontal line on Bar chart interferes with tooltip
- nnnick chart.js - Custom Tooltip on Line Chart
- Chart.js Line chart fixed tooltip
- Chart.js two y axes line chart tooltip value incorrect for 2nd y axis
- chart.js break line in a label with a tooltip callback
- How to get access to Chart instance related to current tooltip callback in Chart.js
- chartjs - How to access chart instance in a custom tooltip callback
- Chart.js – Line Chart Tooltip Labels
- Disable tooltip for Line chart for one line
- How to change React line chart tooltip title font family in chart.js
- Tooltip callbacks in line chart JS not working
- How to always show line chart tooltip in ionic-angular.?
- Display Chartjs tooltip values outside the canvas - multi line chart
- Unable to get Line Chart tooltip on ChartJS
- Limit labels number on Chart.js line chart
- Chart.js - How to set a line chart dataset as disabled on load
- Chart Js Change Label orientation on x-Axis for Line Charts
- Draw horizontal line on chart in chart.js on v2
- How can I create a horizontal scrolling Chart.js line chart with a locked y axis?
- Remove the vertical line in the chart js line chart
More Query from same tag
- Chart.JS Data Element To Be settled as Euro Currency
- Canvas Emptied but Reappears
- How to set the xAxes min and max values of time cartesian chart in Chart.js
- Chart JS - How to output JSON objects into PIE variant
- Chart.js: change title/legend positon to right
- Using loops to create data arrays
- How do I persist the gridlines for ticks that are not displayed? [Chart.js]
- Using Chart.js with Gatsby markdown
- Negative bar chart of highcharts in chartjs
- Custom background limits for Doughnut (Gauge)
- How to fix a stacked logarithmic bar chart values to fit the grid
- Chart.js Passing an array starting with 1 instead of 0 problem
- function not return values
- React Native Updating State with Api
- I can't display the vue-chart.js on the page
- Chartjs! How to remove datalabel when value is 0
- How to display laravel variables in JSON in laravel view- Charts.js
- Ionic 3 Angular Chart.js update data
- Label not showing in Chart.js with Grails
- Chartjs Line chart options display increase and decrease percentage between each datapoint
- VueJs and ChartJs - Chart is responsive in width, but not height?
- chartJS Horizontal Bar - Hide Stacked Bars But Still Show In Tooltip
- Remove background color in chartjs line chart
- Chart.js line chart looking as area chart with smooth lines but not sharp
- ChartJS fails to render one of the lines in cartesian chart following update after change to max Y axis label value
- ChartJs - Doughnut Chart - how to remove labels if percentage is less than a limit
- Calculate weighted sum over all points in chart.js
- ChartJS Line Chart - Points Connected out of order for Timeseries in Angular 6
- Is it possible to add a javascript chart in a webview in Xamari.Forms
- How to hide other section of chartjs on click of lengend