Skip to content

Commit

Permalink
Adding a dummy datamap
Browse files Browse the repository at this point in the history
  • Loading branch information
thehoneymad committed Apr 7, 2017
1 parent 7239349 commit e0c458e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/app/data/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class DataService {
}

// INFO: Temporary test method to test out how a widget could have behaved.
getSampleWidgetConfig(): WidgetConfig {
getSampleWidgetConfig(): any {
// INLINE query, these needs to be saved in the database of course
let aggDocument: any = {
'aggregate': [
Expand Down Expand Up @@ -131,7 +131,19 @@ export class DataService {
query: aggDocument,
connectionId: connectionId,
collectionName: collectionName,
type: 'bar-chart'
type: 'bar-chart',
datamap: {
'labels': {
path: 'entry._id.CreateDate.$date', // Can be JSONPath?
type: 'datestring',
},
'datasets': [
{
label: 'Orders',
path: 'count'
}
]
}
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export class WidgetLayoutComponent implements OnInit {
if (result) {
// Need to parse this crap here
let res: any[] = result;
console.log(res);
for (let entry of res) {
barChartLabels.push(new Date(entry._id.CreateDate.$date).toDateString());
jobCountArray.push(entry.count);
Expand Down

0 comments on commit e0c458e

Please sign in to comment.