Error: Cannot read property 'tooltip' of undefined
See original GitHub issueHello,
I am using and existing Angular2-Bootstrap template for my dashboard application and it had some Chartist bar and lines charts with them. I am ableto load data from an API into the chart as expected, but when I try to add the tooltip plugin onto the chart, I get this error
Cannot read property ''tooltip’of undefined.
When I remove the code, the graph draws properly, when I just insert the plugin, the graph doesn’t render and nothing else executes within the page.
Here is what I have. In my package.json,
"chartist-plugins-tooltip": "0.0.11"
In my dashboard.ts
const dataFromAPI = {
labels: data.labels,
series: [data.series]
};
const optionsForChart = {
axisX: {
showGrid: false,
},
low: 0,
high: 500,
chartPadding: { top: 0, right: 5, bottom: 0, left: 0},
plugins: [
Chartist.plugins.tooltip() // This is where I get the error. Cannot read property 'tooltip' of undefined
]
}
const responsiveOptions = {
.......
}
const createChartForDataFromAPI = new Chartist.Line('#idofthechart',dataFromAPI, optionsForChart, responsiveOptions);
I have no idea why I get this error. Anything I’'m doing wrong?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10
Top Results From Across the Web
Treemap - Cannot read property 'tooltip' of undefined #894
Hi! I'm unable to use Treemap in interactive mode. When the user hovers the chart it disappears with this error: nivo-tooltip.esm.js:160 ...
Read more >Bootstrap Tooltip "Uncaught TypeError: Cannot read property ...
When I try to display a new tooltip, after destroying the old one, I get "Uncaught TypeError: Cannot read property 'trigger' of null"...
Read more >Tooltip : TypeError: Cannot read property '0&
Hi,. Tooltips and popovers were completely rebuilt in version 4.12.0 (complete changelog) ...
Read more >Custom tooltip - Uncaught TypeError: Cannot read properties ...
I am developing custom simple visual where I would like to use built-in tooltips, I integrated it by documentation steps, but I am...
Read more >Cannot read property 'tooltip' of undefined at pqgrid.min.js:9
I have download the paramQuery Grid jQuery library (download option available) from portal. When I tried with ASP.Net MVC + jQuery Application, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I used chartist in an angular project, and for me the solution was that to use it:
import * as Legends from ‘chartist-plugin-legend’; //or import any other plugin that You are using and in the constructor initalize an object: var legend = Legends;
and use this object in the chart options plugins: plugins: [ Chartist.plugins.legend({ legendNames: classNames, position: ‘bottom’ }) ]
@estomagordo You can find it in this file: https://github.com/tmmdata/chartist-plugin-tooltip/blob/v0.0.17/dist/chartist-plugin-tooltip.js#L204