【发布时间】:2016-03-18 16:37:29
【问题描述】:
查看 amCharts 中的图像。我只想显示 Jan、Feb、Mar 等月份的短名称。而不是像 Jan 那样显示一年中的第一个月,而是显示 2016 年......请参阅突出显示的部分:
AmCharts.makeChart("MonthlySaleChart",
{
"type": "serial",
"categoryField": "date",
"dataDateFormat": "YYYY-MM",
"theme": "default",
"categoryAxis": {
"minPeriod": "MM",
"parseDates": true
},
"chartCursor": {
"categoryBalloonDateFormat": "MMM YYYY"
},
"chartScrollbar": {},
"trendLines": [],
"graphs": [
{
"bullet": "round",
"id": "AmGraph-1",
"title": "This Year",
"valueField": "ThisMonth"
},
{
"bullet": "square",
"id": "AmGraph-2",
"title": "Last Year",
"valueField": "LastMonth"
}
],
"guides": [],
"valueAxes": [
{
"id": "ValueAxis-1",
"title": "Sales in Thousands (000)"
}
],
"allLabels": [],
"balloon": {},
"legend": {
"useGraphSettings": true
},
"titles": [
{
"color": "#20C5AE",
"id": "Title-1",
"size": 15,
"text": "SALES By Month"
}
],
"dataProvider": data
}
);
【问题讨论】:
-
请提供更多信息,说明您目前所做的工作。您尝试过什么,结果如何?
-
我只为char提供了三个值,一个是日期,另外两个是一些整数。我只想要系列中的月份短名称,但显示 2016 而不是“jan”。
-
我的图表显示 1 月的第一个月,如 2016 或 2015 。我只是希望它显示简单的 jan 像 feb 或 mar
-
您能发布您的代码吗?
-
我贴了代码看看你能不能帮忙
标签: javascript charts amcharts