Can First column of the ScatterChart be string

11 views
Skip to first unread message

sajeevi.b...@gmail.com

unread,
Jun 24, 2009, 6:05:41 AM6/24/09
to Google Visualization API
Hi Team,

I can add string for first column to scatterChart if there are two
columns.

function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('number', 'Sub1 Marks');
data.addRows(3);
data.setCell(0, 0, 'S1');
data.setCell(0, 1, 65);
data.setCell(1, 0, 'S2');
data.setCell(1, 1, 89);
data.setCell(2, 0, 'S3');
data.setCell(2, 1, 76);
var chart = new google.visualization.ScatterChart
(document.getElementById('chart_div'));
chart.draw(data, {width: 400, height: 240, titleX:
'Name',titleY: 'Marks', legend: 'none', pointSize: 5});
}

if if there are more than two columns and if the first column be
string as above the chart is not what i expect.

function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('string', 'Name');
data.addColumn('number', 'Sub1 Marks');
data.addColumn('number', 'Sub2 Marks');
data.addRows(3);
data.setCell(0, 0, 'S1');
data.setCell(0, 1, 65);
data.setCell(0, 2, 45);
data.setCell(1, 0, 'S2');
data.setCell(1, 1, 89);
data.setCell(1, 2, 48);
data.setCell(2, 0, 'S3');
data.setCell(2, 1, 76);
data.setCell(2, 2, 58);
var chart = new google.visualization.ScatterChart
(document.getElementById('chart_div'));
chart.draw(data, {width: 400, height: 240, titleX:
'Name',titleY: 'Marks', legend: 'none', pointSize: 5});
}

please help me to add string for the first column if there are more
than one columns. i need to display string values for the x-axis
values rather than numbers.

Thanks & best Regards,
Sajeevi

Bug Chart

unread,
Jun 25, 2009, 4:50:14 AM6/25/09
to google-visua...@googlegroups.com
Hi,

for now,
labels can only be used with one other numerical column.

You can try use another visualization,
for example barchart or columnchart.

BugChart.

VizGuy

unread,
Jun 28, 2009, 8:06:03 AM6/28/09
to google-visua...@googlegroups.com
So what you are trying to draw is not a scatter chart, but a line chart, as in scatter chart the x axis is values based, and here its categories.
The actual scatter chart revert to a line chart if the first column is a labels column.
In your case, please use line chart instead.

Regards,
VizGuy

VizGuy

unread,
Jun 28, 2009, 8:10:55 AM6/28/09
to google-visua...@googlegroups.com
Related:

Use lineSize: 0 to show points, and not lines, if you want this option (I guess this might be one reason to use the scatter instead of the line chart, but since this parameter exists, its non issue).


VizGuy

ChartMan

unread,
Jun 28, 2009, 8:31:51 AM6/28/09
to google-visua...@googlegroups.com
Hi

In the current setup of the chart - labels can only be used with one data series.
We recorded your request and will consider adding support for labels when there are several series.

ChartMan

On Wed, Jun 24, 2009 at 1:05 PM, sajeevi.b...@gmail.com <sajeevi.b...@gmail.com> wrote:

sajeevi.b...@gmail.com

unread,
Jul 3, 2009, 12:15:46 AM7/3/09
to Google Visualization API
Hi Team,

thank you very much for all of your comments and this help me a lot.
My team members are really amazing about this chart API.

thank you very much team to give us this Wonderful opportunity.

thanks & best regards,
Sajeevi

On Jun 28, 5:31 pm, ChartMan <chart...@google.com> wrote:
> Hi
>
> In the current setup of the chart - labels can only
> be used with one data series.
> We recorded your request and will consider adding support for labels when
> there are several series.
>
> ChartMan
>
> On Wed, Jun 24, 2009 at 1:05 PM, sajeevi.bangamuw...@gmail.com <

sajeevi.b...@gmail.com

unread,
Jul 3, 2009, 12:47:15 AM7/3/09
to Google Visualization API
Hi Team,

thank you very much for all of your comments and this help me a lot.
My team members are really amazing about this chart API.

thank you very much team to give us this Wonderful opportunity.

thanks & best regards,
Sajeevi

On Jun 28, 5:31 pm, ChartMan <chart...@google.com> wrote:
> Hi
>
> In the current setup of the chart - labels can only
> be used with one data series.
> We recorded your request and will consider adding support for labels when
> there are several series.
>
> ChartMan
>
> On Wed, Jun 24, 2009 at 1:05 PM, sajeevi.bangamuw...@gmail.com <
Reply all
Reply to author
Forward
0 new messages