You are not logged in.
Pages: 1
Hi all,
I recently try to do a balloon text on value axis of serial chart, it does not show when i hover over the line, but it did show on the category axis. Is there someway to make it also work on value axis or is that expected? Also is there a way to put the guide in front of a bar chart? That will be a good use to show an average of the values.
The code i used:
var chartData = [
{ "step": '50',"value": "3.3"},
{ "step": '100', "value": "3.4"},
{ "step": '150', "value": "3.5"},
{ "step": '250', "value": "2.1"},
{ "step": '300', "value": "2.7"},
{ "step": '320', "value": "4.6"},
{ "step": '340', "value": "3.4"},
{ "step": '360', "value": "2.9"},
{ "step": '380', "value": "3.2"},
];
var chart = new AmCharts.AmSerialChart();
chart = new AmCharts.AmSerialChart();
chart.dataProvider = chartData;
chart.categoryField = "step";
chart.pathToImages = 'assets/';
var valAxis = new AmCharts.ValueAxis();
chart.addValueAxis(valAxis);
var graph = new AmCharts.AmGraph();
graph.valueAxis = valAxis;
graph.valueField = "value";
graph.type = "smoothedLine";
graph.bullet = "round";
graph.title = 'test';
chart.addGraph(graph);
var guide = {};
guide.value = 3.3;
guide.category = '50'
guide.label = 'test label';
guide.balloonText = 'test description';
guide.fillColor = '#FF0000';
guide.lineColor = '#FF0000';
guide.inside = true;
chart.categoryAxis.addGuide(guide);
valAxis.addGuide(guide)
chart.write('tmp')Last edited by elimsam (2012-07-05 00:25:55)
Offline
Horizontal cursor and value axis balloons are not supported, I'm afraid.
Guides are always drawn behind the graphs. If you want a line going on top of graphs you can use either trend line or a regular straight line graph.
I hope this answers your question.
Offline
Thanks for the reply.
Just got another question regarding the guide, is there a way to move the label on horizontal guide to the right, instead of on the left?
Offline
Yes, but you will need to attach it to the right axis. If you don't have any axis on the right you will need to add that as well (also sync it with the left axis so the scale is the same)
Offline
Pages: 1
© amCharts | Forum engine: PunBB