Hello Members,
Hope you are doing good today!!
Here I am written the code for Pie chart, i want to display the Percentable(%) on the pie chart fields...
- <!DOCTYPE html>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head runat="server">
- <title>ChartJS - Pie Chart</title>
- <script src="jquery-2.1.4.min.js"></script>
- <script src="Chart.js"></script>
- </head>
- <body>
- <canvas id="mycanvas" width="256" height="256" />
- <script>
- $(document).ready(function(){
- var ctx = $("#mycanvas").get(0).getContext("2d");
- var data = [
- {
- value: 150,
- color: "cornflowerblue",
-
- label: "Bigdata"
- },
- {
- value: 100,
- color: "lightgreen",
-
- label: "Mechin Learning"
- },
- {
- value: 40,
- color: "orange",
-
- label: "Java"
- },
- {
- value: 70,
- color: "lightgray",
-
- label: "C#"
- }
- ];
-
- var piechart = new Chart(ctx).Pie(data);
- });
- </script>
- </body>
- </html>
We need to pass the data with JSON, In Current project we are using Java Script