示例#1
0
        /// <summary>
        /// Fusion Chart 에 대한 HTML 을 Response에 씁니다.
        /// </summary>
        /// <param name="output">Rendering 대상 HtmlTextWriter</param>
        protected override void RenderContents(HtmlTextWriter output)
        {
            if (IsDebugEnabled)
            {
                log.Debug(@"FusionChart Control을 HTML로 Rending을 시작합니다... ChartId={0}, FileName={1}", ChartId, FileName);
            }

            output.WriteLine(FusionCharts_Javascript);
            output.WriteLine(FusionChartsExportComponent_Javascript);

            var filename = FileName;

            if (filename.StartsWith("~") || filename.Contains("/") || filename.Contains(@"\"))
            {
                filename = WebTool.GetScriptPath(filename);
            }
            else
            {
                filename = HandlerSettings.ResourceFileHandler + "?File=" + filename;
            }

            if (IsDebugEnabled)
            {
                log.Debug(@"Render FusionChart WebControl. " +
                          @"Chart Filename={0}, DataUrl={1}, DataXml={2}, ChartId={3}, Width={4}, Height={5}, DebugMode={6}, RegisterWithJS={7}, Transparent={8}",
                          filename, DataUrl, DataXml, ChartId, Width, Height, DebugMode, RegisterWithJS, Transparent);
            }

            var html = ChartUtil.RenderChartHtml(filename,
                                                 DataUrl,
                                                 DataXml,
                                                 ChartId,
                                                 Width.ToString(),
                                                 Height.ToString(),
                                                 DebugMode,
                                                 RegisterWithJS,
                                                 Transparent);

            if (IsDebugEnabled)
            {
                log.Debug("Rendering Html= " + html);
            }

            output.WriteLine();
            output.WriteLine(html);
            output.WriteLine();

            if (IsDebugEnabled)
            {
                log.Debug(@"FusionChart Control을 HTML로 Rending을 완료했습니다!!! ChartId={0}, FileName={1}", ChartId, FileName);
            }
        }