Skip to content
Snippets Groups Projects
Commit 78625c47 authored by Benjamin Bellamy's avatar Benjamin Bellamy :speech_balloon:
Browse files

feat(analytics): add charts and data export

parent 112a71d8
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,9 @@ const drawPieChart = (chartDivId: string, dataUrl: string | null): void => { ...@@ -9,6 +9,9 @@ const drawPieChart = (chartDivId: string, dataUrl: string | null): void => {
// Create chart instance // Create chart instance
const chart = am4core.create(chartDivId, am4charts.PieChart); const chart = am4core.create(chartDivId, am4charts.PieChart);
am4core.percent(100); am4core.percent(100);
chart.exporting.menu = new am4core.ExportMenu();
chart.exporting.menu.align = "left";
chart.exporting.menu.verticalAlign = "top";
// Set theme // Set theme
am4core.useTheme(am4themes_material); am4core.useTheme(am4themes_material);
chart.innerRadius = am4core.percent(10); chart.innerRadius = am4core.percent(10);
...@@ -33,6 +36,9 @@ const drawXYChart = (chartDivId: string, dataUrl: string | null): void => { ...@@ -33,6 +36,9 @@ const drawXYChart = (chartDivId: string, dataUrl: string | null): void => {
// Create chart instance // Create chart instance
const chart = am4core.create(chartDivId, am4charts.XYChart); const chart = am4core.create(chartDivId, am4charts.XYChart);
am4core.percent(100); am4core.percent(100);
chart.exporting.menu = new am4core.ExportMenu();
chart.exporting.menu.align = "right";
chart.exporting.menu.verticalAlign = "bottom";
// Set theme // Set theme
am4core.useTheme(am4themes_material); am4core.useTheme(am4themes_material);
// Create axes // Create axes
...@@ -66,6 +72,9 @@ const drawXYDurationChart = (chartDivId: string, dataUrl: string | null): void = ...@@ -66,6 +72,9 @@ const drawXYDurationChart = (chartDivId: string, dataUrl: string | null): void =
// Create chart instance // Create chart instance
const chart = am4core.create(chartDivId, am4charts.XYChart); const chart = am4core.create(chartDivId, am4charts.XYChart);
am4core.percent(100); am4core.percent(100);
chart.exporting.menu = new am4core.ExportMenu();
chart.exporting.menu.align = "right";
chart.exporting.menu.verticalAlign = "bottom";
// Set theme // Set theme
am4core.useTheme(am4themes_material); am4core.useTheme(am4themes_material);
// Create axes // Create axes
...@@ -104,6 +113,9 @@ const drawXYSeriesChart = ( ...@@ -104,6 +113,9 @@ const drawXYSeriesChart = (
// Create chart instance // Create chart instance
const chart = am4core.create(chartDivId, am4charts.XYChart); const chart = am4core.create(chartDivId, am4charts.XYChart);
am4core.percent(100); am4core.percent(100);
chart.exporting.menu = new am4core.ExportMenu();
chart.exporting.menu.align = "right";
chart.exporting.menu.verticalAlign = "bottom";
// Set theme // Set theme
am4core.useTheme(am4themes_material); am4core.useTheme(am4themes_material);
// Create axes // Create axes
...@@ -134,6 +146,9 @@ const drawMapChart = (chartDivId: string, dataUrl: string | null): void => { ...@@ -134,6 +146,9 @@ const drawMapChart = (chartDivId: string, dataUrl: string | null): void => {
// Create map instance // Create map instance
const chart = am4core.create(chartDivId, am4maps.MapChart); const chart = am4core.create(chartDivId, am4maps.MapChart);
am4core.percent(100); am4core.percent(100);
chart.exporting.menu = new am4core.ExportMenu();
chart.exporting.menu.align = "left";
chart.exporting.menu.verticalAlign = "top";
// Set theme // Set theme
am4core.useTheme(am4themes_material); am4core.useTheme(am4themes_material);
// Set map definition // Set map definition
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment