UNPKG

plotly.js

Version:

The open source javascript graphing library that powers plotly

32 lines 952 B
<!DOCTYPE html> <html> <head> <title>Test Sketchmode Layout Property</title> <script src="dist/plotly.js"></script> <!-- <script src="https://cdn.plot.ly/plotly-1.58.4.min.js"></script> --> </head> <body> <div id="plot" style="width:600px;height:400px;"></div> <script> // Test data var xvals = [1, 2, 3, 4]; var yvals = [10, -1, 11, 13]; var data = [{ x: xvals, y: yvals, // orientation: 'h', // x: yvals, // y: xvals, type: 'bar', // text: yvals.map((v) => `Value: ${v}<br>second line<br>third line<br>fourth line`), text: yvals.map((v) => `Value: ${v}`), textposition: 'outside', // textposition: 'auto', }]; var layout = { title: {text: 'Multiline Bar Labels'}, }; Plotly.newPlot('plot', data, layout); </script> </body> </html>