[SOLVED] Changing FastReport Chart by code-script
I want to share my knowledge, hoping it is useful to anyone.
Working with FastReport, I implemented a Chart, that contains a simple FastLine serie, into the Report.
In the code-section of FastReport, I make some changes according to the Chart (called Chart1).
Changing colors:
Changing values:
Best regards!
Working with FastReport, I implemented a Chart, that contains a simple FastLine serie, into the Report.
In the code-section of FastReport, I make some changes according to the Chart (called Chart1).
Changing colors:
// Changing the color of a serie:
TBarSeries(Chart1.Series[0]).SeriesColor := clRed;
// Changing the color of the axis' title:
TTeePen(Chart1.Chart.LeftAxis.Title.Font).Color := clRed;
// Changing the color of an axis:
TPen(Chart1.Chart.LeftAxis.Axis).Color := clRed;
Changing values:
// Changing the datasource of a serie:
Chart1.SeriesData[0].Source2 := '<Dataset1."Field1">';
// Changing the title of a serie (visible in the ledgend):
TBarSeries(Chart1.Series[0]).Title := 'My Series Title';
// Changing the title of an axis:
Chart1.Chart.LeftAxis.Title.Caption := 'Temperature / ?°C';
Best regards!