Archive for August, 2007

Column chart 1.2.0 - rotate axes’ labels by any degree

Monday, August 6th, 2007

A lot of people requested this feature, and finally I found an easy way to do it. here is the example:

http://www.amcharts.com/column/

In this example x axis labels are rotated by 45 degrees - this increases readability.

The only thing which has changed in settings file is that now, instead of “true” or “false” you can set degrees for “rotate” value:

<values>
   <category>
     <rotate>45</rotated>

“true” will work as 90, so you don’t need to change anything if you want to keep old behavior.

How everything works:

If the rotation degree is not 0 or 90, chart will look for a font_name.swf in your path/fonts/ folder (notice that this folder is in the package now, all file names must be in lowercase). I added four most popular fonts: Arial, Tahoma, Garamond, Times New Roman. This means, that if you are using different font, you must create new swf yourself.

The swf files embedded in the package has only standard Latin letters, numbers and punctuation embedded. If you want to use Cyrillic, Japanese or any other special characters, you must create a new swf file with all  required symbols embedded.

Creating your font swf file
1. Open arial.fla file
2. Double click on the square movie on the stage, select text field inside this movie
3. You must see the following picture (click to enlarge):

4. Click on font field (1) and select your desired font
5. click on Embed button (2) and select which characters to embed
6. save the file, with the same as your font name and publish it
7. do not forget to upload the swf file to your path/fonts folder on the web

That’s it!

I will add the same features to Line and XY chart soon.

Regards,

Antanas

Pass new data file name when reloading data with JavaScript

Wednesday, August 1st, 2007

Today I updated all charts with some small but very important feature. Now, when you trigger data (or settings) reload with JavaScript, you can pass new file name to flash chart. Indeed this can be the same name with some different parameters passed.

Why this is important? Image, you have  a web page with a chart and with some forms where user can select something and click “generate chart” button. Before this function you had to reload the page or feed the chart with setData() function, which is not always comfortable.  Now, when user clicks on “generate chart” button you can call reload data function and pass parameters selected by user. Generally this will look like this:

reloadData(”data_generator_file.php?param1=10&param2=20″)

When you data generator will return new data, generated according to parameters passed.