Hi guys, I’m exploring ChartFactor Studio, and I’m building a dashboard which contains a Disk visualization. It turns out that this Disk is being rendered from the values of a column called for example start_hour
. Now, this column is represented in 24-hour format, from 00 to 23. I’ve been looking at the Disk’s documentation and I know that it supports 12-hour formats. My question is, how can I achieve that, so that the Disk can show the time in 12 hour format when the tooltip is displayed, without having to create a new field in my database that contains the time in that format?
This is the sample code for the disk:
let provider = cf.provider("My Provider");
let source = provider.source("my-source");
let metric0 = cf.Metric("profits", "sum");
let group1 = cf.Attribute("start_hour")
.limit(24)
.sort("asc", "start_hour");
let myData = source.groupby(group1).metrics(metric0);
let color = cf.Color().palette([
"#4575b4", "#74add1", "#abd9e9",
"#e0f3f8", "#ffffbf", "#fee090",
"#fdae61", "#f46d43", "#d73027",
"#a50026"
]);
let myChart = myData.graph("Disk").set("color", color).execute();
Any help would be appreciated!