Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function prepareCharts(jobs, start, end, firstRun) {
if (firstRun) //if its the first run expect everything to not exist, and draw it all
{
facts = crossfilter(jobs.Results)
var all = facts.groupAll();
//display totals
countchart = dc.dataCount(".total");
// jobs per hour time chart
timeOpenChart = dc.barChart("#dc-timeopen-chart");
runningChart = dc.compositeChart("#dc-running-chart");
timeClosedChart = dc.barChart("#dc-timeclosed-chart");
dataTable = dc.dataTable("#dc-table-graph");
completionBellChart = dc.barChart("#dc-completionbell-chart");
var closeTimeDimension = facts.dimension(function(d) {
return d.JobCompleted;
});
var timeOpenDimension = facts.dimension(function(d) {
return d.JobReceivedFixed;
});
componentDidMount(){
this.chart = dc.compositeChart(this.chart)
this.configure()
this.chart.render()
}
}
$(function () {
var dateFormat = d3.time.format('%Y-%m-%d');
var parent = d3.select('[data-chart="transactions-overview"]');
//todo custom reduce functions for server-side stuff
var volumeChart = dc.barChart('#volume-chart');
var valueChart = dc.compositeChart('#value-chart');
var amountChart = dc.barChart(valueChart);
var cumAmountChart = dc.lineChart(valueChart);
var accountChart = dc.rowChart('#account-selector');
var typeChart = dc.rowChart('#account-type-selector');
var transactionTable = dc.dataTable('#transaction-table');
var transactionCount = dc.dataCount(".dc-data-count");
var params = (new URL(document.location)).searchParams;
var dateMin = dateFormat.parse(params.get('after'));
var dateMax = dateFormat.parse(params.get('before'));
$("#reset-all").click(function () {
dc.filterAll();
dc.renderAll();
return false;
});
$("#reset-volume-chart").click(function () {