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

change the position of graphics #3249

Closed
fernandooj opened this issue Sep 1, 2016 · 4 comments
Closed

change the position of graphics #3249

fernandooj opened this issue Sep 1, 2016 · 4 comments

Comments

@fernandooj
Copy link

fernandooj commented Sep 1, 2016

I would like to ask for help with the following, the code works fine, but what does not work is the position of the graphics,
Behind the line graph of the bar graph looks like I can do to make it look ahead
thanks

$scope.labels = ['JAN', 'FEB', 'MAR', 'APR', 'MAY', 'JUN', 'JUL', 'AUG', 'SEP', 'OCT', 'NOV', 'DEC'],

$scope.type = 'StackedBar';
$scope.series = ['2015', '2016'];
$scope.borderWidth=0;

$scope.data = [
    [19, 38, 29, 34, 26, 49, 11, 46, 3, 36, 12, 24],    
    [52, 59, 65, 30, 27, 27, 77, 33, 63, 44, 45, 45],
    [29, 3, 6, 36, 47, 24, 12, 21, 34, 20, 43, 31],
];
$scope.datasetOverride=[{yAxisID:'y-axis-1'},{ yAxisID: 'y-axis-2' }, {
    borderWidth:1,
    type:'line',
    borderColor: 'rgba(34,34,34,0.3)',
    backgroundColor: 'rgba(34,34,34,0.2)',
},
{  
    borderWidth:0,
    type:'bar',
    backgroundColor: '#000000',
    borderWidth:'5px'                
},
{
    backgroundColor: '#000000',                
    borderWidth:0,
    type:'bar',

}];
$scope.options = {
  scales: {
    xAxes: [{
      stacked: true,
    }],
    yAxes: [ 
        {
            stacked: true,
            display: false,
         },
        {
            id: 'y-axis-1',
            type:'linear',
             position: 'left',
              backgroundColor: '#000000',  
        },
        {
            id: 'y-axis-2',
            type:'linear',
            position: 'right',
             backgroundColor: '#000000',  
        },
    ]
  }
};

heres is the codepen: http://codepen.io/fernandooj/pen/LRYxJJ

Edit: code formatting

@etimberg
Copy link
Member

etimberg commented Sep 1, 2016

if I understand correctly, you want the line in front of the bars?

@fernandooj
Copy link
Author

hi @etimberg thanks for reply, yes correct, that's what I need

@etimberg
Copy link
Member

etimberg commented Sep 1, 2016

This is a duplicate of #1955

You can change the order of the datasets to achieve this

@fernandooj
Copy link
Author

hi @etimberg
i already did, put first the graphic line, but still behind other graphics

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

No branches or pull requests

2 participants