Saving exported image on a server

Type tutorial

IMPORTANT NOTICE! The information provided in this article is deprecated. The export scripts, described in this tutorial were replaced by a better alternative since version 3.14. Please refer to this tutorial for further information. Instead of offering the user to save the image to his hard drive, you might want it to be saved on […]

Displaying bullets on specified points only

Type tutorial

In some cases you might need to show bullet only at a specific data point, not all of them. Or you might need to have  a different from default bullet for some points. To do this, you should first add bullet field in your data provider, for example: var chartData = [{ “date”: “2009-10-26”, “value”: […]

Interacting between JavaScript Charts and JavaScript Maps

Type tutorial

Say, you have a map on your page. Perfect. Now you want to add a little chart. Easy. Finally you want the chart to go over the map, and, to further complicate things, want the chart to update it’s data when user clicks particular countries on the map. It may be easier than you think. […]

Working with Stock Chart as with Serial chart (important!)

Type tutorial

Our Stock chart can display multiple StockPanels. And Stock Panel inherits all properties and methods of AmSerialChart. This means that pretty much everything you can do with serial chart – add multiple value axes, guides, trend lines, you can also do with Stock panel. Same is with StockGraph – as it extends AmGraph, it can […]

User defined min/max values of Value Axis

Type tutorial

You can use minimum and maximum properties of ValueAxis to set starting and ending value for your value axis. However, those are just “suggestions”. The chart will always struggle to adjust the scale of the value axis so that it displays “pretty” starting and ending values, as well as nice intermediate steps. So if you set, say, the scale […]

Combined stacked line/area graphs with non-stacked ones

Type tutorial

To prevent the line graph from stacking with another graphs on a stacked line/area chart, just set its stackable property to false. I.e.: graph.stackable = false; The above works for both regular JavaScript Charts and JavaScript Stock Charts.

Resizing chart for print

Type tutorial

Usually browsers use different resolution when printing web pages. If you have charts that are wider than ~600-700 pixels, they will print as cropped. To overcome this, use the following code to make the charts redraw using new dimensions before the page is printed: (function() { var beforePrint = function() { for(var i = 0; […]

Adding multiple value axis to a Stock Charts panel

Type tutorial

In Stock chart, each StockPanel is an instance of AmSerialChart. So you can add ValueAxis objects to it like you would normally add to a regular chart. Each StockGraph is an instance os AmGraph so it has valueAxis property. So adding multiple value axes to a stock panel is just like adding them to a […]

Putting a legend outside the chart area

Type tutorial

Chart legend is a great visual tool that makes charts event more usable and easy to comprehend. However, sometimes it’s size gets unpredictable. If there are a lot of items in the legend, the actual chart gets shrunk in order to accommodate space for the legend. This may lead to unattractive situations like this: Ain’t […]