Git Product home page Git Product logo

flot.barlabels's Issues

Rotate label

Hello,

Is it possible to rotate the label 90° ?
I tried to rotate de context, as following, before/after the call to addText but it does not work.
The angle parameter is not used by Flot so it cannot work neither.

barLabels.context.rotate(270 * Math.PI / 180);
barLabels.addText(layer, px, py, text, series.labels.font, angle, width, halign, valign); (Line 146)

Thanks for any idea !

Responsive Support

Hi, I'm facing issues while resizing the chart.
The position of the labels remain the same while resizing the chart.This makes the labels to be displayed at incorrect positions.

Any fix available??

Crash with multiple categories and ordered bars

Hello,

When I am using ordered bars (to have multiple categories side by side), all label are "Nan".
Because the series.data[i][2] can be empty and so "b" variable is undefined.
var b = series.data[i].length > 2 ? series.data[i][2] : 0; (line 59)

Could you add a check to prevent this crash please ?
(Something like for example): var b = series.data[i].length > 2 && series.data[i][2] ? series.data[i][2] : 0; )

Thank you for your help !

Stacked Bar Graph Label Base Offset

Really like what you've done here but I believe you might have a bug with Stacked Bar charts. The labels do show up, but they fail to account for the base offset for each stacked bar. Do you by any chance have a solution for this?

Labels disappear when resizing the screen

Hello Cédric,

When resizing the screen, the labels disappear. (And the same issue replicated when the graph drawn multiples times...)

The cause seems to be that when deleting the labels from Dom (see below), the cache inside of Canvas class still keeping them, becomes invalid then.

$(placeholder).find(".flot-bar-labels > .flot-bar-label").remove();

https://github.com/cleroux/flot.barlabels/blob/dae966dacd6bc256b136bcbdb48d395a7306d502/jquery.flot.barlabels.js#L38

Could you so remove them from the cache when delelting from Dom, please ?
For example, something as following:

var layer = "flot-bar-labels";
if (barLabels == null) {
barLabels = new Canvas("flot-bar-labels", placeholder);
}
else {
barLabels.removeText(layer);
barLabels.render();
}
$(placeholder).find(".flot-bar-labels > .flot-bar-label").remove();

as removeText() will only make the texts inactive, render() method will remove actually from the cache.

I have tested this fix.

Possible alternative not tested: in the current version of Flot, Canvas.clearCache() method could remove everything (without specifing the layer). My Flot version too old and this method not existing, so I could not check whether this method could also fix.

Thank you !

How to show the label outside but at the bottom of the bar, not on top ?

Hi,

Could you tell me whether it is possible to show the label outside but at the bottom of the bar and not at the top as now ?
I have tried to add this option as following (naming bottom_outside position) but it is not working when y is positive.

else if (pos == positions.bottom_outside) {
                            if (y >= 0) {
                                valign = "top";
                                py =  series.yaxis.p2c(b)  + plot.getPlotOffset().bottom;
                            } else {
                                valign = "bottom";
                                py =  series.yaxis.p2c(b) + series.labels.padding;
                            }

Thank you for your help

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.