Giter Site home page Giter Site logo

Rotate label about flot.barlabels HOT 3 CLOSED

cleroux avatar cleroux commented on June 24, 2024
Rotate label

from flot.barlabels.

Comments (3)

cleroux avatar cleroux commented on June 24, 2024

I haven't used flot in several years so I have only tested this on version 0.8.3 which was the last stable version before the new maintainers took over. (v0.8.3 is still available here http://www.flotcharts.org/downloads/ or in the example directory of this repository)

It's unfortunate Flot wasn't updated to support rotated text because it's actually pretty easy. You will need to modify jquery.flot.js or download the modified version from this repository (Please see the notes I added to the README).

In jquery.flot.js at the end of Canvas.prototype.AddText(), add the CSS transform to rotate the text.

        position.element.css({
            top: Math.round(y),
            left: Math.round(x),
            'text-align': halign,
            transform: 'rotate('+angle+'deg)'  // Add this line
        });

I have updated this plugin to support the angle option, updated the README and added an example.

image

I hope this helps. I'm closing this issue since I think this is the best solution I can offer.

from flot.barlabels.

hnguye34 avatar hnguye34 commented on June 24, 2024

It 's working well. Thank you for your help !

from flot.barlabels.

hnguye34 avatar hnguye34 commented on June 24, 2024

Reopened by accident

from flot.barlabels.

Related Issues (7)

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.