Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't view the title and axis labels #1

Open
SaumilShah66 opened this issue Aug 23, 2021 · 0 comments
Open

Can't view the title and axis labels #1

SaumilShah66 opened this issue Aug 23, 2021 · 0 comments

Comments

@SaumilShah66
Copy link

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> 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant