misitu wrote:Thank you very much, ThierryT.
It was "As New com.sun.star.drawing.LineDash" that I couldn't see for myself.
Maybe this will be the key to my understanding the uno/basic "language" a bit better.
Best regards
David
oops. Spoke Too Soon.
I cannot figure out where to slot in this New Line Dash code.
As you will see below, I tried it within the diagram, nothing happened, and then outside, ditto, nothing happened.
Code: Select all
Charts = oChartDoc.Sheets(0).Charts 'live
Charts.addNewByName("Forex Chart", Rect, RangeAddress(), True, True)
Chart = Charts.getByName("Forex Chart")
ChartDoc = Chart.getEmbeddedObject()
with ChartDoc
.hasMainTitle = True
.Title.String = "FOREX Last 91 Days to " & lastDateLogged
.HasSubTitle = True
.Subtitle.String = "(Note: EURUSD is shown 2.5x)"
.HasLegend = True
.Legend.Alignment = com.sun.star.chart.ChartLegendPosition.BOTTOM
.Legend.FillColor = RGB(204, 255, 153)
.Legend.CharHeight = 9
end with
ChartDoc.Diagram = ChartDoc.createInstance("com.sun.star.chart.LineDiagram")
oDiagram = ChartDoc.getDiagram()
aSize = oDiagram.getSize()
aSize.Width = 10620
aSize.Height = 15100 ' was 8660
oDiagram.Size = aSize
dim myDashes0 as New com.sun.star.drawing.LineDash
With myDashes0
.Style = com.sun.star.drawing.DashStyle.ROUND
.Dots = 4 ' 4 points
.DotLen = 200 ' of 0,5 mm
.Dashes = 2 ' with 2 dashes
.Distance = 300 ' spaced by 1,5 mm
End With
with oDiagram
.meanValue = true
.RegressionCurves = com.sun.star.chart.ChartRegressionCurveType.EXPONENTIAL
.HasXAxisTitle = true
.XAxisTitle.String = "Transaction Month"
.HasYAxisTitle = true
.YAxisTitle.String = "Rate of Exchange"
.DataCaption = com.sun.star.chart.ChartDataCaption.NONE
' dim myDashes0 as New com.sun.star.drawing.LineDash
' With myDashes0
' .Style = com.sun.star.drawing.DashStyle.ROUND
' .Dots = 4 ' 4 points
' .DotLen = 200 ' of 0,5 mm
' .Dashes = 2 ' with 2 dashes
' .Distance = 300 ' spaced by 1,5 mm
' End With
.DataRowSource = com.sun.star.chart.ChartDataRowSource.COLUMNS
DataRowProp0 = .getDataRowProperties(0) ' GBPEUR
with DataRowProp0
.LineDash = myDashes0
.LineStyle = com.sun.star.drawing.LineStyle.DASH
.LineColor = rgb(102,63,31)
.LineWidth = 90
end with
end with
I also tried it within DataRowProp0.
This is a chart, btw, not a drawing. Though I supposed that might not make a difference to the code.
Thanks for your help but if you have a chance to indicate what I am doing wrong or where that would be great.
Cheers
David