Archive for August, 2007

Line chart is SCROLLABLE now!

Friday, August 24th, 2007

New line chart can be scrolled now! Check this example:

http://www.amcharts.com/line/

Zoom the chart by selecting any area and you will notice that scrollbar above the plot area appeared.

Or this one:

http://www.amcharts.com/line/chart-with-scroller/

The chart shows scrollbar at once. This is done by setting zoom period with JavaScript.

Most of other examples have scroller too.

By default, scrollbar is turned on. You can disable it, change colors, alphas, height and y position in settings file. A new group of settings appeared:

<scroller>
   <enabled>true</enabled>
   <y></y>
   <color>#DADADA</color>
   <alpha>100</alpha>
   <bg_color>#FFFFFF</bg_color>
   <bg_alpha>100</bg_alpha>
   <height>10</height>
</scroller>

Line chart can display vertical lines

Friday, August 24th, 2007

Line chart now can display vertical lines. Check this example:

http://www.amcharts.com/line/chart-with-scroller/

To enable vertical lines, you have to set

<graph>
   <vertical_lines>true</vertical_lines>

If you want only these lines to be shown, without the graph line, set:

  <line_alpha>0</line_alpha>

Broadcast messages from data file to chart

Friday, August 24th, 2007

Line chart v. 1.2.6 has a possibility to broadcast any message from data xml file to chart. This message will be displayed in a popup. It is very simple to do this:

<chart>
   …
   <message>
      <![CDATA[Broadcast any message to chart from data XML file]]>
   </message>
   …
</chart>

You can use this feature to set show custom  messages.

Display values in the legend

Thursday, August 23rd, 2007

Line chart v 1.2.5 has a great new feature - you can display values in the legend. Check this example and try to move your mouse over the plot area.

http://www.amcharts.com/line/

Here are all possible settings for values in the legend:

<legend>
……
   <values>
      <enabled>true</enabled>
      <width></width>
      <align></align>
      <unit></unit>
      <unit_position></unit_position>
       <text><![CDATA[{value}]]></text>
   </values>
……
</legend>

Update:
instead of setting unit and unit position now you can format value useing HTML. This allows you to  display {description}, {series}, {percents} in the legend too.

<unit> and <unit_position> will work too.

One balloon at a time

Wednesday, August 22nd, 2007

New version of line & area chart has a possibility to set that only one y balloon at a time is visible. This will allow to avoid balloon overlapping when graphs are close to each other. Check this example:

http://www.amcharts.com/line/chart-with-scroller/

This is done by setting

<indicator>
   ……
   <one_y_balloon>true</one_y_balloon>

Regards,

Antanas

Split your settings into several files

Wednesday, August 22nd, 2007

With line & area chart v 1.2.3 you can split your settings into as many different files as you need. You may have one settings file for settings like background, plot area and similar and another file for graph settings. Another example:

Imagine you have several identical charts, only some labels are different. Now you can have one settings file for all the charts and three additional files for every chart labels.

All you need to do is to set several files, separated by commas:

so.addVariable("settings_file", escape("amline/amline_settings1.xml,amline/amline_settings2.xml"));

There is one more variable which you can pass:

so.addVariable("additional_chart_settings", "<settings>..</settings>");

Settings, passed with this variable will be appended to loaded or set with chart_settings variable.

This feature will be added to other charts soon.

Download line & area chart

Find out when chart is build

Monday, August 20th, 2007

All charts, after they load data and display chart now call amChartInited(chart_id) function. This will help you to find out when chart is build. Check js_example.html files for better understanding.

Pass settings as a string from HTML

Monday, August 20th, 2007

Instead of loading settings from a file now you can pass them as a string directly from HTML. This is done exactly the same as setting data from HTML:

so.addVariable(”chart_settings”, “<settings>…</settings>”);

Check amline7.html, amcolumn7.html or ampie2.html for better understanding.

Line chart: set which x axis labels to display

Wednesday, August 15th, 2007

A lot of people requested this feature, so I added it in v 1.2.0. You can set which x axis labels you want to display on x axis. This is done by adding show=”true” attribute to x axis value which you want to be displayed:

<value xid=”29″ show=”true”>1979</value>

Now the 1979 will be visible on x axis even if you will disable x axis values.

Line chart: rotate labels & add events

Wednesday, August 15th, 2007

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"