关闭

将WebChart以非图片的方式发布

标签: properties
555人阅读 评论(0) 收藏 举报
            ChartEngine wcEng = new ChartEngine();
            wcEng.Size = new Size(200, 200);
            ChartCollection wcCharts = new ChartCollection(wcEng);
            wcEng.Charts = wcCharts;
            SmoothLineChart slChart = new SmoothLineChart();
            slChart.Line.Color = Color.Red;
            slChart.Legend = "Watts";
            slChart.ShowLineMarkers = false;
            slChart.ShowLegend = false;
            slChart.Data.Add(new ChartPoint("One", 12));
            slChart.Data.Add(new ChartPoint("Two", 22));
            slChart.Data.Add(new ChartPoint("Three", 2));
            wcCharts.Add(slChart);
 
            //' Uncomment this line to Set-up Optional properties on the chart
            //' SetMoreProperties(wcEng)
            Bitmap bmp;
            System.IO.MemoryStream memStream = new System.IO.MemoryStream();           
            bmp = wcEng.GetBitmap();
            bmp.Save(memStream, System.Drawing.Imaging.ImageFormat.Png);
            memStream.WriteTo(Response.OutputStream);
            Response.End(); 
0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:50375次
    • 积分:468
    • 等级:
    • 排名:千里之外
    • 原创:5篇
    • 转载:12篇
    • 译文:0篇
    • 评论:16条
    文章存档
    最新评论