{"action":"created","issue":{"url":"https://api.github.com/repos/chartjs/Chart.js/issues/2432","repository_url":"https://api.github.com/repos/chartjs/Chart.js","labels_url":"https://api.github.com/repos/chartjs/Chart.js/issues/2432/labels{/name}","comments_url":"https://api.github.com/repos/chartjs/Chart.js/issues/2432/comments","events_url":"https://api.github.com/repos/chartjs/Chart.js/issues/2432/events","html_url":"https://github.com/chartjs/Chart.js/issues/2432","id":152541236,"number":2432,"title":"Create new Chart 2.0 with old format","user":{"login":"Minifish57","id":16252118,"avatar_url":"https://avatars.githubusercontent.com/u/16252118?v=3","gravatar_id":"","url":"https://api.github.com/users/Minifish57","html_url":"https://github.com/Minifish57","followers_url":"https://api.github.com/users/Minifish57/followers","following_url":"https://api.github.com/users/Minifish57/following{/other_user}","gists_url":"https://api.github.com/users/Minifish57/gists{/gist_id}","starred_url":"https://api.github.com/users/Minifish57/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Minifish57/subscriptions","organizations_url":"https://api.github.com/users/Minifish57/orgs","repos_url":"https://api.github.com/users/Minifish57/repos","events_url":"https://api.github.com/users/Minifish57/events{/privacy}","received_events_url":"https://api.github.com/users/Minifish57/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/chartjs/Chart.js/labels/Category:%20Question","name":"Category: Question","color":"cc317c"},{"url":"https://api.github.com/repos/chartjs/Chart.js/labels/Version:%202.x","name":"Version: 2.x","color":"0052cc"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-02T12:11:28Z","updated_at":"2016-05-04T01:43:33Z","closed_at":"2016-05-04T01:43:33Z","body":"Hi everyone,\r\n\r\nI have a question about this new version of Chart.js\r\nBefore this version 2.0, I've got a website with many many chart and that I would like to know is : \"Is it possible to keep all my chart with the old format declaration, or Do I need to change all of them ?\"\r\nI Have a very important number of chart and it was very a tedious task to migrate all of them\r\n\r\nwhat i call old format is that :\r\n```javascript\r\nvar dataMainMasterContainer_ContractMasterContainer_ChartJsStackBar1 = {\r\nlabels : [\"30/06/2013\",\"30/09/2013\",\"31/12/2013\",\"10/06/2014\",\"31/08/2014\",\"31/12/2014\",\"30/04/2015\",\"31/08/2015\",\"31/12/2015\"],\r\ndatasets: [{label:\"Dédié\",type: \"bar\",fillColor: \"#a99d75\",strokeColor: \"#a99d75\",highlightFill: \"#978A5E\",highlightStroke: \"#978A5E\", data: [1110200.27376176,1133017.99554997,1154126.09991807,1193123,1058153.029031,1059015.19836619,1064810.59915042,1046282.9287172,1037681.19206891]\r\n},\r\n{label:\"Versements - Retraits\",type: \"line\",fillColor: \"#000000\",strokeColor: \"#000000\", data: [913900,913900,913900,913900,913900,913900,913900,913900,913900]}\r\n,{label:\"UC\",type: \"bar\",fillColor: \"#807a66\",strokeColor: \"#807a66\",highlightFill: \"#686453\",highlightStroke: \"#686453\", data: [0,0,0,0,147003.884361,146863.11112038,153460.771895431,149988.550800914,153798.474035177]\r\n}]};\r\n\r\nvar optionMainMasterContainer_ContractMasterContainer_ChartJsStackBar1 = { \r\nscaleLineColor : \"black\"\r\n,scaleFontColor : \"black\"\r\n,scaleShowGridLines : false\r\n,tooltipFontColor : \"#fff\"\r\n,tooltipCornerRadius : 0\r\n,scaleBeginAtZero : true\r\n,scaleGridLineColor : \"rgba(0,0,0,.05)\"\r\n,scaleGridLineWidth : 1\r\n,scaleShowHorizontalLines : true\r\n,scaleShowVerticalLines : true\r\n,legendTemplate : \"<ul class='<%=name.toLowerCase()%>-legend'><% for (var i=0; i<datasets.length; i++){%><li><span style='background-color:<%=datasets[i].strokeColor%>'><%if(datasets[i].label){%><%=datasets[i].label%><%}%></span></li><%}%></ul>\"\r\n,tooltipHideZero : false\r\n,sortLabels : true\r\n,reverseLabels : false\r\n,barShowStroke : true\r\n,barStrokeWidth : 0\r\n,barValueSpacing : 20\r\n,relativeBars : false\r\n,pointDot : false\r\n,datasetFill : false\r\n,bezierCurve : true\r\n,scaleSteps : 1\r\n,responsive : true\r\n,maintainAspectRatio : true\r\n,overlayBars : true\r\n,scaleLabel : \"<%= number_format(numberCurrency(value),retr_dec(value),',','.')%> EUR\"\r\n,multiTooltipTemplate : \"<%= number_format(numberCurrency(value),0,',','.') %> USD\"\r\n,tooltipTemplate : \"<%= number_format(numberCurrency(value),0,',','.') %> USD\"\r\n/*,customTooltips : function(tooltip) {if (!tooltip) {var count = 0;for (i = 0; i < dataMainMasterContainer_ContractMasterContainer_ChartJsStackBar1.datasets.length; i++) { document.getElementById('MainMasterContainer_ContractMasterContainer_ChartJsStackBar1_selection'+ i).innerHTML='&nbsp;'; count++}document.getElementById('MainMasterContainer_ContractMasterContainer_ChartJsStackBar1_selection'+ count ).innerHTML='&nbsp;';count++;document.getElementById('MainMasterContainer_ContractMasterContainer_ChartJsStackBar1_selection'+ count ).innerHTML='&nbsp;';count++;document.getElementById('MainMasterContainer_ContractMasterContainer_ChartJsStackBar1_label').innerHTML='&nbsp;';return;}var label;if(tooltip.labels) {window.tooltipArray = new Array();var capitalGain = 0;var sumReserve = 0;var count = 0;var currencyGain = ''; for(i=0;i<tooltip.labels.length;i++){   var aa = tooltip.labels[i].split('#');   var label = aa[0];   var value = aa[1];   var currencyTab = value.split(' ');   var currency = currencyTab[currencyTab.length - 1];   var decimalCount = retr_dec(numberCurrency(value));   var numberValue = numberCurrency(value);   window.tooltipArray[label] = numberValue;   var stringValue = numberValue != 0 ? number_format(numberValue , decimalCount ,',','.') + ' ' + currency: '';   label = aa[2];   document.getElementById('MainMasterContainer_ContractMasterContainer_ChartJsStackBar1_selection'+ i ).innerHTML=stringValue;   if(i > 0 ){      sumReserve += numberValue;   }else{      capitalGain += numberValue;      currencyGain = currency;   }   count++; }var gain = sumReserve - capitalGain;var decimalCountGain = retr_dec(numberCurrency(gain));var stringValueGain = gain != 0 ? number_format(gain , decimalCountGain ,',','.') + ' ' + currencyGain: '';document.getElementById('MainMasterContainer_ContractMasterContainer_ChartJsStackBar1_selection'+ count ).innerHTML=stringValueGain;count++;var percentage = (((sumReserve - capitalGain)/capitalGain)*100).toFixed(2);var percentageString = '(' + ( percentage > 0 ? '+':'' ) + percentage + '%)';document.getElementById('MainMasterContainer_ContractMasterContainer_ChartJsStackBar1_selection'+ count ).innerHTML=percentageString;} else {   var i = 0;   var aa = tooltip.text.split('#');   var value = aa[1];   label = aa[2];   document.getElementById('MainMasterContainer_ContractMasterContainer_ChartJsStackBar1_selection'+ i ).innerHTML=value;}  document.getElementById('MainMasterContainer_ContractMasterContainer_ChartJsStackBar1_label').innerHTML=label;}*/\r\n };\r\nvar myChart = new Chart(document.getElementById(\"MainMasterContainer_ContractMasterContainer_ChartJsStackBar1\").getContext(\"2d\")).Overlay(dataMainMasterContainer_ContractMasterContainer_ChartJsStackBar1, optionMainMasterContainer_ContractMasterContainer_ChartJsStackBar1);\r\n```\r\n\r\nThanks a lot for answers"},"comment":{"url":"https://api.github.com/repos/chartjs/Chart.js/issues/comments/216718135","html_url":"https://github.com/chartjs/Chart.js/issues/2432#issuecomment-216718135","issue_url":"https://api.github.com/repos/chartjs/Chart.js/issues/2432","id":216718135,"user":{"login":"etimberg","id":6757853,"avatar_url":"https://avatars.githubusercontent.com/u/6757853?v=3","gravatar_id":"","url":"https://api.github.com/users/etimberg","html_url":"https://github.com/etimberg","followers_url":"https://api.github.com/users/etimberg/followers","following_url":"https://api.github.com/users/etimberg/following{/other_user}","gists_url":"https://api.github.com/users/etimberg/gists{/gist_id}","starred_url":"https://api.github.com/users/etimberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etimberg/subscriptions","organizations_url":"https://api.github.com/users/etimberg/orgs","repos_url":"https://api.github.com/users/etimberg/repos","events_url":"https://api.github.com/users/etimberg/events{/privacy}","received_events_url":"https://api.github.com/users/etimberg/received_events","type":"User","site_admin":false},"created_at":"2016-05-04T01:43:33Z","updated_at":"2016-05-04T01:43:33Z","body":"@Minifish57 Unfortunately you will have to change them because the config has changed."}}