Advertisement
isotonicq

Untitled

Jan 14th, 2021
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>vue-chartjs example</title>
  4. </head>
  5. <body>
  6. <div id="chart">
  7. <apexchart type="bar" height="350" :options="chartOptions" :series="series"></apexchart>
  8. </div>
  9. <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  10. <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
  11. <script>
  12. var options = {
  13. series: [{
  14. data: [50, 22, 10,]
  15. }],
  16. chart: {
  17. height: 350,
  18. type: 'bar',
  19. events: {
  20. click: function(chart, w, e) {
  21. // console.log(chart, w, e)
  22. }
  23. }
  24. },
  25. plotOptions: {
  26. bar: {
  27. columnWidth: '45%',
  28. distributed: true
  29. }
  30. },
  31. dataLabels: {
  32. enabled: false
  33. },
  34. legend: {
  35. show: false
  36. },
  37. xaxis: {
  38. categories: [
  39. ['Styczeń'],
  40. ['Luty'],
  41. ['Marzec'],
  42. ],
  43. labels: {
  44. style: {
  45. fontSize: '12px'
  46. }
  47. }
  48. }
  49. };
  50.  
  51. var chart = new ApexCharts(document.querySelector("#chart"), options);
  52. chart.render();
  53. </script>
  54. </body>
  55. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement