Compare commits

...
6 Commits
Author SHA1 Message Date
saherelm 457f4f8b81 last ... 2026-09-01 11:25:43 +03:30
saherelm a4af55cbb6 last ... 2026-09-01 08:32:54 +03:30
saherelm 6605c2f593 fix code block card background ccolor issue ... 2026-08-29 17:21:59 +03:30
saherelm 65ed78abac last ... 2026-08-29 00:57:47 +03:30
saherelm 13e7a02b37 last woks fo x-chart component testing ... 2026-08-28 21:01:54 +03:30
saherelm f711305be6 last ... 2026-08-25 08:49:41 +03:30
6 changed files with 250 additions and 11 deletions
+1 -1
View File
@@ -18,7 +18,7 @@
"prefix": "app", "prefix": "app",
"architect": { "architect": {
"build": { "build": {
"builder": "@angular-devkit/build-angular:browser", "builder": "@angular-builders/custom-webpack:browser",
"options": { "options": {
"outputPath": "www", "outputPath": "www",
"index": "src/index.html", "index": "src/index.html",
+2
View File
@@ -58,6 +58,7 @@
"zone.js": "~0.11.4" "zone.js": "~0.11.4"
}, },
"devDependencies": { "devDependencies": {
"@angular-builders/custom-webpack": "^12.1.1",
"@angular-devkit/build-angular": "~12.1.3", "@angular-devkit/build-angular": "~12.1.3",
"@angular/cdk": "^12.1.3", "@angular/cdk": "^12.1.3",
"@angular/cli": "~12.1.3", "@angular/cli": "~12.1.3",
@@ -106,6 +107,7 @@
"ng-packagr": "^12.1.2", "ng-packagr": "^12.1.2",
"ngx-device-detector": "^2.1.1", "ngx-device-detector": "^2.1.1",
"ngx-markdown": "^12.0.1", "ngx-markdown": "^12.0.1",
"node-polyfill-webpack-plugin": "^1.1.4",
"ol": "^6.6.1", "ol": "^6.6.1",
"shx": "^0.3.3", "shx": "^0.3.3",
"typescript": "~4.3.5", "typescript": "~4.3.5",
+14
View File
@@ -0,0 +1,14 @@
const NodePolyfillPlugin = require("node-polyfill-webpack-plugin")
module.exports = {
plugins: [
new NodePolyfillPlugin({
excludeAliases: ["console"]
})
],
resolve: {
fallback: {
fs: false,
}
}
};
+28 -2
View File
@@ -22,19 +22,45 @@
></x-markdown> ></x-markdown>
</x-card> </x-card>
<!-- Component --> <!-- Simple Sample -->
<x-chart <!-- <x-chart
class="v-card" class="v-card"
[type]="'line'" [type]="'line'"
[isInPage]="true" [isInPage]="true"
[title]="chartTitle"
[cardTitle]="'Chart'" [cardTitle]="'Chart'"
[wrapWithCard]="true" [wrapWithCard]="true"
[showActionBar]="true" [showActionBar]="true"
[series]="chartSeries" [series]="chartSeries"
[subTitleAlign]="'start'"
[subTitle]="'Sub Title'"
[options]="chartOptions" [options]="chartOptions"
(chartRendered)="onChartReady()" (chartRendered)="onChartReady()"
[gridColor]="ColorNames.LightShade"
[availableActionBarItems]="availableActionBarItems" [availableActionBarItems]="availableActionBarItems"
(actionBarActionFired)="handleActionBarActionFired($event)" (actionBarActionFired)="handleActionBarActionFired($event)"
> >
</x-chart> -->
<!-- Annotation Sample -->
<x-chart
class="v-card"
[isInPage]="true"
[wrapWithCard]="true"
[showActionBar]="true"
[type]="annSampleChartType"
[xAxis]="annSampleChartXAxis"
[yAxis]="annSampleChartYAxis"
[title]="annSampleChartTitle"
[series]="annSampleChartSeries"
(chartRendered)="onChartReady()"
[cardTitle]="annSampleChartTitle"
[gridColor]="ColorNames.LightShade"
[titleAlign]="annSampleChartTitleAlign"
[availableActionBarItems]="availableActionBarItems"
(actionBarActionFired)="handleActionBarActionFired($event)"
>
<!-- [annotations]="annSampleChartAnnotations" -->
</x-chart> </x-chart>
</v-page> </v-page>
+203 -6
View File
@@ -1,12 +1,17 @@
import { import {
XChartOptions, XChartOptions,
XChartSeriesType, XChartSeriesType,
XChartAvailableActionBarItem,
XChartActionBarItem, XChartActionBarItem,
XActionBarActionFiredModel, XActionBarActionFiredModel,
XChartAvailableActionBarItem,
XChartType,
XChartAnnotations,
XChartTextAlign,
XChartXAxis,
XChartYAxis,
} from 'x-framework-components'; } from 'x-framework-components';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { isNullOrEmptyString } from 'x-framework-core'; import { isNullOrEmptyString, XOneOrManyType } from 'x-framework-core';
import { VPageComponent } from '../../../views/v-page/v-page.component'; import { VPageComponent } from '../../../views/v-page/v-page.component';
import { AppResourceIDs } from 'src/app/config/app.localization.config'; import { AppResourceIDs } from 'src/app/config/app.localization.config';
@@ -61,6 +66,9 @@ export class ChartPage extends VPageComponent {
{ {
actionId: XChartActionBarItem.XYSelection, actionId: XChartActionBarItem.XYSelection,
}, },
{
actionId: XChartActionBarItem.ResetChart,
},
]; ];
readonly contentFa = ` readonly contentFa = `
@@ -109,6 +117,9 @@ export class ChartPage extends VPageComponent {
}, },
]; ];
//
chartTitle = 'نمودار فروش ماهانه';
// //
chartOptions: XChartOptions = { chartOptions: XChartOptions = {
chart: { chart: {
@@ -224,7 +235,7 @@ export class ChartPage extends VPageComponent {
show: false, show: false,
}, },
}, },
colors: ['#77B6EA', '#545454'], // colors: ['#77B6EA', '#545454'],
dataLabels: { dataLabels: {
enabled: true, enabled: true,
}, },
@@ -235,9 +246,6 @@ export class ChartPage extends VPageComponent {
text: 'Average High & Low Temperature', text: 'Average High & Low Temperature',
align: 'left', align: 'left',
}, },
grid: {
borderColor: '#e7e7e7',
},
markers: { markers: {
size: 1, size: 1,
}, },
@@ -320,8 +328,197 @@ export class ChartPage extends VPageComponent {
// Url: https://apexcharts.com/javascript-chart-demos/treemap-charts/color-scale/ // Url: https://apexcharts.com/javascript-chart-demos/treemap-charts/color-scale/
//#endregion //#endregion
//
//#region Annotations Sample ....
annSampleChartType = XChartType.Line;
annSampleChartSeries: XChartSeriesType = [
{
name: 'فروش ماهانه',
data: [45, 52, 38, 65, 72, 85, 92, 88, 95, 102, 115, 125]
}
];
annSampleChartAnnotations: XChartAnnotations = {
// خطوط افقی (محدوده‌های هدف)
yaxis: [
{
// خط هدف فروش
y: 100,
borderColor: '#00E396',
borderWidth: 2,
label: {
borderColor: '#00E396',
style: {
color: '#fff',
background: '#00E396',
fontSize: '12px',
fontWeight: 'bold'
},
text: 'هدف فروش: 100 میلیون'
}
},
{
// خط هشدار
y: 50,
borderColor: '#FF4560',
borderWidth: 2,
strokeDashArray: 5,
label: {
borderColor: '#FF4560',
style: {
color: '#fff',
background: '#FF4560',
fontSize: '12px'
},
text: 'حداقل فروش: 50 میلیون'
}
}
],
// خطوط عمودی (رویدادهای خاص)
xaxis: [
{
// رویداد مهم: شروع کمپین تبلیغاتی
x: new Date('2024-04-01').getTime(),
borderColor: '#775DD0',
borderWidth: 2,
strokeDashArray: 0,
label: {
borderColor: '#775DD0',
style: {
color: '#fff',
background: '#775DD0',
fontSize: '11px',
fontWeight: 'bold'
},
orientation: 'horizontal',
text: 'شروع کمپین تبلیغاتی'
}
},
{
// محدوده زمانی خاص (جشنواره)
x: new Date('2024-07-01').getTime(),
x2: new Date('2024-07-15').getTime(),
fillColor: '#FEB019',
opacity: 0.2,
label: {
borderColor: '#FEB019',
style: {
color: '#FEB019',
background: '#FEB019',
fontSize: '11px'
},
text: 'جشنواره تابستانی'
}
},
{
// رویداد: پایان سال مالی
x: new Date('2024-12-31').getTime(),
borderColor: '#FF4560',
borderWidth: 3,
strokeDashArray: 5,
label: {
borderColor: '#FF4560',
style: {
color: '#fff',
background: '#FF4560',
fontSize: '11px',
fontWeight: 'bold'
},
orientation: 'horizontal',
text: 'پایان سال مالی'
}
}
],
// نقاط مهم (Points)
points: [
{
// بیشترین فروش
x: new Date('2024-12-01').getTime(),
y: 125,
marker: {
size: 10,
fillColor: '#00E396',
strokeColor: '#00E396',
strokeWidth: 3
},
label: {
borderColor: '#00E396',
style: {
color: '#fff',
background: '#00E396',
fontSize: '11px',
fontWeight: 'bold'
},
text: 'بیشترین فروش: 125 میلیون',
orientation: 'horizontal'
}
},
{
// کمترین فروش
x: new Date('2024-03-01').getTime(),
y: 38,
marker: {
size: 10,
fillColor: '#FF4560',
strokeColor: '#FF4560',
strokeWidth: 3
},
label: {
borderColor: '#FF4560',
style: {
color: '#fff',
background: '#FF4560',
fontSize: '11px',
fontWeight: 'bold'
},
text: 'کمترین فروش: 38 میلیون',
orientation: 'horizontal'
}
}
],
// متن‌های سفارشی
texts: [
{
x: 95,
y: 95,
text: 'رشد 180% در سال',
textAnchor: 'end',
fontSize: '14px',
fontWeight: 'bold',
foreColor: '#00E396'
}
]
};
annSampleChartXAxis: XChartXAxis = {
type: 'datetime',
labels: {
datetimeUTC: false
}
};
annSampleChartYAxis: XOneOrManyType<XChartYAxis> = [
{
title: {
text: 'مبلغ (میلیون تومان)'
},
labels: {
formatter: (val) => `${val}M`
}
}
];
annSampleChartTitleAlign = XChartTextAlign.Center;
annSampleChartTitle = 'نمودار فروش سالانه با رویدادهای مهم';
annSampleChartStroke = {
curve: 'smooth',
width: 3
};
//#endregion
//#endregion
//#endregion //#endregion
//
//#region LifeCycles ...
//#endregion //#endregion
// //
+1 -1
View File
@@ -116,7 +116,7 @@ body {
// white-space: pre; // white-space: pre;
word-spacing: normal; word-spacing: normal;
word-break: normal; word-break: normal;
background-color: black; background-color: inherit;
// //
overflow: hidden; overflow: hidden;