I am a beginner. I don’t really understand.
I also have a problem where on windows, the chars look OK, but
when cross compiled to the RPI none of the numbers show up…
here are the pictures of RPI(bad) Windoes (good)
http://www.mediafire.com/folder/0i4u7qsf2m1y1/graph_fail
This is my code… (yes it is a very ugly mashup of examples
that came from MBS – but in my defense, I am still a beginner!)
dim x as integer
dim data0(575) as double
dim data1(575) as double
dim x_axis(575) as double
dim p as Picture
utilities.graph_test = utilities.graph_test +1
for x = 1 to 576
data0(x-1)=utilities.wheel_amplitude(x) '+rnd()1000utilities.graph_test
data1(x-1)=0
x_axis(x-1)=x
next x
window4.mychart.Destructor ’ have to destroy object so we don’t run out of memory
window4.mychart.Constructor ’ have to make a new one, because you cant call makeChartPicture more than one time ???
call window4.mychart.addTitle(“Enegy per timeslot”, “timesbi.ttf”, 18)
call window4. mychart.setPlotArea(50, 55, window4.mychart.getWidth - 100, window4.mychart.getHeight - 90, window4.mychart.linearGradientColor(0, 55, 0, window4.mychart.getHeight - 35, &hf0f6ff, &ha0c0ff), -1, CDBaseChartMBS.kTransparent, &hffffff, &hffffff)
call window4.mychart.addLegend(50, 25, false, “arialbd.ttf”, 10)
// Set axis label style to 8pts Arial Bold
call window4.mychart.xAxis.setLabelStyle(“arialbd.ttf”, 8)
call window4.mychart.yAxis.setLabelStyle(“arialbd.ttf”, 8)
call window4.mychart.yAxis2.setLabelStyle(“arialbd.ttf”, 8)
// Set the axis stem to transparent
window4.mychart.xAxis.setColors(CDBaseChartMBS.kTransparent)
call window4.mychart.yAxis.setColors(CDBaseChartMBS.kTransparent)
call window4.mychart.yAxis2.setColors(CDBaseChartMBS.kTransparent)
// Configure x-axis label format
'c.xAxis.setMultiFormat(CDBaseChartMBS.StartOfYearFilter, "{value|mm/yyyy} ", CDBaseChartMBS.StartOfMonthFilter, “{value|mm}”)
// Add axis title using 10pts Arial Bold Italic font
call window4.mychart.yAxis.setTitle(“Amplitude”, “arialbi.ttf”, 10)
'call mychart.yAxis2.setTitle(“Effective Load (kg)”, “arialbi.ttf”, 10)
// Add a line layer to the chart using a line width of 2 pixels.
dim layer as CDLineLayerMBS = window4.mychart.addLineLayer
layer.setLineWidth(2)
call window4.mychart.setPlotArea(50, 55,window4.canvas1.Width- 100, window4.canvas1.height- 90, window4.mychart.linearGradientColor(0, 55, 0, window4.mychart.getHeight - 35, &hf0f6ff, &ha0c0ff), -1, CDBaseChartMBS.kTransparent, &hffffff, &hffffff)
'add x axis data
call window4.mychart.xAxis.setLabels(x_axis)
’ add y axis daya
call window4.mychart.addLineLayer.addDataSet(data0,&hcc0000, “Energy”)
// scaling of y axis
window4.mychart.yAxis.setLinearScale 0, 250000
// Display 1 out of 3 labels on the x-axis.
window4.mychart.xAxis.setLabelStep(50)
// Output the chart
p=window4.mychart.makeChartPicture ’ apparently you only get one of these per dat set??
if (p<>nil) then
window4.pic =p
end if
// fix some properties if set wrong in IDE
window4.canvas1.DoubleBuffer = false
window4.canvas1.EraseBackground = false
#if RBVersion >= 2013.0 then
window4.canvas1.Transparent = False
#endif