TChart多纵坐标排开显示,怎么实现啊?

 我来答
挥毫挥笔惊天5
2012-07-19
知道答主
回答量:12
采纳率:0%
帮助的人:1.4万
展开全部
TeeChart6.0的pro版本就可以,CustomAxis, 你需要升级到这个版本。不过较大...
另附:
实现一个横坐标,三个纵坐标功能的图表(转载)
实现一个横坐标,三个纵坐标功能的图表: private Steema.TeeChart.Styles.FastLine fastLineSeries1;
private Steema.TeeChart.Styles.FastLine fastLineSeries2;
private Steema.TeeChart.Styles.FastLine fastLineSeries3; private Steema.TeeChart.Axis Green;
private Steema.TeeChart.Axis Blue; public void tChart(Steema.TeeChart.TChart tChart,string headerName,string title1,string title2,string title3,DataTable dt,string x,string y1,string y2,string y3)
{
tChart.Header.Lines = new string[] {headerName};
Steema.TeeChart.Axis axis = tChart.TChart.Axes.Left;
axis.AxisPen.Color = Color.Red;
axis.StartPosition = 0;
axis.EndPosition = 30;
Green = new Steema.TeeChart.Axis();
tChart.Axes.Custom.Add(Green);
Green.AxisPen.Color = Color.Green;
Green.StartPosition = 34;
Green.EndPosition = 65;
Blue = new Steema.TeeChart.Axis();
tChart.TChart.Axes.Custom.Add(Blue);
Blue.AxisPen.Color = Color.Blue;
Blue.StartPosition = 70;
Blue.EndPosition = 100;
this.fastLineSeries1 = new Steema.TeeChart.Styles.FastLine();
this.fastLineSeries1.Cursor = System.Windows.Forms.Cursors.Cross;
this.fastLineSeries1.LinePen.Color = System.Drawing.Color.Red;
this.fastLineSeries1.Title = title1;
this.fastLineSeries1.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
this.fastLineSeries1.VertAxis = Steema.TeeChart.Styles.VerticalAxis.Left; this.fastLineSeries2 = new Steema.TeeChart.Styles.FastLine();
this.fastLineSeries2.Cursor = System.Windows.Forms.Cursors.Cross;
this.fastLineSeries2.LinePen.Color = System.Drawing.Color.Green;
this.fastLineSeries2.Title = title2;
this.fastLineSeries2.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
this.fastLineSeries2.CustomVertAxis = Green; this.fastLineSeries3 = new Steema.TeeChart.Styles.FastLine();
this.fastLineSeries3.Cursor = System.Windows.Forms.Cursors.Cross;
this.fastLineSeries3.LinePen.Color = System.Drawing.Color.Blue;
this.fastLineSeries3.Title = title3;
this.fastLineSeries3.XValues.Order = Steema.TeeChart.Styles.ValueListOrder.Ascending;
this.fastLineSeries3.CustomVertAxis = Blue; tChart.Series.Add(fastLineSeries1);
tChart.Series.Add(fastLineSeries2);
tChart.Series.Add(fastLineSeries3);
fastLineSeries1.DataSource = dt;
fastLineSeries1.LabelMember = x;
fastLineSeries1.YValues.DataMember = y1; fastLineSeries2.DataSource = dt;
fastLineSeries2.LabelMember = x;
fastLineSeries2.YValues.DataMember = y2; fastLineSeries3.DataSource = dt;
fastLineSeries3.LabelMember = x;
fastLineSeries3.YValues.DataMember = y3;
}
追问
看不懂啊,我只会C++。
你这里到底定义了几根Y轴啊?
追答
wengaoshou
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
ZESTRON
2024-09-04 广告
在Dr. O.K. Wack Chemie GmbH,我们高度重视ZESTRON的表界面分析技术。该技术通过深入研究材料表面与界面的性质,为提升产品质量与可靠性提供了有力支持。ZESTRON的表界面分析不仅涵盖了相变化、化学反应、吸附与解吸... 点击进入详情页
本回答由ZESTRON提供
百度网友1fc36d4
2012-07-20 · TA获得超过3131个赞
知道大有可为答主
回答量:1497
采纳率:100%
帮助的人:1833万
展开全部
你用TChart做啥啊?

你自己改着用吧,建议你去找TChart手册看看
void InitChart(TChart *Chart)
{
#define YAXIS_WIDTH 40
char Buf[256];
int Color,ColorList[]={clRed,clBlue,clGreen};
int VisibleYAxis=0;
TChartAxis *YAxis;
TFastLineSeries *Series;
for( int n = 0;n < 3;n++)
{
Color=ColorList[n];
YAxis=new TChartAxis(Chart->CustomAxes);
YAxis->Maximum=100;
YAxis->Minimum=0;
YAxis->Automatic=false;
YAxis->Axis->Color=Color;
YAxis->Axis->Width=1;
YAxis->LabelsAngle=90;
YAxis->LabelsFont->Color=Color;
YAxis->Ticks->Color=Color;
sprintf(Buf,"YAxis%d",n);
YAxis->Title->Caption=Buf;
YAxis->Title->Font->Color=Color;
YAxis->Title->Angle=90;
YAxis->MinorGrid->Visible=false;
YAxis->Grid->Visible=false;
YAxis->PositionUnits=muPixels;
YAxis->PositionPercent=-YAXIS_WIDTH*VisibleYAxis;
VisibleYAxis++;
Series = new TFastLineSeries(Chart);
Series->Color=Color;
Series->LinePen->Width=1;
Series->CustomVertAxis=YAxis;
Series->XValues->DateTime=true;
Chart->AddSeries(Series);
}
Chart->BottomAxis->DateTimeFormat="hh:nn:ss:zzz";
Chart->BottomAxis->Grid->Visible=false;
Chart->MarginUnits=muPixels;
Chart->MarginLeft=YAXIS_WIDTH*VisibleYAxis;
}
来自:求助得到的回答
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式