On Mon, Jan 3, 2011 at 6:18 PM, Benny <[email protected]> wrote:

> Hello,
>
> This is my first project to use the google visualization API - so, I
> could simply be overlooking the obvious. I have been trying to solve
> this since yesterday, and I am at the verge of madness:(.
>
> I am using LineChart with GWT and I am drawing a chart for appx 8500
> points (some monthly data). These are points stored in a local
> database to the web server. My latency is pretty low (app 3 secs).
> However, when the cart is drawn, the horizontal labels are
> understandably cluttered and the text is slanted. I am trying to
> change this to be:
>
> 1. Labels are displayed in intervals (ones for each day's data)
> 2. The label angle is 90
>
> I have tried the below and none of them work:
>
> 1. Tried to populate the DataTable X values only when I would like
> them to be displayed. When I do this, the instead of seeing all the
> values I added, I see a fraction of them (eg. I added 30 values and
> only 4 labels got displayed). Is there an easier more standard way to
> do this? Below is the code I tried:
>
>                int current_date = -1;
>                for (DataCapsule result : data)
>                {
>                        data_points.addRow();
>                        if (current_date == -1 || current_date !=
> result.getDate().getDate())
>                        {
>                                String date_field =
> DateTimeFormat.getMediumDateFormat().format(
>                                        result.getDate());
>                                data_points.setValue(i, 0, date_field);
>                                current_date = result.getDate().getDate();
>                        }
>                        else
>                        {
>                                data_points.setValue(i, 0, "");
>                        }
>                        data_points.setValue(i, 1, result.getValue());
>                        ++i;
>                }
>

Try using the "hAxis.showTextEvery" option.


>
> 2. I tried to use the options.set("hAxis.slantedTextAngle",90.0). But
> this seemed to have no effect!
>

Unfortunately, setting these "sub-options" from GWT is not straightforward.
 Currently, you need some kind of hack like:

Options hAxis = Options.create();
hAxis.set("slantedTextAngle", 90.0);
options.set("hAxis", hAxis);

HTH

MC Get Vizzy

>
> I appreciate your input.
>
> Thanks,
>
> --
> 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]<google-visualization-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-visualization-api?hl=en.
>
>

-- 
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