Coder Social home page Coder Social logo

pablrod / cppplotly Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 1.0 330 KB

Generate html/javascript charts from C++ data using javascript library plotly.js

License: MIT License

CMake 0.04% C++ 99.43% Perl 0.53%
chart cpp header-only plot plotly plotlyjs

cppplotly's People

Contributors

pablrod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

pradeepchawda

cppplotly's Issues

Can't view the title and axis labels

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> 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.