[Redizajn 1KA v2] - Testiranje --> Diagnostika - v2

Premaknjen source in funkcija za graf v svoj .js file
This commit is contained in:
tejagerjovic 2022-07-19 10:46:54 +02:00
parent bb39db9dbf
commit ae33fd6ee8
5 changed files with 44 additions and 31 deletions

View File

@ -467,8 +467,6 @@ class SurveyDiagnostics
echo '</table>'; echo '</table>';
// LASTNOSTI ANKETE // LASTNOSTI ANKETE
echo '<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>'; //Chart.js source
echo '<h2>'.$lang['srv_testiranje_diagnostika_lastnosti'].'</h2>'; echo '<h2>'.$lang['srv_testiranje_diagnostika_lastnosti'].'</h2>';
echo '<div class="lastnosti_wrapper">'; echo '<div class="lastnosti_wrapper">';

View File

@ -96,6 +96,9 @@ return [
dirname(__FILE__).'/../script/DragDrop/dragdropInAdmin.js', dirname(__FILE__).'/../script/DragDrop/dragdropInAdmin.js',
dirname(__FILE__).'/../script/custom_column_label_respondent.js', dirname(__FILE__).'/../script/custom_column_label_respondent.js',
dirname(__FILE__).'/../script/ImageHotSpot/imagemap_question_editor.js', dirname(__FILE__).'/../script/ImageHotSpot/imagemap_question_editor.js',
dirname(__FILE__).'/../script/ImageHotSpot/imageHotspot.js',
dirname(__FILE__).'/../script/Chartjs/Chart.js', //source za chartjs grafe
dirname(__FILE__).'/../script/Chartjs.js',
dirname(__FILE__).'/../script/jquery/jquery.imagemapster.js', dirname(__FILE__).'/../script/jquery/jquery.imagemapster.js',

View File

@ -0,0 +1,28 @@
function diagnosticsChart(place,display) {
const data = {
datasets: [{
data: display,
backgroundColor: [
'rgb(229,229,229)',
'rgb(30, 136, 229)',
],
borderWidth: 0, //spacing between slices
}]
};
const config = {
type: 'doughnut',
data: data,
options: {
events: [], //no hover labels,animations,...
cutout: 32, //slice width
}
};
const myChart = new Chart(
document.getElementById(place),
config
);
}

File diff suppressed because one or more lines are too long

View File

@ -5638,33 +5638,4 @@ function oneClickArchive(){
$('#general_popup').addClass('PopUpNarrow'); $('#general_popup').addClass('PopUpNarrow');
$('#general_popup').html('').fadeIn('slow'); $('#general_popup').html('').fadeIn('slow');
$("#general_popup").load('ajax.php?a=oneClickArchive', {anketa: srv_meta_anketa_id}); $("#general_popup").load('ajax.php?a=oneClickArchive', {anketa: srv_meta_anketa_id});
}
function diagnosticsChart(place,display) {
const data = {
datasets: [{
data: display,
backgroundColor: [
'rgb(229,229,229)',
'rgb(30, 136, 229)',
],
borderWidth: 0, //spacing between slices
}]
};
const config = {
type: 'doughnut',
data: data,
options: {
events: [], //no hover labels,animations,...
cutout: 32, //slice width
}
};
const myChart = new Chart(
document.getElementById(place),
config
);
} }