public static GoogleVisualizationRequest FromRequest(HttpRequestBase request)
        {
            var r = new GoogleVisualizationRequest();

            r.Query = request.QueryString["tq"];

            var tqx = request.QueryString["tqx"];

            if (!String.IsNullOrEmpty(tqx))
            {
                tqx.Split(';').Each(x => {
                    var k = x.Substring(0, x.IndexOf(':'));
                    var v = x.Substring(k.Length + 1);
                    switch (k)
                    {
                    case "reqId": r.RequestId = int.Parse(v); break;

                    case "version": r.Version = v; break;

                    case "sig": r.Signature = v; break;

                    case "out":
                        switch (v)
                        {
                        case "json": r.OutputFormat = GoogleVisualizationResponseFormat.JSON; break;

                        case "html": r.OutputFormat = GoogleVisualizationResponseFormat.Html; break;

                        case "csv": r.OutputFormat = GoogleVisualizationResponseFormat.Csv; break;

                        case "tsv-excel": r.OutputFormat = GoogleVisualizationResponseFormat.Tsv; break;
                        }
                        break;

                    case "responseHandler": r.ResponseHandler = v; break;

                    case "outFileName": r.OutputFilename = v; break;

                    default:
                        (r.Parameters ?? (r.Parameters = new Dictionary <string, string>()))
                        .Add(k, v);
                        break;
                    }
                });
            }

            return(r);
        }
 public GoogleVisualizationResult(HttpRequestBase request)
 {
     Request  = GoogleVisualizationRequest.FromRequest(request);
     Response = new GoogleVisualizationResponse(Request);
 }
 public GoogleVisualizationResponse(GoogleVisualizationRequest request)
 {
     Version   = request.Version;
     RequestId = request.RequestId;
     Status    = GoogleVisualizationResponseStatus.Ok;
 }