Comments (4)
Click event should not be fired twice. It should not be fired on map drag, either.
Here's your map in a standalone setting:
https://codepen.io/team/amcharts/pen/3119e0e372f3c0bf7eddf179a60f9aee
I works as expected.
Could you double check if you are running the latest version? (3.21.4) I remember having us fixed click event in some version.
from amcharts3-angular2.
@rbasniak Also make sure that you're using this.AmCharts.updateChart
when making any changes to the chart, including when adding event listeners:
this.chart = this.AmCharts.makeChart("chartdiv", {
"type": "map",
"theme": "light",
"dataProvider": {
"map": "worldLow",
"getAreasFromMap": true
},
"areasSettings": {
"autoZoom": false,
"selectedColor": "#CC0000"
}
});
this.AmCharts.updateChart(this.chart, () => {
this.chart.addListener("click", event => {
// find out the coordinates of under mouse cursor
var info = event.chart.getDevInfo();
// print in console as well
console.log({
"latitude": info.latitude,
"longitude": info.longitude
});
});
});
from amcharts3-angular2.
@Pauan @martynasma I found the problem. The readme.md
says that I need to add the follwing scipts to my index.html
<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/serial.js"></script>
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
If I do, the click event is fired twice and on map pan. If I remove these scripts, it all works as expected.
I'm closing the issue because the problem is fixed, but I would like to understand why if someone can explain to me...
Is it ok to remove the script tags, or there's a problem on the readme.md?
from amcharts3-angular2.
@rbasniak You're right, that seems to be a bug in AmCharts v3.
The README assumes that you are using the serial
chart, because that is our most popular chart type.
You have to change the serial.js
file when you are using other chart types. I'll add a note in the README about that.
It should be completely fine for you to remove the amcharts.js
and serial.js
<script>
tags:
<script src="https://www.amcharts.com/lib/3/ammap.js"></script>
<script src="https://www.amcharts.com/lib/3/maps/js/worldLow.js"></script>
<script src="https://www.amcharts.com/lib/3/themes/light.js"></script>
from amcharts3-angular2.
Related Issues (20)
- Gantt Chart displays wrong date in small screens
- Exporting of PNG,jpg,pdf,xlsx etc not working in angular 7 HOT 5
- Large data with specified colors for column chart displays different color
- Update dependencies to Angular 8 HOT 1
- Issue using angular universal
- Not able to Change Gantt Chart display view from Monthly to Daily HOT 3
- I don't want ChartScrollbar, I want browser scrollbar to be displayed in amcharts Gantt
- How to add dynamically New Value axis and graph in Angular 6 by using Amchart 3
- Update dependencies to Angular 9 and support Ivy HOT 20
- ERROR TypeError: this.chart.panels[0].addLabel is not a function
- License key integration in live project HOT 1
- this.checkTouchDuration is not a function (pie chart)
- amcharts 2.2.5 not compatible with angular 9.1.13 and HOT 1
- Support for angular version 13 HOT 1
- Support for Angular v14 HOT 1
- Support for Angular v15 HOT 1
- Support for Angular 16 HOT 1
- Feature Request - Angular 17 upgrade HOT 1
- Color display different when using in mobile app.
- Not rendering on Angular Material Tabs HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amcharts3-angular2.