我想在石墨/格拉纳那上制作一个条形图,一周内每天有一条条形图.理想情况下,我们将在x轴标签上显示星期几(星期一,星期二...等),然后在图表中显示七个条形图,一周中的每一天一个.我似乎根本无法更改X轴.
I would like to have a bar graph in graphite/grafana that has a single bar per day, over the week. Ideally we would have the days of the week (Monday,Tuesday...etc) on the x axis labels, and then seven bars in the graph, one for each day of the week. I can't seem to change the X axis at all though.
思路: 我可以烹饪时间数据,并从纪元值开始将其发送固定时间,但这会导致grafana页面上的条形非常细.我可以编写一个脚本,以从代表整个一天的纪元值开始,以秒为单位发送大量指标,以使日常条形看起来很像,但这仍然无济于事,我无法更改x轴标签,而且看起来很可怕使用此工具的方式.
Thoughts: I could cook the time data, and send it a fixed time since epoch value, but this results in a very thin bar on the grafana page. I could write a script to send a huge amount of metrics with seconds since epoch values representing the entire day in order to make the semblance of a daily bar, but that still doesn't help me change x-axis labels and seems like a horrible way to use this tool.
这甚至可以用石墨来完成,还是严格关注实时图?
Can this even be done with graphite, or is it strictly focused on real time graphs?
推荐答案尝试使用Graphite summarize()函数.在Grafana中,添加Graphite指标时,可以在转换"功能下找到它.使用"1d"按天进行汇总.
Try using the Graphite summarize() function. In Grafana you can find it under the "transform" functions when adding a Graphite metric. Use "1d" for aggregating by day.
然后转到显示样式",然后仅选中条形"复选框以获取条形图.
Then go to "Display Styles" and check only the "Bars" checkbox to get the bar plot.
但这不会在X轴上为您提供漂亮的Mo-Su标签.
This won't give you nice Mo-Su labels in the X axis though.
更多推荐
如何更改Graphite/Grafana中的x轴(按天绘制)?
发布评论