Files
danbooru/app/javascript/src/javascripts/time_series_component.js
evazion 203067b5ed reports: add non-timeseries charts.
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.
2022-10-23 04:42:51 -05:00

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());
}
}