gpt4 book ai didi

javascript - amcharts 自定义周期日期

转载 作者:行者123 更新时间:2023-11-29 19:39:24 26 4
gpt4 key购买 nike

AmCharts 有一些默认的日期格式:

[{period:'fff',format:'JJ:NN:SS'},
{period:'ss',format:'JJ:NN:SS'},
{period:'mm',format:'JJ:NN'},
{period:'hh',format:'JJ:NN'},
{period:'DD',format:'MMM DD'},
{period:'WW',format:'MMM DD'},
{period:'MM',format:'MMM'},
{period:'YYYY',format:'YYYY'}]

我可以像下面的示例一样使用 categoryAxis.minPeriod = "DD";

categoryAxis = chart.categoryAxis;
categoryAxis.gridAlpha = 0.00;
categoryAxis.axisAlpha = 0.30;
categoryAxis.inside = false;
categoryAxis.gridPosition = "start";
categoryAxis.title = gon.graph_info.horizontal_label
categoryAxis.parseDates = true
categoryAxis.minPeriod = "DD";

但我想定义或使用格式为四个星期六个月等的句点,我可以像下面这样写

categoryAxis = chart.categoryAxis;
categoryAxis.gridAlpha = 0.00;
categoryAxis.axisAlpha = 0.30;
categoryAxis.inside = false;
categoryAxis.gridPosition = "start";
categoryAxis.title = gon.graph_info.horizontal_label
categoryAxis.parseDates = true
categoryAxis.minPeriod = "TOW_MONTHS";

最佳答案

查看文档,这应该可以通过类别轴的 minPeriod 属性来实现。参见 http://docs.amcharts.com/javascriptcharts/CategoryAxis#minPeriod

It's also possible to supply a number for increments, i.e. "15mm" which will instruct the chart that your data is supplied in 15 minute increments.

如果是两个月的话,应该是2MM

关于javascript - amcharts 自定义周期日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23936527/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com