Add bar charts for non-timeseries data. For example, a bar chart of the top 10 uploaders overall in the last month, rather than a timeseries chart of the number of uploads per day for the last month.
16 lines
465 B
JavaScript
16 lines
465 B
JavaScript
import * as echarts from "echarts";
|
|
import CurrentUser from "./current_user.js";
|
|
|
|
export default class TimeSeriesComponent {
|
|
constructor({ container = null, options = {} } = {}) {
|
|
this.container = container;
|
|
this.options = options;
|
|
this.theme = CurrentUser.darkMode() ? "dark" : null;
|
|
|
|
this.chart = echarts.init(container, this.theme);
|
|
this.chart.setOption(this.options);
|
|
|
|
$(window).on("resize.danbooru", () => this.chart.resize());
|
|
}
|
|
}
|