Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1. /**
  2. * @license
  3. * Copyright (c) 2014, 2019, Oracle and/or its affiliates.
  4. * The Universal Permissive License (UPL), Version 1.0
  5. * @ignore
  6. */
  7. define(['knockout',
  8. 'ojs/ojbootstrap', 'ojs/ojresponsiveutils',
  9. 'ojs/ojresponsiveknockoututils', 'ojs/ojknockout',
  10. 'ojs/ojnavigationlist', 'ojs/ojlabel',
  11. 'ojs/ojselectcombobox', 'ojs/ojchart'],
  12.  
  13. function (ko, Bootstrap, ResponsiveUtils, ResponsiveKnockoutUtils) {
  14.  
  15. function StatsViewModel() {
  16.  
  17. var self = this;
  18.  
  19. self.checkValue = ko.observableArray();
  20. self.dircolumn = ko.pureComputed(function () {
  21. return (typeof self.checkValue()[0] !== 'undefined' && self.checkValue()[0] != null && self.checkValue()[0] === "dirColumn") ? true : false;
  22. }.bind(self));
  23.  
  24. var mdQuery = ResponsiveUtils.getFrameworkQuery(ResponsiveUtils.FRAMEWORK_QUERY_KEY.MD_UP);
  25. self.medium = ResponsiveKnockoutUtils.createMediaQueryObservable(mdQuery);
  26.  
  27. self.selectedItem = ko.observable("bar");
  28. self.val = ko.observable("bar");
  29. /* toggle button variables */
  30. self.stackValue = ko.observable('off');
  31. self.orientationValue = ko.observable('vertical');
  32. /* chart data */
  33. var barSeries = [{ name: "Schimb ulei si filtre", items: [Math.floor(Math.random() * 55) + 1, Math.floor(Math.random() * 55) + 1] },
  34. { name: "Schimb distributie", items: [Math.floor(Math.random() * 55) + 1, Math.floor(Math.random() * 55) + 1] },
  35. { name: "Diagnoza ODB", items: [Math.floor(Math.random() * 55) + 1, Math.floor(Math.random() * 55) + 1] },
  36. { name: "Pachet revizie", items: [Math.floor(Math.random() * 55) + 1, Math.floor(Math.random() * 55) + 1] },
  37. { name: "Inspectie Electrica", items: [Math.floor(Math.random() * 55) + 1, Math.floor(Math.random() * 55) + 1] },
  38. { name: "Geometrie roti", items: [Math.floor(Math.random() * 55) + 1, Math.floor(Math.random() * 55) + 1] },
  39. { name: "Inspectie pt ITP", items: [Math.floor(Math.random() * 55) + 1, Math.floor(Math.random() * 55) + 1] }];
  40. var barGroups = ["Group A", "Group B"];
  41. self.barSeriesValue = ko.observableArray(barSeries);
  42. self.barGroupsValue = ko.observableArray(barGroups);
  43.  
  44. self.selectedItem = self.val;
  45.  
  46. }
  47. return StatsViewModel;
  48.  
  49. Bootstrap.whenDocumentReady().then(function () {
  50. ko.applyBindings(new StatsViewModel(), document.getElementById('tabbardemo'));
  51. });
  52. }
  53. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement