I have a line chart and I set up my tooltip like this It works fine. The problem I have is that when I move my cursor to the x-axis ticks, which are outside the main plot/canvas, the tooltips stills appear. I’ve tried to set intersect: true but then the tooltip only shows up when I hover directly over the
Tag: chart.js2
HorizontalBar chart is displayed below canvas when I set height with style attribute for chart div (Chart.js 2.9.4)
If I set height with style attribute for chart div <div id=”chartDiv” style=”height: 100px; border: 1px solid red;”><canvas id=”chart”></canvas></div> chart is looking like that (chart is displayed below canvas): How to fix that? Answer It’s showing like this because canvas’s aspect ratio is changing automatically with window size but you’ve set your div to a specific height of 100px. That’s
remove strikethrough behavior in chart.js bar chart
i am trying to change the look of the legends by removing the strikethrough effect , wihtout using legendCallback function in chart.js. The reason why i do not want to use the legendCallback function because i have my own custmizations in chart.options.legend.onClick. hence if i use legendCallback i won’t be able to use the chart.options.legend.onClick. after carefully looking at the
Chart.js OnClick event with a mixed chart, which chart did I click?
EDIT: Modified to add options, and a suggested (from the answer) chartClickEvent, here is a jsfiddle: http://jsfiddle.net/jmpxgufu/174/ Imagine if you will a Chart.js mixed chart with the following config: As my chartClickEvent says, my array is length 2, because I have two charts. That’s great and all, but I have no idea how to figure out whether to use array[0]
Chart.js v2 – hiding grid lines
I am using Chart.js v2 to draw a simple line chart. Everything looks fine, except there are grid lines that I don’t want: The documentation for Line Chart is here: https://nnnick.github.io/Chart.js/docs-v2/#line-chart, but I can’t find anything about hiding those “Grid Lines”. How can I remove the grid lines? Answer I found a solution that works for hiding the grid lines