27 lines
629 B
JavaScript
27 lines
629 B
JavaScript
import Chart from "../core.js";
|
|
import { name, schema } from "./entities/test-grouped.js";
|
|
/**
|
|
* For testing
|
|
*/ export default class TestGroupedChart extends Chart {
|
|
total = {};
|
|
constructor(){
|
|
super(name, schema, true);
|
|
}
|
|
async tickMajor(group) {
|
|
return {
|
|
"foo.total": this.total[group]
|
|
};
|
|
}
|
|
async tickMinor() {
|
|
return {};
|
|
}
|
|
async increment(group) {
|
|
if (this.total[group] == null) this.total[group] = 0;
|
|
this.total[group]++;
|
|
await this.commit({
|
|
"foo.total": 1,
|
|
"foo.inc": 1
|
|
}, group);
|
|
}
|
|
}
|