Xplora
Xplora

Reputation: 905

How to format Dates on Category Axis in amCharts Line Chart?

amCharts Line Chart

When amCharts line chart is zoomed around end of the year, it hides the letter Jan and places the number for Year. [Please refer JSFiddle in the comment below]

Requirement is to have Date format similar to: Nov 2014, Dec 2014, Jan 2015, Feb 2015.

In other words:

How to format Dates on Category Axis similar to below?

enter image description here

OR

enter image description here

Upvotes: 0

Views: 1426

Answers (2)

gerric
gerric

Reputation: 2297

As i'm not allowed to comment other posts yet, i'm posting the JSFiddle i made here.
Note that the answer of Anurag is the correct answer already, so the credits belong to him.

I used the dateFormat (as anurag mentioned in his comment) to format the displayed date on the categoryAxis. (see docs)
Further i didn't used the "boldPeriodBeginning" because it's already set false by "markPeriodChange".

Upvotes: 1

Anurag
Anurag

Reputation: 128

Add these two lines in the properties of the categoryAxis.

"boldPeriodBeginning":false,
"markPeriodChange":false,

This should get you the desired solution.

Upvotes: 4

Related Questions