收到一只叮咚
2023-01-06 15:17:05
用戶放大后,我需要 x 軸上的更新值。根據(jù)我發(fā)現(xiàn)的示例 ( https://stackblitz.com/edit/angular-6fbwjp?file=app/app.component.ts ),我可以使用縮放事件偵聽器。用于放大的 Kendo UI 文檔:從此處的圖像中,您可以看到軸范圍返回為空對(duì)象 {}。為什么會(huì)這樣,我該如何解決?我的最終目標(biāo)是使用放大范圍來更新數(shù)據(jù)并重繪圖形ZoomEvent {sender: ChartComponent, prevented: false, axisRanges: {…}, delta: undefined, originalEvent: {…}}axisRanges:__proto__: Objectdelta: undefinedoriginalEvent: {distance: 0, event: PointerEvent, target: path, touches: Array(1), preventDefault: ?, …}prevented: falsesender: ChartComponent {configurationService: ConfigurationService, axisLabelClick: EventEmitter, drag: EventEmitter, dragEnd: EventEmitter, dragStart: EventEmitter, …}__proto__: PreventableEvent<kendo-chart [pannable]="{ lock: 'y' }" [zoomable]="{ mousewheel :{ lock: 'y'}, selection: { lock: 'y' } }" (zoom)="onZoom($event)" [axisDefaults]="axisDefaults" [chartArea]="chartAreaOptions" [legend]="legendOptions"> <kendo-chart-series> <!-- Loop thru all readings --> <kendo-chart-series-item *ngFor="let readings of ReadingsData" [data]="readings.items" [color]="seriesOptionsArr.get(readings.value).color" [markers]="{ visible: false }" [name]="seriesOptionsArr.get(readings.value).name" type="scatterLine" xField="timeRead" yField="sample" zIndex="1"> </kendo-chart-series-item> </kendo-chart-series> <kendo-chart-x-axis> <kendo-chart-x-axis-item type="date" baseUnit="seconds" [min]="xAxisMin" [max]="xAxisMax" majorTicksVisible=false> </kendo-chart-x-axis-item> </kendo-chart-x-axis> <kendo-chart-y-axis> <kendo-chart-y-axis-item ...> </kendo-chart-y-axis-item> </kendo-chart-y-axis> </kendo-chart>
1 回答

qq_花開花謝_0
TA貢獻(xiàn)1835條經(jīng)驗(yàn) 獲得超7個(gè)贊
問題是軸需要有一個(gè)名字。如下添加名稱后,axisRange 將添加到事件信息中。
<kendo-chart-x-axis-item type="date" baseUnit="seconds" [labels]="{ format: getAxisDateFormat()}"
[majorGridLines]="{ visible: false }"
[minorGridLines]="{ visible: false }" [min]="xAxisMin"
[max]="xAxisMax" majorTicksVisible=false name='date_axis'>
</kendo-chart-x-axis-item>
例如。 https://stackblitz.com/edit/angular-m2cvrw?file=app/app.component.ts
添加回答
舉報(bào)
0/150
提交
取消