Sam E

Sam E

  • 1.7k
  • 235
  • 3.7k

How to hide value on pie chart

Jan 21 2020 6:02 PM
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...
  1. <!DOCTYPE html>  
  2. <html xmlns="http://www.w3.org/1999/xhtml">  
  3. <head runat="server">  
  4. <title>ChartJS - Pie Chart</title>  
  5. <script src="jquery-2.1.4.min.js"></script>  
  6. <script src="Chart.js"></script>  
  7. </head>  
  8. <body>  
  9. <canvas id="mycanvas" width="256" height="256" />  
  10. <script>  
  11. $(document).ready(function(){  
  12. var ctx = $("#mycanvas").get(0).getContext("2d");  
  13. var data = [  
  14. {  
  15. value: 150,  
  16. color: "cornflowerblue",  
  17. //highlight: "lightskyblue",  
  18. label: "Bigdata"  
  19. },  
  20. {  
  21. value: 100,  
  22. color: "lightgreen",  
  23. //highlight: "yellowgreen",  
  24. label: "Mechin Learning"  
  25. },  
  26. {  
  27. value: 40,  
  28. color: "orange",  
  29. //highlight: "darkorange",  
  30. label: "Java"  
  31. },  
  32. {  
  33. value: 70,  
  34. color: "lightgray",  
  35. //highlight: "yellowgreen",  
  36. label: "C#"  
  37. }  
  38. ];  
  39. //draw  
  40. var piechart = new Chart(ctx).Pie(data);  
  41. });  
  42. </script>  
  43. </body>  
  44. </html>
We need to pass the data with JSON, In Current project we are using Java Script

Answers (1)