MS Chart 인쇄
9435 단어 chart
protected void btnPrint_Click(object sender, EventArgs e)
{
hidPrint.Value = "1";
//
PrintDocument printdoc = new PrintDocument();
//
printdoc.PrintPage += new PrintPageEventHandler(printdoc_PrintPage);
PaperSize ps = new PaperSize("print_ps", 2100, 2700);
printdoc.DefaultPageSettings.PaperSize = ps;
printdoc.DefaultPageSettings.Landscape = false;
//
printdoc.Print();
ScriptManager.RegisterStartupScript(this, this.GetType(), "A", "showMessage(' ',true);", true);
}
<asp:Chart ID="Chart1" runat="server" Width="630px" Height="450px" Style="text-align: left"
Palette="Excel" ImageLocation="~/TempImages/ChartPic_#SEQ(400,3)">
<Series>
<asp:Series ChartType="Pie" Name="Series1" ChartArea="ChartArea1" Legend="Legend1">
</asp:Series>
</Series>
<ChartAreas>
<asp:ChartArea Name="ChartArea1">
</asp:ChartArea>
</ChartAreas>
<Legends>
<asp:Legend Name="Legend1">
</asp:Legend>
</Legends>
</asp:Chart>
protected void SetChartData()
{
Bms_SecurityHiddenTypeCollection collection = new Bms_SecurityHiddenTypeBLL().GetSecurityHiddenTypeRate(Conditions);
//
Chart1.DataSource = collection;
//
Chart1.Series["Series1"].Label = "#PERCENT{P2}";
//
Chart1.Series["Series1"].LegendText = "#VALX";
//// X
//Chart1.Series[0].PostBackValue = "#VALX";
Chart1.Series["Series1"].Points.DataBindXY(collection, "TypeName", collection, "Rate");
//
Chart1.DataBind();
Chart1.ChartAreas["ChartArea1"].Area3DStyle.Enable3D = true;
Chart1.ChartAreas["ChartArea1"].Area3DStyle.Inclination = 45;
Chart1.ChartAreas["ChartArea1"].Area3DStyle.Rotation = 45;
Chart1.Series["Series1"]["PieLabelStyle"] = "Outside";
}
void printdoc_PrintPage(object sender, PrintPageEventArgs e)
{
//
string path = Server.MapPath(string.Format("../TempImageFiles/chart_{0}.png", DateTime.Now.ToString("yyyyMMddhhmmssfff")));
Chart1.SaveImage(path, ChartImageFormat.Png);
Bitmap b = new Bitmap(path);
e.Graphics.DrawImage(b, e.MarginBounds.Left, e.MarginBounds.Top);
e.PageSettings.Landscape = true;
}
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
CSV 데이터에서 각도 차트를 만드는 방법마지막으로 Angular에서 HTTPClient 모듈을 사용하여 API의 데이터로 차트를 만들었습니다. 마찬가지로 이 기사에서는 동일한 모듈과 모듈을 사용하여 CSV 파일의 데이터로 차트를 그릴 것입니다. CSV(쉼...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.