<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 比例尺 接著上面來學習比例尺的使用。 知道了比例尺的作用就是計算映射。 那么我們簡單的嘗試幾個例子。 1. 已知圖表的高度是260,我們兩下各留白30,這樣我們展示數據的區域為200,現在我們數據范圍是0-1000,求[100,150,285,360,980]的位置?如果此時修改數據為[1000,350,1285,760,680],并且需要重置數據范圍,且圖表展示區域不變呢?(ps:只計算0-200之間,不考慮留白的30) 第一問: ``` javascript //分析這個數據需要使用線性比例尺 var y = d3.scaleLinear() .domain([0,1000]) //已知輸入域為0-1000 .range([0,200]) //值域為0-200 var array = [100,150,285,360,980] array.forEach(function(d){ console.log(y(d)) d3.select("#root").append('div').html(y(d)) }) ``` 具體完整實例查看[scale0](https://doter1995.github.io/d3-start-course/scale/scale-0.html) 第二問: ``` javascript var y = d3.scaleLinear() .domain([0,1000]) //已知輸入域為0-1000 .range([0,200]) //值域為0-200 var array = [100,150,285,360,980] array = [1000,350,1285,760,680] //計算新的輸入域d3.extent(array)將會返回array的最小值和最大值 y.domain([0,d3.max(array)]) array.forEach(function(d){ console.log(y(d)) d3.select("#root").append('div').html(y(d)) }) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看