It seems like your server could return the since JSON structure that the ChartWrapper constructor takes, so that you wouldn't need this kind of code. Unless you set things piece by piece. If I were you, my service would return a JSON object that contains everything that the ChartWrapper needs, which means that the server wouldn't need to send any code to the client after the initial send. But I obviously don't know the inner workings of your systems, and what you're doing may be the right way to go.
- Sergey On Mon, Dec 10, 2012 at 4:00 PM, Cyle Hunter <[email protected]> wrote: > Hi Sergey, I think for most people the recommended usage as shown in the > docs is the best approach. However for my particular use case I have many > charts built server-side using a single unobtrusive javascript interface > that's receiving JSON to programatically define how charts need to be > constructed. This seemed like a much more favorable solution than to have > to write a new javascript file for each of my many charts. The drawback was > that my single JS file had to get a little messy to handle various charts > and options which got pretty messy and tricky to read. That said I'm > looking for opportunities to make things a little more succinct and this > was one of the biggest redundancies that I had noticed in my code so I > thought I'd bring it up. > > -- > You received this message because you are subscribed to the Google Groups > "Google Visualization API" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/google-visualization-api/-/lupg-z4krxMJ. > > 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. > -- 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.
