-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Morris.Bar revisited + necessary Morris.Grid changes #101
Conversation
How to boost user experience?Disable How to define gradient in
|
Cool! I'm going to hack on this now. I'm thinking of changing the way the x-axis scaling works for bar graphs. Instead of doing a straight time-based interpolation, I'd rather split the chart into equal-sized blocks for each entry in options.data. This should mean we don't need the padding calculations.. |
Waiting for your changes 👍 |
OK, take a look at e4f4594. I've taken your work and pared it right down to the absolute bare essentials, removing some unnecessary bits that were leftover from Morris.Line and refactoring anything relating to horizontal positioning. To keep the basic functionality of the bar chart clear, I've removed some of your new additions. I've no objections to any of them, I'd just like to build up the features incrementally from a really solid base. What do you think? |
Sweet! Anyway, I will still need to fork Morris.Bar because I do need gradient support for fill attribute. I will work on it and try to give you more solid method for defining bar colors/gradients. |
Looking forward to your next pull request already - thanks for all the hard Sent from my iPad On 31 Oct 2012, at 22:15, Marcin Chwedziak [email protected] wrote: Sweet! Anyway, I will still need to fork Morris.Bar because I do need gradient — |
Hey! i love the plugin... i have a suggestion, in some cases it would be useful to hide the details pop-over on the bar chart. Im showing only one item with three bars on it, the problem is that the popover stay always visible and my beautiful colored bars are always behind it. I couldn't find a parameter to hide it |
Set option: |
Thank you for your answer! I tried to set the |
|
The pop-over stays always visible, is there something wrong with my code? jQuery(document).ready(function(){
Morris.Bar({
element: 'active-comments-chart',
data: [
{ y: 'Active Comments', a: 20, b: 60, c: 40 }
],
xkey: 'y',
ykeys: ['a', 'b', 'c'],
labels: ['Complaints', 'Suggestions', 'Compliments'],
barColors: ['#ff5d5d', '#1D9EFF', '#74d782'],
hideHover: false
});
}) |
Set this parameter to |
it worked! |
Hello there and thanks in advance. i have this problem that in the plugin when i bring information with an ajax for building a bar chart with "Morris.js" ,every second bar of the axis is not showing the information(the tooltip working through) , but if i write the "json" straight to the code it works fine what is my mistake? here is the code: $(document).ready(function(){ var numberOfSeconds=30*1000; //the interval of refreshing the information of the calls per server //The m_graph contains an information /** * This Function get the number of calls per each server * return a JSON object to the morris.js pluggin */ function getTheInfoAboutTheServers(){ var inf=null; $.ajax({
}); return inf; } |
Morris.Bar for refactored version - I am a such impatient programmer, forgive me please :-)
Features:
@ymax
as the reference for "top",Because I needed to move first and last x-axis category to not make any bar exceed the paper geometry, I had updated
Morris.Grid
to allow padding per side (css-like syntax), extract Grid left/right padding, and add additional callback@overridePadding() if @overridePadding
which allowed me to change all these values to get the chart working.Example included with the library:
This PR successfully closes #98 :-)