Movatterモバイル変換


[0]ホーム

URL:


Quick Reference
On This Page
Sign up for the upcoming webinar, Meet Plotly Cloud: Dash Apps as a Team Sport

Responsive / Fluid Layouts in JavaScript

How to create figures with responsive/fluid layouts in JavaScript.


Plotly Studio: Transform any dataset into an interactive data application in minutes with AI.Try Plotly Studio now.

If you set theresponsive attribute equal totrue (using theconfig object), then your figures will be automatically resized when the browser window size changes. This is an especially useful feature for charts which are going to viewed on mobile devices!

var trace1 = {  type: 'bar',  x: [1, 2, 3, 4],  y: [5, 10, 2, 8],  marker: {      color: '#C8A2C8',      line: {          width: 2.5      }  }};var data = [ trace1 ];var layout = {  title: {    text: 'Responsive to window\'s size!'  },  font: {size: 18}};var config = {responsive: true}Plotly.newPlot('myDiv', data, layout, config );

[8]ページ先頭

©2009-2026 Movatter.jp