Skip to content

Can't view the title and axis labels #1

@SaumilShah66

Description

@SaumilShah66

I generated this html file using cppplotly. Set the layout using the official plotly documentation, but couldn't get to show the title and axis labels.

<!DOCTYPE html> 
<head> 
<meta charset="utf-8" /> 
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script></head> 
<body> 
<div id="d2ad872f-61d6-11e8-836b-96e4cd0da1b2"></div> 
<script src="https://cdn.plot.ly/plotly-1.45.3.min.js"></script> 
<script> 
function maximizar(){Plotly.relayout(document.getElementById('d2ad872f-61d6-11e8-836b-96e4cd0da1b2'), {height: window.innerHeight * 0.80, width: window.innerWidth * 0.80});};window.onresize = function() {$('.js-plotly-plot').each(function(index, gd) {Plotly.Plots.resize(gd).then(function(){maximizar()});});};Plotly.react(document.getElementById('d2ad872f-61d6-11e8-836b-96e4cd0da1b2'), 
[
{
    "type": "scatter", 
    "x": [1, 2, 3, 4, 5], 
    "y": [2, 4, 8, 16, 32],
}
],
{
"layout": {
        "title": {
            "text":'Plot Title',
            "font": {
                "size": 24
                },
            "xref": 'paper',
            "x": 0.05,
        },
        "xaxis": {
            "title": {
                "text": "X - axis",
                "font": {
                    "size": 18,
                    "color": '#7f7f7f'
                }
            }
        },
        "yaxis": {
            "title": {
                "text": "Y-axis"
            }
        }
    }
}); 
maximizar();</script> 
 </body> 
 </html> 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions