未验证 提交 274f4554 编写于 作者: J Jeff Wang 提交者: GitHub

Fix the bug where the scalar chart is not showing time wall properly. (#394)

* Fix the bug where the scalar chart is not showing time wall properly.

* Update Label to show wall time.
上级 9ad1e5a2
......@@ -521,6 +521,11 @@ export default {
type: 'time',
axisLabel: {
fontSize: '11',
formatter: function(value, index) {
// The value is in seconds, need to convert to milliseconds
let date = new Date(value * 1000);
return date.toLocaleTimeString();
},
},
},
series: wallSeries,
......
......@@ -20,7 +20,7 @@
</div>
<v-radio-group
label="Horizontal"
label="X-Axis"
v-model="config.horizontal"
dark>
<v-radio
......@@ -30,7 +30,7 @@
label="Relative"
value="relative"/>
<v-radio
label="Wall"
label="Wall Time"
value="wall"/>
</v-radio-group>
......
......@@ -116,8 +116,8 @@ std::vector<T> ScalarReader<T>::records() const {
}
template <typename T>
std::vector<T> ScalarReader<T>::ids() const {
std::vector<T> res;
std::vector<int> ScalarReader<T>::ids() const {
std::vector<int> res;
for (int i = 0; i < reader_.total_records(); i++) {
res.push_back(reader_.record(i).id());
}
......@@ -125,8 +125,8 @@ std::vector<T> ScalarReader<T>::ids() const {
}
template <typename T>
std::vector<T> ScalarReader<T>::timestamps() const {
std::vector<T> res;
std::vector<time_t> ScalarReader<T>::timestamps() const {
std::vector<time_t> res;
for (int i = 0; i < reader_.total_records(); i++) {
res.push_back(reader_.record(i).timestamp());
}
......
......@@ -123,8 +123,8 @@ struct ScalarReader {
ScalarReader(TabletReader&& reader) : reader_(reader) {}
std::vector<T> records() const;
std::vector<T> ids() const;
std::vector<T> timestamps() const;
std::vector<int> ids() const;
std::vector<time_t> timestamps() const;
std::string caption() const;
size_t total_records() const { return reader_.total_records(); }
size_t size() const;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册