Skip to content
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

How to group multiple same intervals into one? #48

Open
Anil-bohorya opened this issue Mar 6, 2019 · 0 comments
Open

How to group multiple same intervals into one? #48

Anil-bohorya opened this issue Mar 6, 2019 · 0 comments

Comments

@Anil-bohorya
Copy link

I started working on react-c3js and got stuck into some problem.

Below is my X-axis array:

"axis": {"x": ["4 2018", "4 2018", "5 2018", "5 2018", "6 2018", "6 2018", "6 2018", "6 2018", "6 2018", "6 2018", "6 2018", "6 2018", "6 2018", "7 2018", "7 2018", "7 2018", "7 2018", "7 2018", "7 2018", "7 2018", "7 2018", "7 2018", "7 2018", "7 2018", "7 2018", "7 2018", "8 2018", "8 2018", "8 2018", "8 2018", "8 2018", "8 2018", "8 2018", "8 2018", "8 2018", "8 2018", "8 2018", "8 2018", "8 2018", "8 2018", "9 2018", "9 2018", "9 2018", "9 2018", "9 2018", "9 2018", "9 2018", "9 2018", "9 2018", "9 2018", "9 2018", "9 2018", "9 2018", "9 2018", "10 2018", "10 2018", "10 2018", "10 2018", "10 2018", "10 2018", "10 2018", "10 2018", "10 2018", "10 2018", "10 2018", "10 2018", "10 2018", "10 2018", "11 2018", "11 2018", "11 2018", "11 2018", "11 2018", "11 2018", "11 2018", "11 2018", "11 2018", "11 2018", "11 2018", "11 2018", "11 2018", "12 2018", "12 2018", "12 2018", "12 2018", "12 2018", "12 2018", "12 2018", "12 2018", "12 2018", "12 2018", "1 2019", "1 2019", "1 2019"]
}

My code :

const chartData = ({ data }) =>
  <C3Chart tooltip= {{
    format: {
        value: function (value, ratio, id) {
            return (value == -30) ? 'STD' : value;
        }
    }
}} axis= {{'x': {type: 'category',categories: axis['x'],tick: {culling: {max: 10 }}}, 'y': {max: 180,min: -30,padding: {top:1, bottom:1}, tick: { values: [0, 30, 60, 90, 120, 150, 180]}}}} line= {{ connectNull: false }} data={{ json: data.chartInfo, type:'line'}} />

Actual result:
screen shot 2019-03-06 at 2 46 27 pm

How to merger these interval so that it looks like

screen shot 2019-03-05 at 10 46 50 pm

Also raised here:
https://stackoverflow.com/questions/55008548/how-to-group-x-axis-points-in-react-c3js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant