-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature/apex_charts' into develop
- Loading branch information
Showing
20 changed files
with
612 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
{% extends "slick_reporting/report.html" %} | ||
{% load i18n slick_reporting_tags %} | ||
|
||
{% block content %} | ||
{{ block.super }} | ||
|
||
{% endblock %} | ||
|
||
{% block extrajs %} | ||
{{ block.super }} | ||
|
||
<script> | ||
|
||
let chart = null; | ||
function displayChartCustomEntryPoint(data, $elem, chartOptions) { | ||
alert("This is a custom entry point for displaying charts. " + | ||
"Check the console for the sent arguments") | ||
console.log("data:", data); | ||
console.log("$elem:", $elem); | ||
console.log("chartOptions:", chartOptions); | ||
|
||
} | ||
|
||
function DisplayApexPieChart(data, $elem, chartOptions) { | ||
let legendAndSeries = $.slick_reporting.chartsjs.getGroupByLabelAndSeries(data, chartOptions); | ||
let options = {} | ||
if (chartOptions.type === "pie") { | ||
options = { | ||
series: legendAndSeries.series, | ||
chart: { | ||
type: "pie", | ||
height: 350 | ||
}, | ||
labels: legendAndSeries.labels, | ||
}; | ||
} else { | ||
options = { | ||
chart: { | ||
type: 'bar' | ||
}, | ||
series: [{ | ||
name: 'Sales', | ||
data: legendAndSeries.series | ||
}], | ||
xaxis: { | ||
categories: legendAndSeries.labels, | ||
} | ||
} | ||
} | ||
|
||
try { | ||
// destroy old chart, if any | ||
chart.destroy(); | ||
} catch (e) { | ||
// do nothing | ||
} | ||
|
||
chart = new ApexCharts($elem[0], options); | ||
chart.render(); | ||
|
||
} | ||
</script> | ||
|
||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.