Giter Site home page Giter Site logo

Bar Chart issues about c3 HOT 15 CLOSED

c3js avatar c3js commented on August 25, 2024
Bar Chart issues

from c3.

Comments (15)

masayuki0812 avatar masayuki0812 commented on August 25, 2024

Hi,

The first issue is a bug. I'll fix to have correct width and position.
And the second is not a bug. Currently bars will be stacked according to the order of data, not of the values. However, I think the order should be configurable, so I'll add some option or api.

from c3.

masayuki0812 avatar masayuki0812 commented on August 25, 2024

I fixed the first issue.

from c3.

CHR15- avatar CHR15- commented on August 25, 2024

could you update the JSON file for the version?

from c3.

masayuki0812 avatar masayuki0812 commented on August 25, 2024

Yes, I updated.

from c3.

CHR15- avatar CHR15- commented on August 25, 2024

first issue confirmed fix, great work!

from c3.

masayuki0812 avatar masayuki0812 commented on August 25, 2024

Hi,

I added data.order option. This option can be used to change the order of stacking of bars.
I think you can do what you wrote above by setting this option 'desc'.
If you set 'desc', bars will be stacked from one that has minimum sum of its values.
Here is sample - http://c3js.org/samples/data_order.html

Could you try this?

from c3.

CHR15- avatar CHR15- commented on August 25, 2024

Thats perfect,

Thanks Masayuki!

from c3.

CHR15- avatar CHR15- commented on August 25, 2024

Think I have discovered an issue with the same values?

screen shot 2014-02-28 at 14 39 26

As you can see, it adds it to the to if it is the same, making it an incorrect measurement against the Y axis

from c3.

CHR15- avatar CHR15- commented on August 25, 2024

screen shot 2014-02-28 at 14 45 12

Perhaps it may be a better to split the bars in two and place them next to each other if they have the same values in the stack?

from c3.

CHR15- avatar CHR15- commented on August 25, 2024

The image above also shows that two data sources have been assigned the same colour!

from c3.

masayuki0812 avatar masayuki0812 commented on August 25, 2024

Hi,

You mean the order in chart and the order in tooltip is different?

And I think It may be better not to split bars because height will not show the sum of values and so it's not natural as stacked bar chart I think.

About color, c3 gives 10 colors to each data as default (it's d3.scale.category10()). If the number of data is over 10 and same color should be avoided, color.patterns should be used, like:
color.patterns = ['#333', #'999', ...]

from c3.

CHR15- avatar CHR15- commented on August 25, 2024

awesome, thanks

from c3.

CHR15- avatar CHR15- commented on August 25, 2024

A colour example on c3 would be cool btw!

from c3.

CHR15- avatar CHR15- commented on August 25, 2024

Believe it may be:

color: {
pattern: ['#111', '#222', '#333', '#D35400'...]
},

from c3.

masayuki0812 avatar masayuki0812 commented on August 25, 2024

Hi, I added a sample for color.pattern option - http://c3js.org/samples/options_color.html
Could you try this?
Thank you.

from c3.

Related Issues (20)

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.