Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating bubble chart in angular 5 #87

Open
sushant47 opened this issue Sep 3, 2018 · 1 comment
Open

Creating bubble chart in angular 5 #87

sushant47 opened this issue Sep 3, 2018 · 1 comment

Comments

@sushant47
Copy link

kindly provide some sample code to create bubble chart in angular 5

@xorspark
Copy link

xorspark commented Sep 6, 2018

Generally speaking, creating any chart type requires including the corresponding script files (serial.js for line/column/step/candlestick, xy.js for bubble/scatter, pie.js for pie, etc) and setting the appropriate config (the second parameter in the AmCharts.makeChart() calls), *Field properties (valueField, categoryField, xField, yField, etc, depending on the chart type) and dataProvider. The majority of our demos and knowledge base examples can be ported over to use the angular component fairly easily that way.

Using the bubble chart demo as an example, set the correct includes in your html file (note this plugin requires <script> tags):

<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/xy.js"></script>
<!-- export/themes/etc optional -->

Then tweak the makeOptions and generateDataProvider methods from our angluar-cli example in the app.component.ts to include the chart config from the AmCharts.makeChart call and your desired dataProvider values.

Here's a stackblitz demo that puts all of this together: https://stackblitz.com/edit/amcharts3-angular-bubble-chart-demo-mzsbu8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants