Giter Site home page Giter Site logo

Comments (7)

Pauan avatar Pauan commented on August 23, 2024 3

@jast1000 You have to include the pie.js file in order to use pie charts:

<script src="https://www.amcharts.com/lib/3/pie.js"></script>

You have to place it underneath the amcharts.js file:

<script src="https://www.amcharts.com/lib/3/amcharts.js"></script>
<script src="https://www.amcharts.com/lib/3/pie.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>

from amcharts3-angular2.

balrajhariharan avatar balrajhariharan commented on August 23, 2024

If I want to implement pie chart with react, I have to add an extra dependency?

from amcharts3-angular2.

Pauan avatar Pauan commented on August 23, 2024

@balrajhariharan Yes, you have to add the extra <script src="https://www.amcharts.com/lib/3/pie.js"></script> code in your HTML file.

from amcharts3-angular2.

sujitnale123 avatar sujitnale123 commented on August 23, 2024

//.ts file
export class AppComponent {
title = 'app';
private pieChart: AmChart;

ngOnInit() {
this.pieChart = this.AmCharts.makeChart("chartdiv2", this.makeOptions2());
}
makeOptions2() {
return {
"type": "pie",
"theme": "light",
"dataProvider": [{
"country": "Lithuania",
"value": 260
}, {
"country": "Ireland",
"value": 201
}, {
"country": "Germany",
"value": 65
}, {
"country": "Australia",
"value": 39
}, {
"country": "UK",
"value": 19
}, {
"country": "Latvia",
"value": 10
}],
"valueField": "value",
"titleField": "country",
"outlineAlpha": 0.4,
"depth3D": 15,
"balloonText": "[[title]]
[[value]] ([[percents]]%)",
"angle": 30,
"export": {
"enabled": true
}
}
}
}

//.Html file

<script src="https://www.amcharts.com/lib/3/amcharts.js"></script> <script src="https://www.amcharts.com/lib/3/pie.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>

//.css file

#chartdiv2{
width: 100%;
height:500px;
}

all code is placed properly.. still pie chart is not getting displayed

from amcharts3-angular2.

nisriinaaulfah avatar nisriinaaulfah commented on August 23, 2024

hi @sujitnale123 , did you find out how to fix your problem? because now I'm facing that problem too.

from amcharts3-angular2.

moghthalkushal avatar moghthalkushal commented on August 23, 2024

Ensure it is in your index.html

from amcharts3-angular2.

sumitramteke avatar sumitramteke commented on August 23, 2024

Make sure serial.js is above pie.js

from amcharts3-angular2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.