I have some import problem
Posted: Thu Dec 11, 2008 4:12 am
hi I want to import .ten file
but import has some problem
imported chart label title has changed and axes bottom background add black
color
I attached two chart image (original file and imported file) and ten file
My Sample Code
----------------------------------------------------------------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Steema.TeeChart.Web; // Teechart
using System.IO; // Teechart
using System.Text; // stringbuilder
using System.Collections.Specialized; // HybridDictionary
namespace WebApplication1
{
/// <summary>
/// WebForm1에 대한 요약 설명입니다.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected Steema.TeeChart.Web.WebChart WC1010001;
private void Page_Load(object sender, System.EventArgs e)
{
// 여기에 사용자 코드를 배치하여 페이지를 초기화합니다.
if (File.Exists("d:\\test\\webapplication1\\chartimg\\WC1010001.ten"))
{
Steema.TeeChart.Chart ch = this.WC1010001.Chart; //차트 생성
ch.Import.Template.Load("d:\\test\\webapplication1\\chartimg\\WC1010001.ten");
ch.Legend.Shadow.Visible = false;
ch.Legend.CustomPosition = false;
//File.Delete("d:\\test\\webapplication1\\chartimg\\WC1010001.ten");
}
else
{
ChartCreate();
}
}
#region Web Form 디자이너에서 생성한 코드
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 이 호출은 ASP.NET Web Form 디자이너에 필요합니다.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void ChartCreate()
{
//****************************************************************************************************
// * 차트 생성
#region 차트 디자인 set
Steema.TeeChart.Chart ch = this.WC1010001.Chart; //차트 생성
MemoryStream tmpChart=new MemoryStream();
// 3D
ch.Aspect.View3D = false;
// Head title
ch.Header.Visible = false;
// panel
ch.Panel.MarginTop = 10;
ch.Panel.MarginBottom = 10;
ch.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
ch.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
// legend
ch.Legend.Alignment = Steema.TeeChart.LegendAlignments.Bottom;
ch.Legend.Pen.Visible = false;
ch.Legend.Shadow.Visible = false;
ch.Legend.Symbol.Width = 12;
ch.Legend.CustomPosition = true;
ch.Legend.Top = 160;
ch.Legend.Left = 30;
ch.Legend.ColumnWidthAuto = false;
ch.Legend.ColumnWidths[0] = 66;
ch.Legend.MaxNumRows = 1;
// wall
ch.Walls.Visible = true;
ch.Walls.Back.Transparency = 0;
ch.Walls.Back.Transparent = false;
// wall axes
ch.Axes.Left.AxisPen.Width = 1;
ch.Axes.Left.MinorTicks.Visible = false;
ch.Axes.Right.AxisPen.Width = 1;
ch.Axes.Right.Grid.Visible = false;
ch.Axes.Right.Ticks.Visible = false;
ch.Axes.Right.MinorTicks.Visible = false;
ch.Axes.Bottom.AxisPen.Width = 0;
ch.Axes.Bottom.MinorTicks.Visible = false;
ch.Axes.Bottom.TicksInner.Visible = false;
ch.Axes.Bottom.Grid.Visible = false;
// 단위표시
Steema.TeeChart.Tools.Annotation annotation1 = new Steema.TeeChart.Tools.Annotation(ch);
annotation1.Shape.Visible = false;
annotation1.Text = "(%)";
annotation1.Top = 0;
annotation1.Left = 10;
Steema.TeeChart.Tools.Annotation annotation2 = new Steema.TeeChart.Tools.Annotation(ch);
annotation2.Shape.Visible = false;
annotation2.Text = "(원)";
annotation2.Top = 0;
annotation2.Left = 310;
#endregion
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(ch.Chart);
line1.LinePen.Width = 2;
line1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(ch.Chart);
line2.LinePen.Width = 2;
Steema.TeeChart.Styles.Line line3 = new Steema.TeeChart.Styles.Line(ch.Chart);
line3.LinePen.Width = 2;
ch.Axes.Bottom.Labels.Items.Clear(); // bottom label set
//Test Data
string [] DataBottom = {"07/12","08/03","08/06","08/09","08/12"};
int [] DataLine1 = {10,15,20,25,30};
int [] DataLine2 = {12,14,29,15,38};
int [] DataLine3 = {2,10,40,12,21};
for(int i = 0 ; i < 5 ; i++)
{
line1.Add(i, DataLine1);
line2.Add(i, DataLine2);
line3.Add(i, DataLine3);
Steema.TeeChart.AxisLabelItem lb_Axis = new Steema.TeeChart.AxisLabelItem(ch.Chart);
lb_Axis = ch.Axes.Bottom.Labels.Items.Add(i, DataBottom.ToString());
}
//ch.Export.Template.Save(tmpChart);
ch.Export.Template.Save(@"d:\Test\Webapplication1\\chartimg\WC1010001.ten");
}
}
}
----------------------------------------------------------------------------------
teeChart Version : TeeChart for .NET v2 Update Build version
Release Notes 8th October 2008
TeeChart.NET version 2
Build 2.0.3203.23271
Compiled in .NET Framework 1.1
Build 2.0.3203.23272
Compiled in .NET Framework 2.0
I wrote this problem at newsgroup
and according to advise from newsgroup, I added some code
just like
ch.Import.Template.Load("d:\\test\\webapplication1\\chartimg\\WC1010001.ten");
ch.Legend.Shadow.Visible = false;
ch.Legend.CustomPosition = false;
but bottom label still remain shadow...
please help me
[/img]
but import has some problem
imported chart label title has changed and axes bottom background add black
color
I attached two chart image (original file and imported file) and ten file
My Sample Code
----------------------------------------------------------------------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using Steema.TeeChart.Web; // Teechart
using System.IO; // Teechart
using System.Text; // stringbuilder
using System.Collections.Specialized; // HybridDictionary
namespace WebApplication1
{
/// <summary>
/// WebForm1에 대한 요약 설명입니다.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
protected Steema.TeeChart.Web.WebChart WC1010001;
private void Page_Load(object sender, System.EventArgs e)
{
// 여기에 사용자 코드를 배치하여 페이지를 초기화합니다.
if (File.Exists("d:\\test\\webapplication1\\chartimg\\WC1010001.ten"))
{
Steema.TeeChart.Chart ch = this.WC1010001.Chart; //차트 생성
ch.Import.Template.Load("d:\\test\\webapplication1\\chartimg\\WC1010001.ten");
ch.Legend.Shadow.Visible = false;
ch.Legend.CustomPosition = false;
//File.Delete("d:\\test\\webapplication1\\chartimg\\WC1010001.ten");
}
else
{
ChartCreate();
}
}
#region Web Form 디자이너에서 생성한 코드
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: 이 호출은 ASP.NET Web Form 디자이너에 필요합니다.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 디자이너 지원에 필요한 메서드입니다.
/// 이 메서드의 내용을 코드 편집기로 수정하지 마십시오.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
private void ChartCreate()
{
//****************************************************************************************************
// * 차트 생성
#region 차트 디자인 set
Steema.TeeChart.Chart ch = this.WC1010001.Chart; //차트 생성
MemoryStream tmpChart=new MemoryStream();
// 3D
ch.Aspect.View3D = false;
// Head title
ch.Header.Visible = false;
// panel
ch.Panel.MarginTop = 10;
ch.Panel.MarginBottom = 10;
ch.Panel.Bevel.Outer = Steema.TeeChart.Drawing.BevelStyles.None;
ch.Panel.Bevel.Inner = Steema.TeeChart.Drawing.BevelStyles.None;
// legend
ch.Legend.Alignment = Steema.TeeChart.LegendAlignments.Bottom;
ch.Legend.Pen.Visible = false;
ch.Legend.Shadow.Visible = false;
ch.Legend.Symbol.Width = 12;
ch.Legend.CustomPosition = true;
ch.Legend.Top = 160;
ch.Legend.Left = 30;
ch.Legend.ColumnWidthAuto = false;
ch.Legend.ColumnWidths[0] = 66;
ch.Legend.MaxNumRows = 1;
// wall
ch.Walls.Visible = true;
ch.Walls.Back.Transparency = 0;
ch.Walls.Back.Transparent = false;
// wall axes
ch.Axes.Left.AxisPen.Width = 1;
ch.Axes.Left.MinorTicks.Visible = false;
ch.Axes.Right.AxisPen.Width = 1;
ch.Axes.Right.Grid.Visible = false;
ch.Axes.Right.Ticks.Visible = false;
ch.Axes.Right.MinorTicks.Visible = false;
ch.Axes.Bottom.AxisPen.Width = 0;
ch.Axes.Bottom.MinorTicks.Visible = false;
ch.Axes.Bottom.TicksInner.Visible = false;
ch.Axes.Bottom.Grid.Visible = false;
// 단위표시
Steema.TeeChart.Tools.Annotation annotation1 = new Steema.TeeChart.Tools.Annotation(ch);
annotation1.Shape.Visible = false;
annotation1.Text = "(%)";
annotation1.Top = 0;
annotation1.Left = 10;
Steema.TeeChart.Tools.Annotation annotation2 = new Steema.TeeChart.Tools.Annotation(ch);
annotation2.Shape.Visible = false;
annotation2.Text = "(원)";
annotation2.Top = 0;
annotation2.Left = 310;
#endregion
Steema.TeeChart.Styles.Line line1 = new Steema.TeeChart.Styles.Line(ch.Chart);
line1.LinePen.Width = 2;
line1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Right;
Steema.TeeChart.Styles.Line line2 = new Steema.TeeChart.Styles.Line(ch.Chart);
line2.LinePen.Width = 2;
Steema.TeeChart.Styles.Line line3 = new Steema.TeeChart.Styles.Line(ch.Chart);
line3.LinePen.Width = 2;
ch.Axes.Bottom.Labels.Items.Clear(); // bottom label set
//Test Data
string [] DataBottom = {"07/12","08/03","08/06","08/09","08/12"};
int [] DataLine1 = {10,15,20,25,30};
int [] DataLine2 = {12,14,29,15,38};
int [] DataLine3 = {2,10,40,12,21};
for(int i = 0 ; i < 5 ; i++)
{
line1.Add(i, DataLine1);
line2.Add(i, DataLine2);
line3.Add(i, DataLine3);
Steema.TeeChart.AxisLabelItem lb_Axis = new Steema.TeeChart.AxisLabelItem(ch.Chart);
lb_Axis = ch.Axes.Bottom.Labels.Items.Add(i, DataBottom.ToString());
}
//ch.Export.Template.Save(tmpChart);
ch.Export.Template.Save(@"d:\Test\Webapplication1\\chartimg\WC1010001.ten");
}
}
}
----------------------------------------------------------------------------------
teeChart Version : TeeChart for .NET v2 Update Build version
Release Notes 8th October 2008
TeeChart.NET version 2
Build 2.0.3203.23271
Compiled in .NET Framework 1.1
Build 2.0.3203.23272
Compiled in .NET Framework 2.0
I wrote this problem at newsgroup
and according to advise from newsgroup, I added some code
just like
ch.Import.Template.Load("d:\\test\\webapplication1\\chartimg\\WC1010001.ten");
ch.Legend.Shadow.Visible = false;
ch.Legend.CustomPosition = false;
but bottom label still remain shadow...
please help me
[/img]