Toon posts:

[Delphi/Excel97] grafiekkleur zetten via OLE automation

Pagina: 1
Acties:
  • 48 views sinds 30-01-2008

Verwijderd

Topicstarter
Ik heb hier gezocht, bij deja, bij MSDN en in de excel97.pas, maar kan het antwoord op de volgende vraag niet vinden.

Ik laat mijn Delphi applicatie run-time een grafiek maken in Excel. Deze ziet er bv. zo uit:

Afbeeldingslocatie: http://www.theforumisdown.com/uploadfiles/1102/chart122122.jpg

Op zich mooi, alleen moet hij uitgeprint worden op een laserprinter en dan is het niet handig dat de achtergrond grijs is. Dit wil ik dus veranderen.

Bovenstaande grafiek is de uitkomst van:

Delphi:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
oWerkBlad:=oExcelApp.Worksheets['MijnWerkBlad'] as _Worksheet;
oChartObject:=(oWerkBlad.
               ChartObjects(EmptyParam, LCID) as ChartObjects).
               Add(75,125 , 300, 200); 
oXAxis:=oChart.Axes(xlValue, xlPrimary, LCID) as Axis;
oYAxis:=oChart.Axes(xlCategory, xlPrimary, LCID) as Axis;
rRange:=oExcelApp.Union(oWerkblad.Range['E3','J3'],
                        oWerkBlad.Range['E9','J9']);
With oChart do
  begin
    ConnectTo(oChartObject.Chart as _Chart);
    ChartWizard(rRange,xlColumn,EmptyParam,xlRows,1,0,False,
                String(oWerkblad.Cells.Item[nRow,1]),'ophoging',
                'slagingspercentage (%)',EmptyParam);
    ApplyDataLabels(xlDataLabelsShowValue);
  end;
With oXAxis do
  begin
    MaximumScale:=100;
    AxisTitle.Font.Size:=6;
  end;
With oYAxis do
  begin
     AxisTitle.Font.Size:=6;
  end;


De volgende zaken heb ik al geprobeerd:

Delphi:
1
2
3
4
5
oChart.ChartArea.Interior.Color:=clWhite;
oChart.ChartArea.Interior.PatternColor:=clWhite;
oChart.ChartArea[LCID].Interior.Color:=clWhite;
oChart.ChartArea[LCID].Interior.PatternColor:=clWhite;
oChart.Walls[0].Interior.Color:=clWhite;


helaas alle zonder effect.

Iemand die weet hoe ik dit gedaan krijg?

//edit
typos en code beetje herschikt ivm layout..

[ Voor 31% gewijzigd door Verwijderd op 15-01-2003 12:36 ]


Verwijderd

Topicstarter
Inmiddels heb ik het gevonden (handig topic voor de search wel dit denk ik):

Delphi:
1
oChart.PlotArea[LCID].Interior.Color := RGB(255, 255, 255)


kan dus dicht imo..

  • D2k
  • Registratie: Januari 2001
  • Laatst online: 09-01 11:25

D2k

mooi

Doet iets met Cloud (MS/IBM)


Dit topic is gesloten.