|
| 1 | +import { Component } from '@angular/core'; |
| 2 | +import { RouterOutlet } from '@angular/router'; |
| 3 | +import { TreeMapModule, TreeMapTooltipService, TreeMapSelectionService, TreeMapHighlightService } from '@syncfusion/ej2-angular-treemap'; |
| 4 | + |
| 5 | +@Component({ |
| 6 | + selector: 'app-root', |
| 7 | + standalone: true, |
| 8 | + imports: [RouterOutlet, TreeMapModule ], |
| 9 | + providers: [TreeMapTooltipService, TreeMapSelectionService, TreeMapHighlightService], |
| 10 | + templateUrl: './app.component.html', |
| 11 | + styleUrl: './app.component.css' |
| 12 | +}) |
| 13 | +export class AppComponent { |
| 14 | + public leafItemSettings: object= { |
| 15 | + labelPath: 'country', |
| 16 | + fill: '#37afab', |
| 17 | + labelStyle: { |
| 18 | + size: '15px' |
| 19 | + }, |
| 20 | + border: { color:'white', width: 0.5 }, |
| 21 | + labelFormat: '${country}-(${jobDescription}-${employeeCount})', |
| 22 | + interSectAction: 'Trim', |
| 23 | + labelPosition: 'TopCenter', |
| 24 | + gap: 7 |
| 25 | + }; |
| 26 | + public levels: object[]= [ |
| 27 | + { |
| 28 | + groupPath: 'country', |
| 29 | + border: { color: 'white', width: 0.5}, |
| 30 | + fill: '#87cfcc', |
| 31 | + groupGap: 7, |
| 32 | + headerStyle: { size: '15px'}, |
| 33 | + headerHeight: 40, |
| 34 | + headerAlignment: 'Center' |
| 35 | + }, |
| 36 | + { |
| 37 | + groupPath: 'jobDescription', |
| 38 | + border: { color: 'white', width: 0.5}, |
| 39 | + fill: '#50b2ae', |
| 40 | + groupGap: 7, |
| 41 | + headerStyle: { size: '15px'}, |
| 42 | + headerHeight: 40, |
| 43 | + headerAlignment: 'Center' |
| 44 | + } |
| 45 | + ]; |
| 46 | + public tooltipSettings: object = { |
| 47 | + visible: true |
| 48 | + }; |
| 49 | + public selectionSettings: object= { |
| 50 | + enable: true, |
| 51 | + fill: '#2f7573', |
| 52 | + border: { color: 'white', width: 0.5 }, |
| 53 | + mode: 'Parent' |
| 54 | + }; |
| 55 | + public highlightSettings: object= { |
| 56 | + enable: true, |
| 57 | + fill: '#0ec2bc', |
| 58 | + border: { color: 'black', width: 0.9 }, |
| 59 | + mode: 'Child' |
| 60 | + }; |
| 61 | + public data: object[] = [ |
| 62 | + { country: "United States", jobDescription: "Sales Department", jobGroup: "Executive", employeeCount: 20 }, |
| 63 | + { country: "United States", jobDescription: "Sales", jobGroup: "Analyst",employeeCount: 30 }, |
| 64 | + { country: "United States", jobDescription: "Marketing Department", employeeCount: 40 }, |
| 65 | + { country: "United States", jobDescription: "Management", employeeCount: 80 }, |
| 66 | + { country: "India", jobDescription: "Technical", jobGroup: "Testers", employeeCount: 100 }, |
| 67 | + { country: "India", jobDescription: "HR Executives", employeeCount: 30 }, |
| 68 | + { country: "India", jobDescription: "Accounts", employeeCount: 40 }, |
| 69 | + { country: "UK", jobDescription: "Technical", jobGroup: "Testers", employeeCount: 30 }, |
| 70 | + { country: "UK", jobDescription: "HR Executives", employeeCount: 50 }, |
| 71 | + { country: "UK", jobDescription: "Accounts", employeeCount: 60 } |
| 72 | + ]; |
| 73 | + title = 'myangularapp'; |
| 74 | +} |
0 commit comments