如果十年是1到2,他想要以下标签(1,10)和以下小标记(1.5,5.5,9)
任何帮助非常感谢.我找不到如何覆盖刻度线,所以我可以将它们放在自定义点.我已经想出了自定义标签.
谢谢
解决方法 这里回答你 here.我在这里发布了最后一个更复杂的例子中的代码,其中自定义标签用于绘制不规则标签,并创建DrawMinorTick函数以手动绘制不规则的自定义次要刻度.uses SerIEs,TeCanvas;procedure TForm1.FormCreate(Sender: TObject);var i: Integer;begin Chart1.VIEw3D:=false; Chart1.Legend.Visible:=false; Chart1.AddSerIEs(TFastlineserIEs).FillSampleValues(10); for i:=0 to Chart1[0].Count-1 do Chart1[0].XValue[i]:=i+1; Chart1.Axes.Bottom.Items.Clear; for i:=1 to 4 do Chart1.Axes.Bottom.Items.Add(i,IntToStr(i)); Chart1.Axes.Bottom.Items.Add(7,'7'); Chart1.Axes.Bottom.Items.Add(10,'10'); Chart1.Axes.Bottom.MinorTickCount:=0;end;procedure TForm1.Chart1AfterDraw(Sender: TObject);begin DrawMinorTick(Chart1.Axes.Bottom,1.5); DrawMinorTick(Chart1.Axes.Bottom,2.5); DrawMinorTick(Chart1.Axes.Bottom,5); DrawMinorTick(Chart1.Axes.Bottom,6); DrawMinorTick(Chart1.Axes.Bottom,8); DrawMinorTick(Chart1.Axes.Bottom,9);end;procedure TForm1.DrawMinorTick(axis: TChartAxis; value: double);var XPos,YPos: Integer;begin Chart1.Canvas.Pen.color:=axis.MinorTicks.color; Chart1.Canvas.Pen.WIDth:=axis.MinorTicks.WIDth; Chart1.Canvas.Pen.Style:=axis.MinorTicks.Style; if axis.Horizontal then begin XPos:=axis.CalcPosValue(value); YPos:=axis.PosAxis+1; Chart1.Canvas.line(XPos,YPos,XPos,YPos+axis.MinorTickLength); end else begin XPos:=axis.PosAxis; YPos:=axis.CalcPosValue(value); Chart1.Canvas.line(XPos,XPos-axis.MinorTickLength,YPos); end;end;总结
以上是内存溢出为你收集整理的次要滴答TeeChart delphi对数刻度全部内容,希望文章能够帮你解决次要滴答TeeChart delphi对数刻度所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)