|
@@ -1,5 +1,10 @@
|
|
|
import WorkOrderInfo from '../viewmodel/wms/WorkOrderInfo'
|
|
|
import {DemandMaterial,MaterialBox,EmptyBox} from "../params/OrderMaterialsStorageParams"
|
|
|
+import WorkOrderMaterialInfo from "../viewmodel/wms/WorkOrderMaterialInfo"
|
|
|
+import WmsRequest from '../common/util/request/WmsRequest'
|
|
|
+import RequestParamModel from '../viewmodel/wms/RequestParamModel'
|
|
|
+import MaterialInfo from '../viewmodel/wms/MaterialInfo'
|
|
|
+import MaterialBoxInfo from '../viewmodel/wms/MaterialBoxInfo'
|
|
|
@Component
|
|
|
export struct StaticOrderList {
|
|
|
private scrollerForList: Scroller = new Scroller()
|
|
@@ -67,16 +72,10 @@ struct StaticOrderItem{
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
|
|
|
Row() {
|
|
|
- Text('齐套比例:')
|
|
|
+ Text(`齐套比例:${(Number(this.item.inventoryNum) / Number(this.item.planNum) * 100).toFixed(0)}%`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
-
|
|
|
- Text(`${this.item.inventoryNum}`)
|
|
|
- .fontColor($r('app.color.FFFFFF'))
|
|
|
- .fontSize($r('app.float.fontSize_16'))
|
|
|
- .margin({ left: 4 })
|
|
|
- .fontWeight(FontWeight.Lighter)
|
|
|
}
|
|
|
.width('100%')
|
|
|
.justifyContent(FlexAlign.Start)
|
|
@@ -111,23 +110,22 @@ struct OrderMaterialDialog {
|
|
|
@Prop inBoundRation:number = 10
|
|
|
@Prop outBoundRation:number = 79
|
|
|
@Link selectedOrder: WorkOrderInfo
|
|
|
- @State materialData: DemandMaterial[] = [
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- ];
|
|
|
+ @State materialData: WorkOrderMaterialInfo[] = [];
|
|
|
+
|
|
|
+ queryDemandMaterial=async(workOrderCode:string)=>{
|
|
|
+ this.materialData = await WmsRequest.post('/api/v1/wms/workOrderMaterial/list', {
|
|
|
+ workOrderCode: workOrderCode,
|
|
|
+ } as RequestParamModel) as WorkOrderMaterialInfo[]
|
|
|
+ }
|
|
|
|
|
|
controller: CustomDialogController
|
|
|
searchRequestMaterial: () => void = () => {}
|
|
|
|
|
|
+ async aboutToAppear(){
|
|
|
+ const workOrderCode = this.selectedOrder?.workOrderCode ?? '';
|
|
|
+ this.queryDemandMaterial(workOrderCode);
|
|
|
+ }
|
|
|
+
|
|
|
build() {
|
|
|
Column() {
|
|
|
Column(){
|
|
@@ -154,7 +152,7 @@ struct OrderMaterialDialog {
|
|
|
Text(`下发时间: ${this.selectedOrder.planStartWhen}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
- Text(`预计完成时间: ${this.selectedOrder.planStartWhen}`)
|
|
|
+ Text(`预计完成时间: ${this.selectedOrder.planStartEnd}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
Text(`生产数量: ${this.selectedOrder.inventoryNum}`)
|
|
@@ -223,16 +221,16 @@ struct OrderMaterialDialog {
|
|
|
.width('95%')
|
|
|
Column(){
|
|
|
List({scroller:this.scrollerForList}) {
|
|
|
- ForEach(this.materialData, (item:DemandMaterial) => {
|
|
|
+ ForEach(this.materialData, (item:WorkOrderMaterialInfo) => {
|
|
|
ListItem() {
|
|
|
Column() {
|
|
|
Column(){
|
|
|
- Text(item.materialName)
|
|
|
+ Text(item.itemName)
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`型号: ${item.materialType}`)
|
|
|
+ Text(`型号: ${item.itemCode}`)
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontColor($r('app.color.60FFFFFF'))
|
|
|
.width('100%')
|
|
@@ -240,25 +238,25 @@ struct OrderMaterialDialog {
|
|
|
.textAlign(TextAlign.Start)
|
|
|
}
|
|
|
Row(){
|
|
|
- Text(`入库数量:${item.planNum}`)
|
|
|
+ Text(`入库数量:${item.storageNum}`)
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.width('20%')
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`出库数量:${item.planNum}`)
|
|
|
+ Text(`出库数量:${item.storageNum}`)
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.width('20%')
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`缺料数量:${item.planNum}`)
|
|
|
+ Text(`缺料数量:${item.num}`)
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.width('20%')
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`需求数量:${item.planNum}`)
|
|
|
+ Text(`需求数量:${item.num}`)
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.width('20%')
|
|
@@ -309,23 +307,18 @@ struct OrderMaterialDialog {
|
|
|
@Component
|
|
|
export struct StaticMaterialList {
|
|
|
private scrollerForList: Scroller = new Scroller()
|
|
|
- @Prop boundMaterial: DemandMaterial[] = [
|
|
|
- {materialName: 'PCBA电路板SADD12312', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- {materialName: 'PCBA电路板-SADD1231241142324233231233234', materialType: '12322221232321222332211233', inBoundNum: 11, planNum: 20 },
|
|
|
- ]
|
|
|
+
|
|
|
+ @Prop currentStock: MaterialInfo[] = []
|
|
|
@State scaleValue : number = 1
|
|
|
build() {
|
|
|
Column() { // 订单列表
|
|
|
List({ space: 8,scroller:this.scrollerForList }) {
|
|
|
- ForEach(this.boundMaterial, (item: DemandMaterial, index) => {
|
|
|
+ ForEach(this.currentStock, (item: MaterialInfo, index) => {
|
|
|
ListItem() {
|
|
|
StaticMaterialItem({
|
|
|
item: item,
|
|
|
index:index,
|
|
|
- boundMaterial:this.boundMaterial
|
|
|
+ currentStock:this.currentStock
|
|
|
})
|
|
|
}
|
|
|
})
|
|
@@ -340,14 +333,15 @@ export struct StaticMaterialList {
|
|
|
|
|
|
@Component
|
|
|
struct StaticMaterialItem{
|
|
|
- @Prop item: DemandMaterial
|
|
|
+ @Prop item: MaterialInfo
|
|
|
@Prop index: number
|
|
|
- @Prop boundMaterial:DemandMaterial[]
|
|
|
+ @Prop currentStock:MaterialInfo[]
|
|
|
@State scaleValue : number = 1
|
|
|
- @State selectedMaterial :DemandMaterial={}
|
|
|
+ @State selectedMaterial :MaterialInfo={}
|
|
|
private onSelect(index: number): void {
|
|
|
- this.selectedMaterial = this.boundMaterial[index]
|
|
|
+ this.selectedMaterial = this.currentStock[index]
|
|
|
}
|
|
|
+
|
|
|
MaterialBoxController: CustomDialogController = new CustomDialogController({
|
|
|
builder: MaterialBoxDialog({
|
|
|
selectedMaterial:this.selectedMaterial
|
|
@@ -356,6 +350,7 @@ struct StaticMaterialItem{
|
|
|
customStyle: true,
|
|
|
maskColor: 'rgba(0,0,0,0.8)', // 黑色遮罩
|
|
|
})
|
|
|
+
|
|
|
build() {
|
|
|
Column() {
|
|
|
// 订单标题(带订单号)
|
|
@@ -371,14 +366,14 @@ struct StaticMaterialItem{
|
|
|
|
|
|
// 订单详情
|
|
|
Column({ space: 3 }) {
|
|
|
- Text(`型号: ${this.item.materialType}`)
|
|
|
+ Text(`型号: ${this.item.materialNo}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.textAlign(TextAlign.Start)
|
|
|
.width('100%')
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
|
|
|
- Text(`总数量: ${this.item.inBoundNum}`)
|
|
|
+ Text(`总数量: ${this.item.num}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.width('100%')
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
@@ -413,191 +408,26 @@ struct StaticMaterialItem{
|
|
|
|
|
|
@CustomDialog
|
|
|
struct MaterialBoxDialog {
|
|
|
- @Prop workOrders:WorkOrderInfo[] = []
|
|
|
- @Prop inBoundRation:number = 10
|
|
|
- @Prop outBoundRation:number = 79
|
|
|
- @Link selectedMaterial: DemandMaterial
|
|
|
+ @Link selectedMaterial: MaterialInfo
|
|
|
private scrollerMaterial: Scroller = new Scroller()
|
|
|
@State selectedMaterialIndex: number = -1 // 物料箱选中索引
|
|
|
private onSelectMaterial(index: number) {
|
|
|
this.selectedMaterialIndex = index
|
|
|
}
|
|
|
-
|
|
|
- @State materialBoxes: MaterialBox[] = [
|
|
|
- // 第一行物料箱
|
|
|
- {
|
|
|
- id: '1',
|
|
|
- type: 'material',
|
|
|
- name: '物料名称XXXXX',
|
|
|
- boxNumber: 'LX-12345',
|
|
|
- boxType: '通用类型',
|
|
|
- order: 'XXXXX订单',
|
|
|
- quantity: 10,
|
|
|
- position: 'X-1 Y-2'
|
|
|
- },
|
|
|
- // 其他2个物料箱...
|
|
|
-
|
|
|
- // 第二行空箱
|
|
|
- {
|
|
|
- id: '4',
|
|
|
- type: 'empty',
|
|
|
- name: '空箱',
|
|
|
- boxNumber: 'LX-67890',
|
|
|
- boxType: '通用类型',
|
|
|
- position: 'X-3 Y-1'
|
|
|
- },
|
|
|
- {
|
|
|
- id: '1',
|
|
|
- type: 'material',
|
|
|
- name: '物料名称XXXXX',
|
|
|
- boxNumber: 'LX-12345',
|
|
|
- boxType: '通用类型',
|
|
|
- order: 'XXXXX订单',
|
|
|
- quantity: 10,
|
|
|
- position: 'X-1 Y-2'
|
|
|
- },
|
|
|
- // 其他2个物料箱...
|
|
|
-
|
|
|
- // 第二行空箱
|
|
|
- {
|
|
|
- id: '4',
|
|
|
- type: 'empty',
|
|
|
- name: '空箱',
|
|
|
- boxNumber: 'LX-67890',
|
|
|
- boxType: '通用类型',
|
|
|
- position: 'X-3 Y-1'
|
|
|
- },
|
|
|
- {
|
|
|
- id: '1',
|
|
|
- type: 'material',
|
|
|
- name: '物料名称XXXXX',
|
|
|
- boxNumber: 'LX-12345',
|
|
|
- boxType: '通用类型',
|
|
|
- order: 'XXXXX订单',
|
|
|
- quantity: 10,
|
|
|
- position: 'X-1 Y-2'
|
|
|
- },
|
|
|
- // 其他2个物料箱...
|
|
|
-
|
|
|
- // 第二行空箱
|
|
|
- {
|
|
|
- id: '4',
|
|
|
- type: 'empty',
|
|
|
- name: '空箱',
|
|
|
- boxNumber: 'LX-67890',
|
|
|
- boxType: '通用类型',
|
|
|
- position: 'X-3 Y-1'
|
|
|
- },
|
|
|
- {
|
|
|
- id: '1',
|
|
|
- type: 'material',
|
|
|
- name: '物料名称XXXXX',
|
|
|
- boxNumber: 'LX-12345',
|
|
|
- boxType: '通用类型',
|
|
|
- order: 'XXXXX订单',
|
|
|
- quantity: 10,
|
|
|
- position: 'X-1 Y-2'
|
|
|
- },
|
|
|
- // 其他2个物料箱...
|
|
|
-
|
|
|
- // 第二行空箱
|
|
|
- {
|
|
|
- id: '4',
|
|
|
- type: 'empty',
|
|
|
- name: '空箱',
|
|
|
- boxNumber: 'LX-67890',
|
|
|
- boxType: '通用类型',
|
|
|
- position: 'X-3 Y-1'
|
|
|
- },
|
|
|
- {
|
|
|
- id: '1',
|
|
|
- type: 'material',
|
|
|
- name: '物料名称XXXXX',
|
|
|
- boxNumber: 'LX-12345',
|
|
|
- boxType: '通用类型',
|
|
|
- order: 'XXXXX订单',
|
|
|
- quantity: 10,
|
|
|
- position: 'X-1 Y-2'
|
|
|
- },
|
|
|
- // 其他2个物料箱...
|
|
|
-
|
|
|
- // 第二行空箱
|
|
|
- {
|
|
|
- id: '4',
|
|
|
- type: 'empty',
|
|
|
- name: '空箱',
|
|
|
- boxNumber: 'LX-67890',
|
|
|
- boxType: '通用类型',
|
|
|
- position: 'X-3 Y-1'
|
|
|
- },
|
|
|
- {
|
|
|
- id: '1',
|
|
|
- type: 'material',
|
|
|
- name: '物料名称XXXXX',
|
|
|
- boxNumber: 'LX-12345',
|
|
|
- boxType: '通用类型',
|
|
|
- order: 'XXXXX订单',
|
|
|
- quantity: 10,
|
|
|
- position: 'X-1 Y-2'
|
|
|
- },
|
|
|
- // 其他2个物料箱...
|
|
|
- {
|
|
|
- id: '1',
|
|
|
- type: 'material',
|
|
|
- name: '物料名称XXXXX',
|
|
|
- boxNumber: 'LX-12345',
|
|
|
- boxType: '通用类型',
|
|
|
- order: 'XXXXX订单',
|
|
|
- quantity: 10,
|
|
|
- position: 'X-1 Y-2'
|
|
|
- },
|
|
|
- // 其他2个物料箱...
|
|
|
-
|
|
|
- // 第二行空箱
|
|
|
- {
|
|
|
- id: '4',
|
|
|
- type: 'empty',
|
|
|
- name: '空箱',
|
|
|
- boxNumber: 'LX-67890',
|
|
|
- boxType: '通用类型',
|
|
|
- position: 'X-3 Y-1'
|
|
|
- }, {
|
|
|
- id: '1',
|
|
|
- type: 'material',
|
|
|
- name: '物料名称XXXXX',
|
|
|
- boxNumber: 'LX-12345',
|
|
|
- boxType: '通用类型',
|
|
|
- order: 'XXXXX订单',
|
|
|
- quantity: 10,
|
|
|
- position: 'X-1 Y-2'
|
|
|
- },
|
|
|
-
|
|
|
- // 其他2个物料箱...
|
|
|
-
|
|
|
- // 第二行空箱
|
|
|
- {
|
|
|
- id: '4',
|
|
|
- type: 'empty',
|
|
|
- name: '空箱',
|
|
|
- boxNumber: 'LX-67890',
|
|
|
- boxType: '通用类型',
|
|
|
- position: 'X-3 Y-1'
|
|
|
- },
|
|
|
- // 第二行空箱
|
|
|
- {
|
|
|
- id: '4',
|
|
|
- type: 'empty',
|
|
|
- name: '空箱',
|
|
|
- boxNumber: 'LX-67890',
|
|
|
- boxType: '通用类型',
|
|
|
- position: 'X-3 Y-1'
|
|
|
- },
|
|
|
- // 其他2个空箱...
|
|
|
- ];
|
|
|
+ @State materialBoxes: MaterialBoxInfo[] = [];
|
|
|
@Prop emptyBoxes: EmptyBox[] = [];
|
|
|
controller: CustomDialogController
|
|
|
searchRequestMaterial: () => void = () => {}
|
|
|
|
|
|
+ loadMaterialBoxes= async()=>{
|
|
|
+ this.materialBoxes = await WmsRequest.post("/api/v1/stock/groupList", {
|
|
|
+ materialNo: this.selectedMaterial.materialNo,
|
|
|
+ } as RequestParamModel);
|
|
|
+ }
|
|
|
+ async aboutToAppear() {
|
|
|
+ this.loadMaterialBoxes();
|
|
|
+ }
|
|
|
+
|
|
|
build() {
|
|
|
Column() {
|
|
|
Column(){
|
|
@@ -609,39 +439,38 @@ struct MaterialBoxDialog {
|
|
|
|
|
|
Column() {
|
|
|
Grid(this.scrollerMaterial) {
|
|
|
- ForEach(this.materialBoxes, (box: MaterialBox, index) => {
|
|
|
+ ForEach(this.materialBoxes, (box: MaterialBoxInfo, index) => {
|
|
|
GridItem() {
|
|
|
Column() {
|
|
|
// 订单标题(带订单号)
|
|
|
- Text(`${box.name}`)
|
|
|
+ Text(`${box.materials?box.materials[0].materialName:''}`)
|
|
|
.fontSize($r('app.float.fontSize_30'))
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.width('100%')
|
|
|
.textAlign(TextAlign.Start)
|
|
|
.margin({ bottom: '2%',left:'2%' })
|
|
|
- // 订单详情
|
|
|
Column({ space: 3 }) {
|
|
|
- Text(`料箱编号: ${box.id}`)
|
|
|
+ Text(`料箱编号: ${box.vehicleCode}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`料箱类型: ${box.boxType}`)
|
|
|
+ Text(`所属订单: `)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`所属订单: ${box.order}`)
|
|
|
+ Text(`数量: ${box.materials?box.materials[0].num:''}${box.materials?box.materials[0].unit:''}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`数量: ${box.boxNumber}`)
|
|
|
+ Text(`层数: ${box.position}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
|
.textAlign(TextAlign.Start)
|
|
|
- Text(`位置: ${box.position}`)
|
|
|
+ Text(`位置: ${box.coordinate}`)
|
|
|
.fontColor($r('app.color.FFFFFF'))
|
|
|
.fontSize($r('app.float.fontSize_16'))
|
|
|
.fontWeight(FontWeight.Lighter)
|
|
@@ -708,7 +537,7 @@ export struct LineChart {
|
|
|
private context: CanvasRenderingContext2D = new CanvasRenderingContext2D(this.settings)
|
|
|
|
|
|
// 图表数据
|
|
|
- private readonly data: number[] = [400, 380, 400, 450, 430, 450, 440, 450, 430, 440, 420, 450]
|
|
|
+ @Link frequencyData: number[]
|
|
|
private readonly months: string[] = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月']
|
|
|
|
|
|
// 图表尺寸和边距
|
|
@@ -716,10 +545,6 @@ export struct LineChart {
|
|
|
private readonly chartHeight: number = 250
|
|
|
private readonly chartPadding: number = 30
|
|
|
|
|
|
- aboutToAppear() {
|
|
|
- // 初始化设置
|
|
|
- }
|
|
|
-
|
|
|
build() {
|
|
|
Column() {
|
|
|
Canvas(this.context)
|
|
@@ -788,8 +613,8 @@ export struct LineChart {
|
|
|
this.context.strokeStyle = '#2196F3'
|
|
|
this.context.lineWidth = 2
|
|
|
|
|
|
- this.data.forEach((value, i) => {
|
|
|
- const x = this.chartPadding + (i * (this.chartWidth - 2 * this.chartPadding) / (this.data.length - 1))
|
|
|
+ this.frequencyData.forEach((value, i) => {
|
|
|
+ const x = this.chartPadding + (i * (this.chartWidth - 2 * this.chartPadding) / (this.frequencyData.length - 1))
|
|
|
const y = this.chartHeight - this.chartPadding - ((value / 500) * (this.chartHeight - 2 * this.chartPadding))
|
|
|
|
|
|
if (i === 0) {
|
|
@@ -803,8 +628,8 @@ export struct LineChart {
|
|
|
}
|
|
|
|
|
|
private drawPoints() {
|
|
|
- this.data.forEach((value, i) => {
|
|
|
- const x = this.chartPadding + (i * (this.chartWidth - 2 * this.chartPadding) / (this.data.length - 1))
|
|
|
+ this.frequencyData.forEach((value, i) => {
|
|
|
+ const x = this.chartPadding + (i * (this.chartWidth - 2 * this.chartPadding) / (this.frequencyData.length - 1))
|
|
|
const y = this.chartHeight - this.chartPadding - ((value / 500) * (this.chartHeight - 2 * this.chartPadding))
|
|
|
|
|
|
this.context.beginPath()
|