amCharts support forum

You are not logged in.

Announcement

FORUM CLOSED! This forum is closed. We moved to a new place at Zendesk. Update your bookmarks.

Flash Charts: Flash Charts Bundle


#1 2012-03-15 19:50:14

jdonigan
Member

How to send bullet types and text with the data?

I want each bullet to have a unique combination of color and bullet type.

This is my code:

Code:

            var chartData = [
            // scatter points            
             {
                name: "Fred",
                x: 96,
                y: 78,
                color: "#FF0F00",
                bullet: "triangleUp"
            }, {
                name: "Ralph",
                x: 35,
                y: 50,
                color: "#FF6600",
                bullet: "triangleDown"
            }, {
(etc.)
...
        for (var i = 0; i < chartData.length; i++){
                    var graph1 = new AmCharts.AmGraph();
                    graph1.colorField = "color"; // color works
                    graph1.balloonText = "[[name]] x:[[x]] y:[[y]]"; // name does not appear, x and y do
                    graph1.xField = "x";
                    graph1.yField = "y";
                    graph1.lineAlpha = 0;
                    graph1.bullet = "bullet"; // I only get a graph if I set bullet to "bubble", etc. here. 
                    // then all of my bullets are the same type                                             
                    chart.addGraph(graph1);
                }

What am I doing wrong, and how can I get a legend of the names and bullets?

Thanks,

John

Offline

 

#2 2012-03-16 02:20:13

martynasma
Administrator

Re: How to send bullet types and text with the data?

You need to tell graph which field in your data is holding bullet:

graph1.bulletField = "bullet";

The legend does not support graph bullets though.

Offline

 

#3 2012-03-16 07:58:26

jdonigan
Member

Re: How to send bullet types and text with the data?

Thanks!

How can I get the name to appear?

John

Offline

 

#4 2012-03-17 15:38:58

martynasma
Administrator

Re: How to send bullet types and text with the data?

Use descriptionField for that:

Code:

graph.descriptionField = "name";
graph.balloonText = "[[description]]  x:[[x]] y:[[y]]";

Offline

 

#5 2012-03-22 11:12:44

jdonigan
Member

Re: How to send bullet types and text with the data?

Thank you.



John

Offline

 

© amCharts | Forum engine: PunBB