<html>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
<body>
<div id="myPlot" style="width:100%;max-width:700px"></div>
<script>
var exp = "x + 17";
// Generate values
var xValues = [];
var yValues = [];
for (var x = 0; x <= 10; x += 1) {
xValues.push(x);
yValues.push(eval(exp));
}
// Define Data
var data = [{
x: xValues,
y: yValues,
mode:"lines"
}];
// Define Layout
var layout = {title: "y = " + exp};
// Display using Plotly
Plotly.newPlot("myPlot", data, layout);
</script>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryai_plotly_function_linear by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 05 Sep 2022 14:47:02 GMT -->
</html>