Change chart style
-
- Newbie
- Posts: 58
- Joined: Fri Nov 15, 2002 12:00 am
- Location: Naples, FL
- Contact:
Change chart style
Could you show me how to programmatically change the series style from a line graph to a vertical bar graph, with the bar option of rectangle 2-d and bar width of 30%. I know how to edit the chart manually, but would prefer to automate the process.
Hi.
Let's say you have a series of a TLineSeries type. Try using the following code to change it to TBarSeries type:
Let's say you have a series of a TLineSeries type. Try using the following code to change it to TBarSeries type:
Code: Select all
var tmp: TChartSeries;
begin
tmp := Chart1.Series[0];
ChangeSeriesType(tmp,TBarSeries);
with Chart1.Series[0] as TBarSeries do
begin
BarWidthPercent := 30;
ParentChart.View3D := False;
end;