UX: USe bar chart for admin search logs details page.
A bar chart is better when comparing the values across the X axis.
This commit is contained in:
parent
f458cba4cb
commit
e2ad374e5b
|
@ -3,6 +3,8 @@ import { number } from "discourse/lib/formatter";
|
||||||
|
|
||||||
export default Ember.Component.extend({
|
export default Ember.Component.extend({
|
||||||
tagName: "canvas",
|
tagName: "canvas",
|
||||||
|
type: "line",
|
||||||
|
|
||||||
refreshChart() {
|
refreshChart() {
|
||||||
const ctx = this.$()[0].getContext("2d");
|
const ctx = this.$()[0].getContext("2d");
|
||||||
const model = this.get("model");
|
const model = this.get("model");
|
||||||
|
@ -14,14 +16,16 @@ export default Ember.Component.extend({
|
||||||
{
|
{
|
||||||
data: rawData.map(r => r.y),
|
data: rawData.map(r => r.y),
|
||||||
label: model.get("title"),
|
label: model.get("title"),
|
||||||
backgroundColor: "rgba(200,220,240,0.3)",
|
backgroundColor: `rgba(200,220,240,${
|
||||||
|
this.get("type") === "bar" ? 1 : 0.3
|
||||||
|
})`,
|
||||||
borderColor: "#08C"
|
borderColor: "#08C"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
type: "line",
|
type: this.get("type"),
|
||||||
data: data,
|
data: data,
|
||||||
options: {
|
options: {
|
||||||
responsive: true,
|
responsive: true,
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
</h2>
|
</h2>
|
||||||
|
|
||||||
{{#conditional-loading-spinner condition=refreshing}}
|
{{#conditional-loading-spinner condition=refreshing}}
|
||||||
{{admin-graph model=model}}
|
{{admin-graph model=model type="bar"}}
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
<h2> {{i18n "admin.logs.search_logs.header_search_results"}} </h2>
|
<h2> {{i18n "admin.logs.search_logs.header_search_results"}} </h2>
|
||||||
|
|
Loading…
Reference in New Issue