score:0
Accepted answer
i solved it by playing with the lintto
and linewidth
values
my final code looks like this:
chart.controllers.bar = chart.controllers.bar.extend({
draw: function (ease) {
chart.controllers.line.prototype.draw.call(this, ease);
if (this.chart.tooltip._active && this.chart.tooltip._active.length) {
var activepoint = this.chart.tooltip._active[0],
ctx = this.chart.ctx,
x = activepoint.tooltipposition().x,
topy = 1000000,
width = activepoint._view.width,
bottomy = 0;
ctx.save();
ctx.beginpath();
ctx.moveto(x, topy);
ctx.lineto(x, bottomy);
ctx.linewidth = width + 20;
ctx.strokestyle = 'rgba(0, 123, 255, 0.1)';
ctx.stroke();
ctx.restore();
}
}
});
Source: stackoverflow.com
Related Query
- How to draw a hover effect behind a bar chart?
- How do I draw a vertical line on a horizontal bar chart with ChartJS?
- How to draw Horizontal line on Bar Chart Chartjs
- How to draw baseline for bar chart in chart.js
- How to draw multiple color bar in a bar chart using chart.js
- How to draw multiple color bars in a bar chart along a Horizontal Line using chart.js
- How we can draw a circle in bar chart
- How do you create rounded corners on the top and bottom of a bar chart and the between 2 part still draw like image?
- How to clear a chart from a canvas so that hover events cannot be triggered?
- chart js 2 how to set bar width
- Chart.js Bar Chart - how to chart bars from 0
- How to put rounded corners on a Chart.js Bar chart
- chartjs : how to set custom scale in bar chart
- How to Draw Gantt chart using chart js or other libraries
- How to add second Y-axis for Bar and Line chart in Chart.js?
- How to create stacked bar chart using react-chartjs-2?
- Changing cursor to pointer on Chart.js bar chart when hover (mousemove) event is disabled?
- Chart.js v2 is there a way to draw bar chart horizontally?
- How to display inline values in a stacked bar chart with Chart.js?
- Chart.js - Draw bar chart with multiple labels
- Draw a horizontal and vertical line on mouse hover in chart js
- How to change the cursor to a pointer when I hover over a bar in a ChartJS bar chart?
- Chartjs - show elements in all datasets on hover using bar chart
- How to hide the y axis and x axis line and label in my bar chart for chart.js
- How to have solid colored bars in angular-chart bar chart
- how to make a chart.js bar chart scrollable
- how to add a title to my ng2-charts bar chart
- PrimeNg bar chart how to show a label for the y-axis
- How can I trigger the hover mode from outside the chart with charts.js 2?
- How to set single color on each bar in angular chart js
More Query from same tag
- bind first property value of an array of object into chart.js
- How to add a second set of labels to a Chart.js doughnut chart?
- Hiding Chart.js labels in Angular6
- Chart.js doughnut canvas padding
- Chart.JS - Polar area - Legend hover style and margin
- how to show REALTIME chartjs of specific ID in mysql when click on corresponding marker on googlemap javascript
- Chart.js Thick label gets replaced by three dots
- How to loop tooptip additional data in chart.js
- Chartjs disable legend click does not work when condition is not evaluated
- Chart.js misreading arrays for labels and axes
- How can I format chart.js data labels while using chart.js datalabels plugin?
- Chart.js is not rendered until zoom in in angular 8
- How can I configure Chart.js in a Electron app?
- Is there a way to draw floating rectangle using chart.js
- convert csv to json for javascript plotting library chartjs in Python or PHP
- Angular 6 multiple dynamic Charts.js not showing
- Non numeric for x-axis in scatter chart in CHART.js
- How to show bar labels in legend in Chart.js 2.1.6?
- Chart.js: Creating a Barchart with overlaying and offset Bars
- Chart.js configuration
- Angular Overlapping bars using chart.js
- Chart JS - Bubble Chart is not getting rendered when loaded Dynamically
- Chart js always show labels on a doughnut chart
- Connect 2 line in chart using chartjs
- data from api not showing in chart.js (angular)
- Representing multiple subsections within a section of a doughnut chart Chart.js
- Javascript - Create objects to push in array
- chart.js npm module not working
- Charts.JS Bars Not Alternating Color
- Fixed time frame in Chart.JS