未验证 提交 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 { ...@@ -521,6 +521,11 @@ export default {
type: 'time', type: 'time',
axisLabel: { axisLabel: {
fontSize: '11', 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, series: wallSeries,
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
</div> </div>
<v-radio-group <v-radio-group
label="Horizontal" label="X-Axis"
v-model="config.horizontal" v-model="config.horizontal"
dark> dark>
<v-radio <v-radio
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
label="Relative" label="Relative"
value="relative"/> value="relative"/>
<v-radio <v-radio
label="Wall" label="Wall Time"
value="wall"/> value="wall"/>
</v-radio-group> </v-radio-group>
......
...@@ -116,8 +116,8 @@ std::vector<T> ScalarReader<T>::records() const { ...@@ -116,8 +116,8 @@ std::vector<T> ScalarReader<T>::records() const {
} }
template <typename T> template <typename T>
std::vector<T> ScalarReader<T>::ids() const { std::vector<int> ScalarReader<T>::ids() const {
std::vector<T> res; std::vector<int> res;
for (int i = 0; i < reader_.total_records(); i++) { for (int i = 0; i < reader_.total_records(); i++) {
res.push_back(reader_.record(i).id()); res.push_back(reader_.record(i).id());
} }
...@@ -125,8 +125,8 @@ std::vector<T> ScalarReader<T>::ids() const { ...@@ -125,8 +125,8 @@ std::vector<T> ScalarReader<T>::ids() const {
} }
template <typename T> template <typename T>
std::vector<T> ScalarReader<T>::timestamps() const { std::vector<time_t> ScalarReader<T>::timestamps() const {
std::vector<T> res; std::vector<time_t> res;
for (int i = 0; i < reader_.total_records(); i++) { for (int i = 0; i < reader_.total_records(); i++) {
res.push_back(reader_.record(i).timestamp()); res.push_back(reader_.record(i).timestamp());
} }
......
...@@ -123,8 +123,8 @@ struct ScalarReader { ...@@ -123,8 +123,8 @@ struct ScalarReader {
ScalarReader(TabletReader&& reader) : reader_(reader) {} ScalarReader(TabletReader&& reader) : reader_(reader) {}
std::vector<T> records() const; std::vector<T> records() const;
std::vector<T> ids() const; std::vector<int> ids() const;
std::vector<T> timestamps() const; std::vector<time_t> timestamps() const;
std::string caption() const; std::string caption() const;
size_t total_records() const { return reader_.total_records(); } size_t total_records() const { return reader_.total_records(); }
size_t size() const; size_t size() const;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册