javascript - 如何在 PLOTLY JS 中为每个子图添加标题

标签 javascript graph title plotly.js

就像主题一样。 我从 plotly 阅读了文档,但没有找到任何有用的信息。也许有人知道如何在 PLOTLY JS 中为每个情节添加标题?

最佳答案

目前您不能直接设置子图标题。 但是您可以使用 annotation text 设置子图标题。

听到是example

    //Set annotations text in layout configuration
annotations: [{
        text: "First subplot",
          font: {
          size: 16,
           color: 'green',
        },
        showarrow: false,
        align: 'center',
        x: 0.13, //position in x domain
        y: 1, //position in y domain
        xref: 'paper',
        yref: 'paper',
      },
        {
          text: "Second subplot",
          font: {
          size: 16,
          color: 'orange',
        },
        showarrow: false,
        align: 'center',
        x: 0.9, //position in x domain
        y: 1,  // position in y domain
        xref: 'paper',
        yref: 'paper',
        }
      ]

Annotation text plotly.js

关于javascript - 如何在 PLOTLY JS 中为每个子图添加标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51592730/

相关文章:

css - 在wordpress中隐藏特定类别标题

css - 更改 af 标题的颜色 :document in jsf page of ADF

javascript - jQuery 向下滚动按钮不起作用

javascript - 我的 if 语句不起作用

javascript - 在运行时将对象传递给 javascript 函数

c# - 从柱形图中删除 x 和 y 轴

jquery - 在打印 CSS 中插入页面标题

JavaScript:如何在验证后重定向页面

graph - Gnuplot:使用矩阵格式的 4d 颜色图

java - 通过迷宫的最短路径