Cloud Stack Ninja

I am using a Plotly graph and can give this a title in JavaScript. It will be empty until the user fills in some number fields.

So currently I have the title as:

var layout = {
  title: 'Please enter data to see it graphed',
  font: {size: 12}
};

and I would like to change this into:

var layout = {
  title: 'Income Chart',
  font: {size: 18}
};

when a function is called. This function is listening to events on the input field.

I know how to use javascript to change HTML, but would essentially like to use JavaScript to change JavaScript. Is this possible?



Read more here: https://stackoverflow.com/questions/64415750/is-it-possible-to-use-javascript-to-change-javascript-like-when-using-javascript

Content Attribution

This content was originally published by Alexander Forrest at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: