Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
portal-apps-manage
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
angular
portal-apps-manage
Commits
d1e8e954
Commit
d1e8e954
authored
Sep 02, 2025
by
Ooh-Ao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
เพิ่ม chart pivot
parent
63d44ef1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
syncfusion-pivot-widget.component.html
...usion-pivot-widget/syncfusion-pivot-widget.component.html
+2
-0
syncfusion-pivot-widget.component.ts
...cfusion-pivot-widget/syncfusion-pivot-widget.component.ts
+24
-12
No files found.
src/app/portal-manage/widgets/syncfusion-pivot-widget/syncfusion-pivot-widget.component.html
View file @
d1e8e954
...
@@ -29,6 +29,8 @@
...
@@ -29,6 +29,8 @@
[
allowExcelExport
]="
true
"
[
allowExcelExport
]="
true
"
(
toolbarClick
)="
toolbarClick
($
event
)"
(
toolbarClick
)="
toolbarClick
($
event
)"
[
toolbar
]="
toolbar
"
[
toolbar
]="
toolbar
"
[
displayOption
]="
displayOption
"
[
chartSettings
]="
chartSettings
"
height=
"100%"
>
height=
"100%"
>
</ejs-pivotview>
</ejs-pivotview>
...
...
src/app/portal-manage/widgets/syncfusion-pivot-widget/syncfusion-pivot-widget.component.ts
View file @
d1e8e954
import
{
Component
,
ViewChild
}
from
'@angular/core'
;
import
{
Component
,
ViewChild
}
from
'@angular/core'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
CommonModule
}
from
'@angular/common'
;
import
{
PivotViewModule
,
IDataSet
,
FieldListService
,
CalculatedFieldService
,
ToolbarService
,
GroupingBarService
,
ConditionalFormattingService
,
PivotViewComponent
,
PDFExportService
,
ExcelExportService
,
ToolbarItems
}
from
'@syncfusion/ej2-angular-pivotview'
;
import
{
PivotViewModule
,
IDataSet
,
FieldListService
,
CalculatedFieldService
,
ToolbarService
,
GroupingBarService
,
ConditionalFormattingService
,
PivotViewComponent
,
PDFExportService
,
ExcelExportService
,
ToolbarItems
,
PivotChartService
,
DisplayOption
}
from
'@syncfusion/ej2-angular-pivotview'
;
import
{
ChartSettingsModel
}
from
'@syncfusion/ej2-pivotview/src/pivotview/model/chartsettings-model'
;
import
{
ClickEventArgs
}
from
'@syncfusion/ej2-navigations'
;
import
{
ClickEventArgs
}
from
'@syncfusion/ej2-navigations'
;
import
{
DataManager
}
from
'@syncfusion/ej2-data'
;
import
{
DataManager
}
from
'@syncfusion/ej2-data'
;
import
{
DashboardStateService
}
from
'../../services/dashboard-state.service'
;
import
{
DashboardStateService
}
from
'../../services/dashboard-state.service'
;
...
@@ -10,7 +11,7 @@ import { BaseWidgetComponent } from '../base-widget.component';
...
@@ -10,7 +11,7 @@ import { BaseWidgetComponent } from '../base-widget.component';
selector
:
'app-syncfusion-pivot-widget'
,
selector
:
'app-syncfusion-pivot-widget'
,
standalone
:
true
,
standalone
:
true
,
imports
:
[
CommonModule
,
PivotViewModule
],
imports
:
[
CommonModule
,
PivotViewModule
],
providers
:
[
FieldListService
,
CalculatedFieldService
,
ToolbarService
,
GroupingBarService
,
ConditionalFormattingService
,
ExcelExportService
,
PDFExportService
],
providers
:
[
FieldListService
,
CalculatedFieldService
,
ToolbarService
,
GroupingBarService
,
ConditionalFormattingService
,
ExcelExportService
,
PDFExportService
,
PivotChartService
],
templateUrl
:
'./syncfusion-pivot-widget.component.html'
,
templateUrl
:
'./syncfusion-pivot-widget.component.html'
,
})
})
export
class
SyncfusionPivotWidgetComponent
extends
BaseWidgetComponent
{
export
class
SyncfusionPivotWidgetComponent
extends
BaseWidgetComponent
{
...
@@ -23,27 +24,35 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent {
...
@@ -23,27 +24,35 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent {
columns
:
any
[];
columns
:
any
[];
values
:
any
[];
values
:
any
[];
filters
:
any
[];
filters
:
any
[];
chartSettings
?:
ChartSettingsModel
;
}
=
{
}
=
{
dataSource
:
new
DataManager
([]),
dataSource
:
new
DataManager
([]),
expandAll
:
false
,
expandAll
:
false
,
rows
:
[],
rows
:
[],
columns
:
[],
columns
:
[],
values
:
[],
values
:
[],
filters
:
[],
filters
:
[],
};
};
public
toolbar
:
ToolbarItems
[];
public
toolbar
:
ToolbarItems
[];
public
displayOption
:
DisplayOption
;
public
chartSettings
:
ChartSettingsModel
;
constructor
(
protected
override
dashboardStateService
:
DashboardStateService
)
{
constructor
(
protected
override
dashboardStateService
:
DashboardStateService
)
{
super
(
dashboardStateService
);
super
(
dashboardStateService
);
}
}
override
ngOnInit
():
void
{
override
ngOnInit
():
void
{
this
.
toolbar
=
[
'Grid'
,
'Chart'
,
'Export'
,
'FieldList'
,
'Formatting'
];
this
.
toolbar
=
[
'Grid'
,
'Chart'
,
'Export'
,
'SubTotal'
,
'GrandTotal'
,
'ConditionalFormatting'
,
'NumberFormatting'
,
'FieldList'
]
this
.
displayOption
=
{
view
:
'Both'
}
as
DisplayOption
;
super
.
ngOnInit
();
super
.
ngOnInit
();
}
}
applyInitialConfig
():
void
{
applyInitialConfig
():
void
{
this
.
title
=
this
.
config
.
title
||
'Pivot Table'
;
this
.
title
=
this
.
config
.
title
||
'Pivot Table'
;
this
.
chartSettings
=
this
.
config
.
chartSettings
||
{
chartSeries
:
{
type
:
'Column'
}
};
this
.
dataSourceSettings
=
{
this
.
dataSourceSettings
=
{
dataSource
:
new
DataManager
([]),
dataSource
:
new
DataManager
([]),
expandAll
:
this
.
config
.
expandAll
||
false
,
expandAll
:
this
.
config
.
expandAll
||
false
,
...
@@ -51,18 +60,20 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent {
...
@@ -51,18 +60,20 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent {
columns
:
this
.
config
.
columns
||
[],
columns
:
this
.
config
.
columns
||
[],
values
:
this
.
config
.
values
||
[],
values
:
this
.
config
.
values
||
[],
filters
:
this
.
config
.
filters
||
[],
filters
:
this
.
config
.
filters
||
[],
chartSettings
:
this
.
chartSettings
,
};
};
}
}
onDataUpdate
(
data
:
IDataSet
[]):
void
{
onDataUpdate
(
data
:
IDataSet
[]):
void
{
this
.
dataSourceSettings
=
{
this
.
dataSourceSettings
=
{
...
this
.
dataSourceSettings
,
...
this
.
dataSourceSettings
,
dataSource
:
new
DataManager
(
data
)
dataSource
:
new
DataManager
(
data
)
};
};
}
}
onReset
():
void
{
onReset
():
void
{
this
.
title
=
'Pivot Table (Default)'
;
this
.
title
=
'Pivot Table (Default)'
;
this
.
chartSettings
=
{
chartSeries
:
{
type
:
'Column'
}
};
this
.
dataSourceSettings
=
{
this
.
dataSourceSettings
=
{
dataSource
:
new
DataManager
([
dataSource
:
new
DataManager
([
{
'Sold'
:
31
,
'Amount'
:
52824
,
'Country'
:
'France'
,
'Products'
:
'Mountain Bikes'
,
'Year'
:
'FY 2015'
},
{
'Sold'
:
31
,
'Amount'
:
52824
,
'Country'
:
'France'
,
'Products'
:
'Mountain Bikes'
,
'Year'
:
'FY 2015'
},
...
@@ -74,6 +85,7 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent {
...
@@ -74,6 +85,7 @@ export class SyncfusionPivotWidgetComponent extends BaseWidgetComponent {
columns
:
[{
name
:
'Year'
}],
columns
:
[{
name
:
'Year'
}],
values
:
[{
name
:
'Sold'
},
{
name
:
'Amount'
}],
values
:
[{
name
:
'Sold'
},
{
name
:
'Amount'
}],
filters
:
[],
filters
:
[],
chartSettings
:
this
.
chartSettings
,
};
};
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment