| @@ -112,42 +112,8 @@ | ||
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | handleSettings(settings, chart); |
| 115 | 115 | |
| 116 | - const getChart = Chart.getChart(context); | |
| 117 | - if ( getChart ) { | |
| 118 | - return; | |
| 119 | - } | |
| 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 | - label += format_datum( context.formattedValue, format ); | |
| 137 | - } else { | |
| 138 | - format = 'undefined' !== typeof context.chart.config._config.options.format ? context.chart.config._config.options.format : ''; | |
| 139 | - if ( format ) { | |
| 140 | - label += format_datum( context.formattedValue, format ); | |
| 141 | - } else { | |
| 142 | - label += context.formattedValue; | |
| 143 | - } | |
| 144 | - } | |
| 145 | - return label; | |
| 146 | - } | |
| 147 | - } | |
| 148 | - }; | |
| 149 | - | |
| 150 | 116 | var chartjs = new Chart(context, { |
| 151 | 117 | type: type, |
| 152 | 118 | data: { |
| 153 | 119 | labels: labels, |
| @@ -159,9 +125,9 @@ | ||
| 159 | 125 | var canvas = $( 'canvas' )[0]; |
| 160 | 126 | if ( $( '#chart-img' ).length ) { |
| 161 | 127 | $( '#chart-img' ).val( canvas.toDataURL() ); |
| 162 | 128 | } |
| 163 | - } | |
| 129 | + }, | |
| 164 | 130 | }], |
| 165 | 131 | }); |
| 166 | 132 | |
| 167 | 133 | // this line needs to be included twice. This is not an error. |
| @@ -224,12 +190,8 @@ | ||
| 224 | 190 | delete settings['legend']['labels'][i]; |
| 225 | 191 | } |
| 226 | 192 | } |
| 227 | 193 | } |
| 228 | - | |
| 229 | - settings.plugins = { | |
| 230 | - legend: settings.legend, | |
| 231 | - }; | |
| 232 | 194 | |
| 233 | 195 | handleAxes(settings, chart); |
| 234 | 196 | |
| 235 | 197 | override(settings, chart); |