![]() |
Letzten Datenpunkt in Diagramm Excel beschriften
Hallo Leute,
nochmal Danke für eure bisherige Hilfe. Nun muss ich den letzten Datenpunkt einer Series in einem Diagramm beschriften. Hier ist der Code:
Delphi-Quellcode:
Nach der Doku (
procedure TDoExportForm.CreateSeries(sc: SeriesCollection; FlowStr, ValueStr: String; out minmax: TMinMax);
var ser: Series; i: Integer; ws: _Worksheet; cell1, cell2: OleVariant; spalteFlow, spalteValue: Integer; zeilen: Integer; maxflow, minflow, maxvalue, minvalue, temp: Real; pts: Points; pt: Point; o: integer; rng: ExcelRange; begin minmax.maxFlow:= varNull; minmax.maxValue:= varNull; minmax.minFlow:= varNull; minmax.minValue:= varNull; for i:= 1 to Excel.Worksheets.Count do begin ws:= Excel.Worksheets[i] as _Worksheet; if IsDataWorksheet(ws) then begin spalteFlow:= FindeSpalte(ws, FlowStr); spalteValue:= FindeSpalte(ws, ValueStr); if (spalteFlow > 0) and (spalteValue > 0) then begin zeilen:= Min(ZaehleZeilen(ws, SpalteFlow), ZaehleZeilen(ws, SpalteValue)); if Zeilen > 0 then begin ser:= sc.NewSeries; ser.Name:= ws.Name; ser.AxisGroup:= xlPrimary; cell1:= ws.Cells.Item[3, spalteFlow]; cell2:= ws.Cells.Item[zeilen +2, spalteFlow]; ser.XValues:= ExcelRangeToString(ws, cell1, cell2); cell1:= ws.Cells.Item[3, spalteValue]; cell2:= ws.Cells.Item[zeilen +2, spalteValue]; ser.Values:= ExcelRangeToString(ws, cell1, cell2); ser.Border.ColorIndex:= 1; ser.Border.Weight:= xlThin; pts:= ser.Points(EmptyParam) as Points; pt:= pts.Item(pts.Count); // Hier kommt es zur Exception, ungültiger Paramter pt.ApplyDataLabels(xlDataLabelsShowLabel, EmptyParam, EmptyParam, EmptyParam, true, EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam); pt.DataLabel.ShowValue:= False; cell1:= ws.Cells.Item[1, 3]; pt.DataLabel.Caption:= ExcelRangeToString(ws, cell1, cell1); pt.DataLabel.Interior.ColorIndex:= 2; pt.DataLabel.Interior.PatternColorIndex:= 1; pt.DataLabel.Font.Size:= 8; pt.DataLabel.AutoScaleFont:= False; ![]() Datenpunkte in der Series sind vorhanden. Die sehe ich im exportieren Diagramm. Hat jemand eine Idee, wie ich die Beschriftung hinbekomme? |
AW: Letzten Datenpunkt in Diagramm Excel beschriften
Liste der Anhänge anzeigen (Anzahl: 1)
ginge statt
pts:= ser.Points(EmptyParam) as Points; auch pts:= ser.Points; ? statt pt:= pts.Item(pts.Count); einfach pt:= pts(pts.Count); Siehe Screenshot Excel-Hilfe |
AW: Letzten Datenpunkt in Diagramm Excel beschriften
pts:= ser.Points; --> nicht genügend wirkliche Parameter.
pt:= pts(pts.Count); -->Inkompatible Typen Point und Points. Das Problem tritt ja auch erst mit Office 365 auf. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:21 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz