[英]amcharts custom period date
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
也可以提供一個增量數字,即“ 15mm”,它將指示圖表以15分鍾為增量提供數據。
在兩個月的情況下,應該是2MM
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.