teechart - Delphi: discrete bottom axis in TChart -
i'm not able implement discrete bottom axis tchart
(i'm using lite version in xe5)
my purpose display 2 series: series1 : tbarseries
, series2: tlineseries
scalar
in chart bottom axis discrete (integer values or date)!
adding these values (for example)
series1.addxy(0,2,'',clgreen); series2.addxy(0,5,'', clred); series1.addxy(1,4,'',clgreen); series2.addxy(1,5,'', clred); series1.addxy(2,6,'',clgreen); series2.addxy(2,2,'', clred);
the chart drawn follows:
but, can see, bottom axis not discrete. want obtain this
how can achieve that? thank you.
i've made simple example using tareaseries
, tlineseries
, both stairs , think looks you'd to:
uses series; procedure tform1.formcreate(sender: tobject); const values0: array[0..2] of tchartvalue = (2, 4, 6); values1: array[0..2] of tchartvalue = (5, 7, 2); var i: integer; begin chart1.view3d:=false; chart1.legend.visible:=false; chart1.addseries(tareaseries) tareaseries begin color:=clgreen; stairs:=true; useyorigin:=true; end; chart1.addseries(tlineseries) tlineseries begin color:=clred; stairs:=true; end; i:=0 high(values0) begin chart1[0].addxy(i-0.5, values0[i]); chart1[1].addxy(i-0.5, values1[i]); end; chart1[0].addxy(chart1[0].count-0.5, values0[chart1[0].count-1]); chart1[1].addxy(chart1[1].count-0.5, values1[chart1[1].count-1]); end;
Comments
Post a Comment