c3-line-region.js 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*************************************************************************************/
  2. // -->Template Name: Bootstrap Press Admin
  3. // -->Author: Themedesigner
  4. // -->Email: niravjoshi87@gmail.com
  5. // -->File: c3_chart_JS
  6. /*************************************************************************************/
  7. /********************************/
  8. // Line region chart //
  9. /********************************/
  10. $(function() {
  11. // Callback that creates and populates a data table, instantiates the line region chart, passes in the data and draws it.
  12. var lineRegionChart = c3.generate({
  13. bindto: '#line-region',
  14. size: { height: 400 },
  15. point: {
  16. r: 4
  17. },
  18. color: {
  19. pattern: ['#2962FF', '#4fc3f7']
  20. },
  21. // Create the data table.
  22. data: {
  23. columns: [
  24. ['data1', 30, 200, 100, 400, 0, 100],
  25. ['data2', 100, 200, 10, 400, 100, 25]
  26. ],
  27. regions: {
  28. 'data1': [{ 'start': 1, 'end': 2, 'style': 'dashed' }, { 'start': 3 }], // currently 'dashed' style only
  29. 'data2': [{ 'end': 3 }]
  30. }
  31. },
  32. grid: {
  33. y: {
  34. show: true
  35. }
  36. }
  37. });
  38. });