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

The dashed line is wrong when using data.groups and data.regions togather #1749

Open
shijingjing1221 opened this issue Jul 4, 2016 · 1 comment

Comments

@shijingjing1221
Copy link

shijingjing1221 commented Jul 4, 2016


        var chart = c3.generate({
            data: {
                type: "area",
                groups: [['data1', 'data2']],
                columns: [
                    ['data1', 30, 200, 60, 400, 150, 250],
                    ['data2', 50, 20, 50, 40, 15, 25]
                ],
                regions: {
                    'data1': [{'start':1, 'end':2, 'style':'dashed'},{'start':3}], // currently 'dashed' style only
                      'data2': [{'end':3}]
                }
            }
        });

http://jsfiddle.net/7ydhyjm3/2/

@javflores
Copy link

javflores commented Dec 21, 2016

Hi there,
I was having a similar issue. I ended up finding that groups were the issue.
Try splitting your groups like this (it seems to work for me):

var chart = c3.generate({
  data: {
    type: "line",
    groups: [['data1'], ['data2']],
    columns: [
      ['data1', 30, 200, 60, 400, 150, 250],
      ['data2', 50, 20, 50, 40, 15, 25]
    ],
    regions: {
      'data1': [{'start':1, 'end':2, 'style':'dashed'},{'start':3}], // currently 'dashed' style only
      'data2': [{'end':3}]
    }
  }
});

If you change your graph to spline, it won't work though, but that's a different story :)

var chart = c3.generate({
  data: {
    type: "spline",
    groups: [['data1'], ['data2']],
    columns: [
      ['data1', 30, 200, 60, 400, 150, 250],
      ['data2', 50, 20, 50, 40, 15, 25]
    ],
    regions: {
      'data1': [{'start':1, 'end':2, 'style':'dashed'},{'start':3}], // currently 'dashed' style only
      'data2': [{'end':3}]
    }
  }
});

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

2 participants