Exemple #1
0
        static void RunBubbleChart()
        {
            int category_max = 3;
            int data_max = 7;
            BubbleChart.Data[] data = new BubbleChart.Data[category_max];

            Random rand = new Random();

            for (int x = 0; x < category_max; x++)
            {
                data[x] = new BubbleChart.Data();
                data[x].point = new BubbleChart.Data.Point[data_max];
                data[x].label = "label" + x;
                for (int y = 0; y < data_max; y++)
                {
                    data[x].point[y] = new BubbleChart.Data.Point(); 
                    data[x].point[y].x = rand.Next(100);
                    data[x].point[y].y = rand.Next(100);
                    data[x].point[y].r = rand.Next(6);
                }
            }

            BubbleChart lc = new BubbleChart();
            lc.GenerateSimpleHtml("bubble_chart.html", "sample", data, "x-label", "y-label"); 

        }
Exemple #2
0
        public void GenerateSimpleHtml(string filename, string title, BubbleChart.Data[] data, string xtitle, string ytitle)
        {
            string bc_id = "bc_id";

            CSFlotr2Core gbc = new CSFlotr2Core();


            StreamWriter writer =
                new StreamWriter(filename, false, UTF8Encoding.UTF8);


            writer.WriteLine("<html lang='ja' dir='ltr'>");
            writer.WriteLine("<head>");
            writer.WriteLine("<meta charset='utf-8'>");

            writer.WriteLine(gbc.Include());

            writer.WriteLine(gbc.GenerateGraphHeader(bc_id, null));



            writer.WriteLine("</head>");
            writer.WriteLine("<body>");


            writer.WriteLine(gbc.GenerateGraphTitle(bc_id, title));
            writer.WriteLine(GenerateGraphBody(bc_id, data, xtitle, ytitle));



            writer.WriteLine("</body>");
            writer.WriteLine("</html>");
            writer.Close();
        }