第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

amCharts 中項目符號(箭頭)的旋轉(zhuǎn)

amCharts 中項目符號(箭頭)的旋轉(zhuǎn)

一只萌萌小番薯 2022-05-26 16:55:28
我有一個圖表顯示了選定國家的兩個時間點的變量演變。箭頭代表時間 2 中的水平。當值在時間 1 和時間 2 之間減小時(在我的示例中為意大利和德國),我希望箭頭向下(旋轉(zhuǎn) 180°)。相反,當值在時間 1 和時間 2 之間增加時,箭頭應(yīng)該向上(在我的示例中為瑞士、法國和西班牙)。有誰知道我可以在我的 amCharts 中添加一段代碼來自動旋轉(zhuǎn)箭頭?我有一個帶有我的數(shù)據(jù)和圖形的 CodePen:https ://codepen.io/European-DataLab/pen/qBdyzap我的代碼是:// Create chart instancevar chart = am4core.create("chartdiv", am4charts.XYChart);// Add datachart.data = [  {"Country":"Switzerland","time2":878,"time1":270}, {"Country":"France","time2":1861,"time1":1237}, {"Country":"Spain","time2":3431,"time1":1987.6667}, {"Country":"Italy","time2":322,"time1":3911}, {"Country":"Germany","time2":940,"time1":1120}];// Create axis Xvar categoryAxis = chart.xAxes.push(new am4charts.CategoryAxis());categoryAxis.dataFields.category = "Country";categoryAxis.renderer.grid.template.location = 0;categoryAxis.renderer.minGridDistance = 1;categoryAxis.renderer.labels.template.rotation = -45;categoryAxis.renderer.labels.template.verticalCenter = "top";categoryAxis.renderer.labels.template.horizontalCenter = "right";categoryAxis.renderer.grid.template.disabled = true;// Create axis Yvar valueAxis = chart.yAxes.push(new am4charts.ValueAxis());// Series for linking dot and arrowvar series = chart.series.push(new am4charts.ColumnSeries());series.dataFields.categoryX = "Country";series.dataFields.openValueY = "time1";series.dataFields.valueY = "time2";series.sequencedInterpolation = true;series.fillOpacity = 0;series.strokeOpacity = 1;series.columns.template.stroke = am4core.color("#000000")series.columns.template.width = 0.01;series.tooltip.pointerOrientation = "horizontal";//Series for Time 2var dot1_1 = chart.series.push(new am4charts.LineSeries());dot1_1.dataFields.valueY = "time2";dot1_1.dataFields.categoryX = "Country";dot1_1.strokeWidth = 0;dot1_1.name = "Time 2";
查看完整描述

1 回答

?
aluckdog

TA貢獻1847條經(jīng)驗 獲得超7個贊

這應(yīng)該做的工作:


arrow.adapter.add("rotation", function(rotation, target){

  if(target.dataItem.dataContext.time1 < target.dataItem.dataContext.time2){

    return 0

  }

  else{

    return 180

  }

})


查看完整回答
反對 回復(fù) 2022-05-26
  • 1 回答
  • 0 關(guān)注
  • 152 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號