| @@ -117,38 +117,8 @@ | ||
| 117 | 117 | if ( getChart ) { |
| 118 | 118 | return; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - // Format series label. | |
| 122 | - settings.plugins.tooltip = { | |
| 123 | - callbacks: { | |
| 124 | - label: function(context) { | |
| 125 | - var label = ''; | |
| 126 | - if ( 'object' === typeof context.dataset.label ) { | |
| 127 | - label = context.label || ''; | |
| 128 | - } else { | |
| 129 | - label = context.dataset.label || ''; | |
| 130 | - } | |
| 131 | - if ( label ) { | |
| 132 | - label += ': '; | |
| 133 | - } | |
| 134 | - var format = context.dataset.format || ''; | |
| 135 | - if ( format ) { | |
| 136 | - var lastSuffix = numeral(context.formattedValue).format(format).replace(/[0-9]/g, ''); | |
| 137 | - label += context.formattedValue + lastSuffix; | |
| 138 | - } else { | |
| 139 | - format = 'undefined' !== typeof context.chart.config._config.options.format ? context.chart.config._config.options.format : ''; | |
| 140 | - if ( format ) { | |
| 141 | - label += format_datum( context.formattedValue, format ); | |
| 142 | - } else { | |
| 143 | - label += context.formattedValue; | |
| 144 | - } | |
| 145 | - } | |
| 146 | - return label; | |
| 147 | - } | |
| 148 | - } | |
| 149 | - }; | |
| 150 | - | |
| 151 | 121 | var chartjs = new Chart(context, { |
| 152 | 122 | type: type, |
| 153 | 123 | data: { |
| 154 | 124 | labels: labels, |
| @@ -160,9 +130,9 @@ | ||
| 160 | 130 | var canvas = $( 'canvas' )[0]; |
| 161 | 131 | if ( $( '#chart-img' ).length ) { |
| 162 | 132 | $( '#chart-img' ).val( canvas.toDataURL() ); |
| 163 | 133 | } |
| 164 | - } | |
| 134 | + }, | |
| 165 | 135 | }], |
| 166 | 136 | }); |
| 167 | 137 | |
| 168 | 138 | // this line needs to be included twice. This is not an error. |
| @@ -467,9 +437,9 @@ | ||
| 467 | 437 | |
| 468 | 438 | switch(type) { |
| 469 | 439 | case 'number': |
| 470 | 440 | // numeral.js works on 0 instead of # so we just replace that in the ICU pattern set. |
| 471 | - format = format.replace(/#/g, '0').replace(/%/g, ''); | |
| 441 | + format = format.replace(/#/g, '0'); | |
| 472 | 442 | // we also replace all instance of '$' as that is more relevant for ticks. |
| 473 | 443 | if(removeDollar){ |
| 474 | 444 | format = format.replace(/\$/g, ''); |
| 475 | 445 | } |