Controlling advanced features of Charts in a TExcelApplication
Posted on 2004-10-15
I've got the following problem: I'm drawing a chart on an excelsheet and want to change some features of it, like the minimum and maximum values of the axes. I have no idea how to do that though. The chart does work with the proper values, it's the make-up that's giving me problems. Any help here is appreciated.
Here's what I've got so far:
iNoFields := 8; // Source-Collumn
iEindGraph := iNoRows; // End Source-Row iBeginGraph = Begin Source-Row
vCellStart := Format('%s%d', [Char(iNoFields + 64), iBeginGraph]);
ExcelApp.WorkBooks.Item[IIndex].Sheets.Add(EmptyParam, EmptyParam, 1, xlChart, 0); // Add a Chart to the Workbook
iNoRows := iNoRows + 1;
WorkBk.ActiveChart.ChartType := xlBarClustered;
WorkBk.ActiveChart.SetSourceData(Worksheet.Range[vCellStart,Worksheet.Cells.Item[iEindGraph,iNoFields]], xlColumns); // Assign values to the chart
WorkBk.ActiveChart.Location(xlLocationAsObject, 'Blad1'); // Assign the Chart to the Worksheet called : Blad1
WorkBk.ActiveChart.Axes(xlValue, EmptyParam, 1).MaximumScale := 400;
// This part isn't working.