亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何使用ploty在視圖中顯示端點數據?

如何使用ploty在視圖中顯示端點數據?

紅糖糍粑 2023-11-11 21:24:06
我正在使用情節來顯示熱圖。我可以用硬編碼數據顯示熱圖。但現在我有了端點,這樣您就可以看到帶有后端數據的熱圖。但如果我使用端點數據,我看不到熱圖。所以我有這個作為模板:<plotly-plot [data]="graph.data" [layout]="graph.layout"</plotly-plot>和這個打字稿:Map:map = {};}所以這有效,我看到了熱圖。但現在如果我這樣做:export interface map {       map?: Array<Array<number>> | null;} Map() {    this.Service                });  }But then the data is not visibleSo what I have to change?So I have it now like this:this.showHeadMap().subscribe((res) => {}因為它使用源作為圖像。但是,如果我加載頁面,我只會看到一個圖表一秒鐘,并且頁面加載是否完成。然后圖表消失。但圖像未顯示。But if I fill in the z with this:來自:[[0.000010752661,you have to do this:z: [[res.push(this.ok.map[0])]],but then for all values
查看完整描述

1 回答

?
桃花長相依

TA貢獻1860條經驗 獲得超8個贊

將 showHeadMap 更改為以下內容:-


showHeadMap() {


    return this.aggregateCameraHeatmapsService

        .aggregateHeatmaps('2020-11-09 10:00:00', '2020-12-10 14:15:00', 4, '1')

        .pipe(map((res) => {

             this.cameraAgretateHeadMap.heatmap = res.heatmap.slice(0, 1);

             return this.cameraAgretateHeadMap.heatmap;

         }));

  }

然后分配圖表,例如:-


this.showHeadMap().subscribe((res) => {

 this.graph = {

  data: [

    {

       z: [res],

       type: 'heatmap',

       showscale: false,

       colorscale: colorScale,

       opacity: 0.7,

       zsmooth: 'best'

    }

  ]

 }

});


查看完整回答
反對 回復 2023-11-11
  • 1 回答
  • 0 關注
  • 124 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號