ich habe nach dem Update ein Problem mit der Achsenskalierung in Charts (Diagramme).
Aus einer CSV-DAtei erstelle ich mir eine Wertetabelle mit Werten für die X-Achse im Format hh:mm:ss, wobei alle 2 Sek. ein Meßwert erfaßt wird.
In den alten Versionen (bis LO 3.6) konnte ich dann diese Werte mittels "x.StepMain" die Skalierung der Hauptwerte (in meinem Fall -> alle 5 min) vornehmen.
Jetzt (unter LO 4.0) wird ca. alle 20 Sek. ein x-Achsenwert angezeigt - und damit wird die Lesbarkeit der x-Achse ziemlich schlecht.
weiß jemand eine Lösung ?
Code: Alles auswählen
Sub Diagramm_zeichnen()
Dim oTab
Dim oSheet
Dim oChart
Dim oChartDoc
Dim oAxisX
Dim oAxisY
Dim oXTitle
Dim oYTitle
Dim oGrid
Dim oGraph
Dim oDiagram
Dim iZ as Integer
Dim RangeAddress(0) as new com.sun.star.table.CellRangeAddress
Dim oDash as new com.sun.star.drawing.LineDash
Dim aRect as new com.sun.star.awt.Rectangle
Diagramm_formatieren
'# Groesse des Diagrammes
with aRect
.X = 0 : .Y = 0 : .Width = 28000 : .Height = 18000
end with
'# Festlegen des Datenbereiches
RangeAddress(0).Sheet = 1
RangeAddress(0).StartColumn = 1
RangeAddress(0).StartRow = 0
RangeAddress(0).EndColumn = 5
RangeAddress(0).EndRow = iAnzahlDatensaetze
'# Anzeigen des Fensters
oDoc.getCurrentController().getFrame().getContainerWindow().Visible= TRUE
'# Einfuegen einer dritten Tabelle "Diagramm" in das HauptSheet
oTab = oDoc.createInstance("com.sun.star.sheet.Spreadsheet")
oDoc.sheets.insertByName("Diagramm", oTab)
oDoc.sheets.moveByName("Diagramm",0)
oDOc.sheets.moveByName("Wertetabelle",1)
oSheet = oDoc.Sheets.getByName("Diagramm")
'# Einfuegen des Charts in die Tabelle "Diagramm"
oSheet.Charts.addNewByName("AP", aRect, RangeAddress(), True, True)
oChart = oSheet.Charts.getByName( "AP" )
oChartDoc = oChart.getEmbeddedObject()
oChartDoc.FirstDiagram.CoordinateSystems(0).ChartTypes(0).DataSeries(0).LineWidth = 50
oChartDoc.FirstDiagram.CoordinateSystems(0).ChartTypes(0).DataSeries(1).LineWidth = 50
oChartDoc.FirstDiagram.CoordinateSystems(0).ChartTypes(0).DataSeries(2).LineWidth = 50
oChartDoc.FirstDiagram.CoordinateSystems(0).ChartTypes(0).DataSeries(3).LineWidth = 50
'# Öffnen des Dialoges für die Bemerkung
Dialog_Bemerkung_starten
'# Bildschirmausgabe sperren
oChartDoc.lockControllers()
oChartDoc.HasMainTitle = True
oChartDoc.Title.String = "Kurzzeiterhitzung vom "& dDatum
'Abfrage, ob Untertiteltext vorhanden
if sUnterTit <> "" then
oChartDoc.HasSubTitle = True
oChartDoc.SubTitle.String = sUnterTit
end if
oChartDoc.HasLegend = True
oChartDoc.Legend.Alignment = com.sun.star.chart.ChartLegendPosition.BOTTOM
oChartDoc.Legend.CharHeight = 9
'# Diagramm erstellen
oDiagram = oChartDoc.createInstance("com.sun.star.chart.LineDiagram")
oChartDoc.setDiagram( oDiagram )
oDiagram.Lines = True
oChartDoc.Diagram.HasXAxis = True
oChartDoc.Diagram.HasXAxisDescription = True
oChartDoc.Diagram.HasXAxisGrid = False
oChartDoc.Diagram.HasYAxis = True
oChartDoc.Diagram.HasYAxisGrid = True
oChartDoc.Diagram.HasYAxisDescription = True
oGrid = oChartDoc.Diagram.YMainGrid
oDash.Dots = 1
oDash.DotLen = 0
oDash.Dashes = 0
oDash.DashLen = 0
oDash.Distance = 400
oGrid.LineStyle = 1 'com.sun.star.drawing.DASH
'# oGrid.LineDash = oDash '# ->> unter LO 4.0 kommt es zur Fehlermeldung!
oAxisX = oChartDoc.Diagram.XAxis
oXTitle = oChartDoc.Diagram.getXAxisTitle()
oXTitle.String = "Zeit (hh:mm:ss)"
oAxisX.CharHeight = 8
oAxisX.CharFontName = "Arial"
oAxisX.TextRotation = 9000
oAxisX.StepMain = 5
oAxisY = oChartDoc.Diagram.YAxis
oYTitle = oChartDoc.Diagram.getYAxisTitle()
oYTitle.String = "PE(PE)/T(°C)/p(bar)/°v(hl/h)"
oAxisY.CharHeight = 10
oAxisY.CharFontName = "Arial"
oAxisY.StepMain = 5
oAxisY.NumberFormat = 0
oChartDoc.unlockControllers()
End Sub
Sub Diagramm_zeigen
Dim oSheet as Object
Dim oView as Object
oSheet = oDoc.Sheets().getByName("Diagramm")
oView = oDoc.CurrentController
oView.setActiveSheet(oSheet)
end sub