There are two things you can do to convert integer numbers to day names.
First, you have to format the data in your DataTable:
// format column 0 as day of week (1 = Sunday, 2 = Monday, etc)
var dayOfWeek;
for (var i = 0; i < data.getNumberOfRows(); i++) {
dayOfWeek = data.getValue(i, 0);
switch (dayOfWeek) {
case 1:
data.setFormattedValue(i, 0, 'Sunday');
break;
case 2:
data.setFormattedValue(i, 0, 'Monday');
break;
case 3:
data.setFormattedValue(i, 0, 'Tuesday');
break;
case 4:
data.setFormattedValue(i, 0, 'Wednesday');
break;
case 5:
data.setFormattedValue(i, 0, 'Thursday');
break;
case 6:
data.setFormattedValue(i, 0, 'Friday');
break;
case 7:
data.setFormattedValue(i, 0, 'Saturday');
break;
default:
// should never trigger
}
}
Then, you need to specify the axis values to use with the hAxis or vAxis
(as appropriate) ticks option:
// specify the hAxis values to use
hAxis: {
ticks: [{v: 1, f: 'Sunday'}, {v: 2, f: 'Monday'}, {v: 3, f: 'Tuesday'},
{v: 4, f: 'Wednesday'}, {v: 5, f: 'Thursday'}, {v: 6, f: 'Friday'}, {v: 7,
f: 'Saturday'}]
}
On Saturday, December 7, 2013 4:56:27 PM UTC-5, Agustín Formoso wrote:
>
> Have you found any solution to converting integers to day names in Google
> Bubble Charts?
>
> Regards,
> Agustín
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.