Skip to content

Commit 8dfe2fc

Browse files
committed
correction import highcharts
1 parent 503d687 commit 8dfe2fc

11 files changed

Lines changed: 26 additions & 12 deletions

File tree

frontend/src/components/graph/camembert.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@
2828
import Highcharts from 'highcharts';
2929
import exportingInit from 'highcharts/modules/exporting';
3030
import offlineExporting from 'highcharts/modules/offline-exporting';
31+
import { Chart as highcharts } from 'highcharts-vue';
3132
3233
// Modification de highcharts pour permettre l'export des graphiques
3334
exportingInit(Highcharts); // initialise le module export, doit être fait après l'import de highcharts
3435
offlineExporting(Highcharts); // initialise l'export coté client, doit être fait après l'import de highcharts
3536
3637
export default {
3738
name: 'camembert',
39+
components: { highcharts },
3840
props: {
3941
data_db: { default: null },
4042
fieldName: { default: null },

frontend/src/components/graph/colonnes_empilees.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@
2828
import Highcharts from 'highcharts';
2929
import exportingInit from 'highcharts/modules/exporting';
3030
import offlineExporting from 'highcharts/modules/offline-exporting';
31+
import { Chart as highcharts } from 'highcharts-vue';
3132
3233
// Modification de highcharts pour permettre l'export des graphiques
3334
exportingInit(Highcharts); // initialise le module export, doit être fait après l'import de highcharts
3435
offlineExporting(Highcharts); // initialise l'export coté client, doit être fait après l'import de highcharts
3536
3637
export default {
3738
name: 'colonnes_empilees',
39+
components: { highcharts },
3840
props: {
3941
data_db: { default: null },
4042

frontend/src/components/graph/graph_lignes_multiples.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@
2828
import Highcharts, { color } from 'highcharts';
2929
import exportingInit from 'highcharts/modules/exporting';
3030
import offlineExporting from 'highcharts/modules/offline-exporting';
31+
import { Chart as highcharts } from 'highcharts-vue';
3132
3233
// Modification de highcharts pour permettre l'export des graphiques
3334
exportingInit(Highcharts); // initialise le module export, doit être fait après l'import de highcharts
3435
offlineExporting(Highcharts); // initialise l'export coté client, doit être fait après l'import de highcharts
3536
3637
export default {
3738
name: 'graph_lignes_multiples',
39+
components: { highcharts },
3840
props: {
3941
data_db: { default: null }, // données à afficher
4042
field_x: { default: null }, // nom du champ à utiliser pour les catégories de l'axe x

frontend/src/components/graph/histogramme_comparatif.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@
4646
import Highcharts from 'highcharts';
4747
import exportingInit from 'highcharts/modules/exporting';
4848
import offlineExporting from 'highcharts/modules/offline-exporting';
49+
import { Chart as highcharts } from 'highcharts-vue';
4950
5051
// Modification de highcharts pour permettre l'export des graphiques
5152
exportingInit(Highcharts); // initialise le module export, doit être fait après l'import de highcharts
5253
offlineExporting(Highcharts); // initialise l'export coté client, doit être fait après l'import de highcharts
5354
5455
export default {
5556
name: 'histogramme_comparatif',
57+
components: { highcharts },
5658
props: {
5759
data_db: { default: null },
5860
fieldGroup: { default: null },

frontend/src/main.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,8 @@ import store from '@/store/store';
66
import vuetify from '@/plugins/vuetify'; // path to vuetify export
77
import session from '@/plugins/session';
88

9-
import Highcharts from 'highcharts';
10-
import More from 'highcharts/highcharts-more';
11-
import exporting from 'highcharts/modules/exporting';
12-
import HighchartsVue from 'highcharts-vue';
13-
149
import VueMatomo from 'vue-matomo';
1510

16-
// highcharts est une librairie pour créer des graphiques
17-
More(Highcharts);
18-
exporting(Highcharts);
19-
2011
// port d'ecoute du serveur backend 5000. Mettre le meme dans config/config.py
2112
// Vue.config.devServer = { port: 8080, proxy: 'http://localhost:5005' };
2213

@@ -37,9 +28,6 @@ app.use(session);
3728

3829
// vutify est un framework css pour vuejs pour les formulaires, boutons, etc
3930
app.use(vuetify);
40-
app.use(HighchartsVue, {
41-
highcharts: Highcharts,
42-
});
4331

4432
// vue-matomo est une librairie pour suivre les statistiques de visite (Matomo)
4533
app.use(VueMatomo, {

frontend/src/modules/chasse/graph/graph_bilan_evolution.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
import Highcharts, { chart } from 'highcharts';
4949
import exportingInit from 'highcharts/modules/exporting';
5050
import offlineExporting from 'highcharts/modules/offline-exporting';
51+
import { Chart as highcharts } from 'highcharts-vue';
5152
import { apiRequest } from '../../../core/js/data/api.js';
5253
import { localisationTitle } from '../config/util.js';
5354
@@ -58,6 +59,7 @@ offlineExporting(Highcharts);
5859
5960
export default {
6061
name: 'graph_bilan_evolution',
62+
components: { highcharts },
6163
props: {
6264
bilanParams: { type: Object, default: () => ({}) }, // Paramètres de filtrage pour récupérer les données du bilan d'évolution
6365
height: { type: String, default: '400px' }, // Hauteur du graphique

frontend/src/modules/chasse/graph/graph_ice.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,24 @@
4343

4444
<script>
4545
import Highcharts from 'highcharts';
46+
import More from 'highcharts/highcharts-more';
4647
import exportingInit from 'highcharts/modules/exporting';
4748
import offlineExporting from 'highcharts/modules/offline-exporting';
49+
import { Chart as highcharts } from 'highcharts-vue';
4850
import { round } from '@/core/js/util/util.js';
4951
import { dataTxt, localisationTitle } from '../config/util.js';
5052
import { apiRequest } from '@/core/js/data/api.js';
5153
54+
// Initialise le module highcharts-more (nécessaire pour la série 'errorbar' utilisée dans ce graphique)
55+
More(Highcharts);
5256
// Initialise le module d'exportation de Highcharts (permet l'export PNG, PDF, etc. depuis le menu du graphique)
5357
exportingInit(Highcharts);
5458
// Initialise le module d'exportation hors-ligne de Highcharts (permet l'export même sans connexion internet)
5559
offlineExporting(Highcharts);
5660
5761
export default {
5862
name: 'graphChasseIce',
63+
components: { highcharts },
5964
props: {
6065
width: { default: '100%' },
6166
height: { default: '500px' },

frontend/src/modules/chasse/graph/graph_ice_points.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import Highcharts from 'highcharts';
4646
import exportingInit from 'highcharts/modules/exporting';
4747
import offlineExporting from 'highcharts/modules/offline-exporting';
48+
import { Chart as highcharts } from 'highcharts-vue';
4849
import { round } from '@/core/js/util/util.js';
4950
import { dataTxt, localisationTitle } from '../config/util.js';
5051
import { apiRequest } from '@/core/js/data/api.js';
@@ -56,6 +57,7 @@ offlineExporting(Highcharts);
5657
5758
export default {
5859
name: 'graphChasseIcePoints',
60+
components: { highcharts },
5961
props: {
6062
width: { default: '100%' },
6163
height: { default: '500px' },

frontend/src/modules/in/in-graph.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,20 @@
3535

3636
<script>
3737
import Highcharts from 'highcharts';
38+
import More from 'highcharts/highcharts-more';
3839
import exportingInit from 'highcharts/modules/exporting';
3940
import offlineExporting from 'highcharts/modules/offline-exporting';
41+
import { Chart as highcharts } from 'highcharts-vue';
4042
import chroma from 'chroma-js';
4143
import { round } from '@/core/js/util/util.js';
44+
// Initialise le module highcharts-more (nécessaire pour la série 'errorbar' utilisée dans ce graphique)
45+
More(Highcharts);
4246
exportingInit(Highcharts);
4347
offlineExporting(Highcharts);
4448
4549
export default {
4650
name: 'in-graph',
51+
components: { highcharts },
4752
props: [
4853
'displayTitle',
4954
'dataIn',

frontend/src/modules/restitution/restitution-graph.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,10 @@
1111

1212
<script>
1313
import Highcharts from 'highcharts';
14+
import { Chart as highcharts } from 'highcharts-vue';
1415
export default {
1516
name: 'restitution-graph',
17+
components: { highcharts },
1618
props: ['results'],
1719
data: () => ({
1820
chartOptions: null,

0 commit comments

Comments
 (0)