Log in
Sign Up
|
|
风流的足球 · 如何将图像转换为zpl代码,以便使用斑马打印 ...· 1 年前 · |
|
|
潇洒的猴子 · GitHub热榜登顶:开源代码解释器,可装任 ...· 1 年前 · |
|
|
坏坏的羽毛球 · 调用DIV+CSS实现模拟表格对角线-汇编div· 2 年前 · |
|
|
大力的围巾 · 陆奇最新演讲高清PPT下载;AI ...· 2 年前 · |
Highcharts DateTime format on X-axis
Hello everyone,
I've got a question regarding the highcharts implementation in Oustystems.
I am trying to implement a chart using DateTime on the X-axis as seen below.
I would like to format the time so that only the years are shown so: [2017,2018,2019,2020,2021]
The data used look like this:
It seems like highcharts does not like the dateformat of outsystems and it somehow needs to be converted.
Is there any information available about the interaction between highcharts and Outsystems?
Thanks in advance! Let me know if more information is needed
Hi Bradley,
You will need to add formatting to the AdvancedFormat , something like in this post where a similar problem was raised and issued.
You can format the date using the following formats to build the date you need:
Kind Regards,
João
Hi Bradley,
Please refer below link for various formatting options available for high charts. In your case try to apply the formatting in X-axis JSON.
https://api.highcharts.com/highcharts/xAxis.dateTimeLabelFormats
Regards,
Saravanan Santhanam.
Hi Bradley,
besides the question of how you would format datetime, what do you mean when you only want to show the year ? Do you only want 1 datapoint per year, or do you want many datapoints per year, but all of them only showing the year value ???
If you only want one datapoint per year, you'll have to run an aggregation function on your aggregate or SQL widget. In that case, you can just add a calculated column for the year, group by that column and then whatever aggregation function (min ? max ? average? ) that you want on your value. So in that case, no hassle with datetime formatting at all.
Dorine
Thanks for the replies!
I got it partially working. I was able to format the date to years only using the following snippet:
" xAxis: { type: 'datetime', title: { text: 'Date Range' labels: { formatter: function() { return Highcharts.dateFormat('%e', this.value); }"The next step would be to only show one year of each. This is the result at the moment:
I would like to get something like this:
I think it has something to do with the tickAmount, but Im not quite sure.
Thanks in advance!