Line chart: rotate labels & add events

New version of line & area chart can have rotated by any degree labels, the same as column chart. Here is tutorial how to use rotated texts.

Another new feature is that you can have "events" on your line charts. You can achieve it only if you use XML data type. Check examples/amline/amline1/amline_data.xml file – event starts on xid="30" and ends on xid="38". If you open amline1.html in examples folder you will see that area between 1980 and 1988 is darker. And you even can click on it and get description of this event. You can use events for showing weekends, and a lot of other things.

To start event, you have to add attribute to xaxis value:

event_start="some event"

To end event, you have to add attribute  to x axis value:

event_end="some event"

Next, you have to set background color of the event by adding attribute:

event_color="#000000"

This may be enough. By default, event background alpha is 20. You can change it:

event_alpha="50"

If you add description to your event:

event_description="some text here"

The event will be clickable and popup will open when someone clicks your event. Background color of your popup will be the same as event background color, it will be not transparent (alpha=100).

By default, text color of popup is white, you can change it too:

event_text_color="some text here"

One Response to “Line chart: rotate labels & add events”

  1. Palawan says:

    This is awesome! Thanks so much. I’ll put an order soon.

    -P