Thanks for the response. I was finally able to get the coloring
behaviour which i needed by setting up the DataTable using the
following sample code. But now the width of the columns/bars displayed
in the column chart has become very thin. This is perhaps because I am
setting three columns for displaying the values. But in reality I
would be using only one columns for representing each year's data in
the chart (you can find it in the sample code below). I analysed the
html generated by visualization API to render the chart and found that
the width of the columns was set to width="2" instead of the earlier
width="8". If I manually edit the width in the html and make it to
width="8" through an html editing tool, the width of the bar is shown
as expected. Is there a way to adjust the width of the columns/bars
through the visualization API? or can you tell me the name of the
underlying property/attribute used to render the column/bar width so
that I can write jsni code to set this property/attribute so that the
width of the column/bar would become proper? Thanks in advance.

                    DataTable data = DataTable.create();
            data.addColumn(ColumnType.STRING, "Year");
            data.addColumn(ColumnType.NUMBER, "Sales 2009");
            data.addColumn(ColumnType.NUMBER, "Sales 2010");
            data.addColumn(ColumnType.NUMBER, "Sales 2011");
            data.addRows(25);

                    // Data setup for months of the year 2009
            data.setValue(0, 0, "May-09");
            data.setValue(0, 1, 1500);
            data.setValue(1, 0, "June-09");
            data.setValue(1, 1, 400);
            data.setValue(2, 0, "July-09");
            data.setValue(2, 1, 1200);
            data.setValue(3, 0, "Aug-09");
            data.setValue(3, 1, 300);
            data.setValue(4, 0, "Sep-09");
            data.setValue(4, 1, 100);
            data.setValue(5, 0, "Oct-09");
            data.setValue(5, 1, 750);
            data.setValue(6, 0, "Nov-09");
            data.setValue(6, 1, 250);
            data.setValue(7, 0, "Dec-09");
            data.setValue(7, 1, 400);

                    // Data setup for months of the year 2010
            data.setValue(8, 0, "Jan-10");
            data.setValue(8, 2, 150);
            data.setValue(9, 0, "Feb-10");
            data.setValue(9, 2, 5000);
            data.setValue(10, 0, "Mar-10");
            data.setValue(10, 2, 2000);
            data.setValue(11, 0, "Apr-10");
            data.setValue(11, 2, 1000);
            data.setValue(12, 0, "May-10");
            data.setValue(12, 2, 200);
            data.setValue(13, 0, "Jun-10");
            data.setValue(13, 2, 600);
            data.setValue(14, 0, "Jul-10");
            data.setValue(14, 2, 4500);
            data.setValue(15, 0, "Aug-10");
            data.setValue(15, 2, 800);
            data.setValue(16, 0, "Sep-10");
            data.setValue(16, 2, 400);
            data.setValue(17, 0, "Oct-10");
            data.setValue(17, 2, 500);
            data.setValue(18, 0, "Nov-10");
            data.setValue(18, 2, 5000);
            data.setValue(19, 0, "Dec-10");
            data.setValue(19, 2, 2000);

                    // Data setup for months of the year 2011
            data.setValue(20, 0, "Jan-11");
            data.setValue(20, 3, 1500);
            data.setValue(21, 0, "Feb-11");
            data.setValue(21, 3, 300);
            data.setValue(22, 0, "Mar-11");
            data.setValue(22, 3, 1200);
            data.setValue(23, 0, "Apr-11");
            data.setValue(23, 3, 550);
            data.setValue(24, 0, "May-11");
            data.setValue(24, 3, 700);

On May 9, 6:24 pm, asgallant <[email protected]> wrote:
> You are correct, that is how it would display, but it is the only way to get
> multiple colors in the current version of the API.  The Image charts (as
> opposed to the interactive charts) might be able to do what you want, but
> I'm not sure, as I've never used them.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-visualization-api?hl=en.

Reply via email to