Skip to content

Instantly share code, notes, and snippets.

@jtsoi
Created December 16, 2013 15:55
Show Gist options
  • Save jtsoi/7989326 to your computer and use it in GitHub Desktop.
Save jtsoi/7989326 to your computer and use it in GitHub Desktop.
Code to show extra counters in Admin view
require(["admin/plugins/charts/charts", "admin/models/store"], function(charts, storeModel){
$(".bar-chart").remove();
var storeId = storeModel.get('id');
var barChartOptions = [
{
row: 0,
storeId: storeId,
eventId: 1,
metricName: "integration",
dataUrl: "/analytics/v1/time-range/",
title: "Product check sync"
},
{
row: 0,
storeId: storeId,
eventId: 2,
metricName: "integration",
dataUrl: "/analytics/v1/time-range/",
title: "Valid product sync"
},
{
row: 1,
storeId: storeId,
eventId: 3,
metricName: "integration",
dataUrl: "/analytics/v1/time-range/",
title: "Product check async"
},
{
row: 1,
storeId: storeId,
eventId: 4,
metricName: "integration",
dataUrl: "/analytics/v1/time-range/",
title: "Valid product async"
}
];
_(barChartOptions).each(function(options){
$('.stats-row').eq(options.row).append(new charts.BarChart(options).el);
}, this);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment