Hello – I have to following code for a polar chart that displays wind speed and direction. The canvas it paints into is 200x200. I would like to figure out how to increase the resolution to sharpen up the text, lines, labels, etc to look good on a Retina mac. I found how you can do this with images, but not with graphs. I have line graphs as well that I need to figure this out. But I thought I would start with the polar graph. Here is the code:
dim wind as double = val(dataArray(10)) dim winddir as double = val(NthField(TextFieldWindDir.Text, ",", 1)) // Create a PolarChart object of size 200 x 200 pixels which is the Canvas.Wind size, with a silver background // and a 1 pixel 3D border dim c as new CDPolarChartMBS(CanvasWind.Width, CanvasWind.height, CDPolarChartMBS.silverColor) // set wallpaper from folder image c.setWallpaper(f) // Set plot area center at (102, 100) with radius 80 pixels and white background c.setPlotArea(102, 100, 80)', &hF2F2F2) // Set the grid style to circular grid c.setGridStyle(false) c.setGridColor(&h000080) // Set angular axis as 0 - 360, with a spoke every 30 units c.angularAxis.setLinearScale(0, 360, 30) c.angularAxis.setLabelStyle.setFontSize(7) c.angularAxis.setLabelStyle.setFontColor(&h000080) call c.radialAxis.setLabelStyle "",7 c.angularAxis.setLabelGap 3 // Add sectors to the chart as sector zones c.angularAxis.addZone(winddir - 5, winddir + 5, 0, wind, &h33ff33, &h008000) If wind = 0 Then //Add another layer to to capture wind direction as bubble dim layer0 as CDPolarLineLayerMBS layer0 = c.addLineLayer(array(wind+100),&h33ff33) layer0.setAngles(array(winddir)) // Disable the line by setting its width to 0, so only the symbols are visible layer0.setLineWidth(0) // Use a circular data point symbol layer0.setDataSymbol(CDPolarChartMBS.kCircleSymbol, 6) Else end // Add layer to ensure the axis is auto-scaled using the // data call c.addLineLayer(array(wind), &h000080) // Output the chart CanvasWind.Backdrop=c.makeChartPicture
Any help/ideas would be greatly appreciated. I’m running this on my 15" MacBook Pro Retina with Mavericks (OSX 10.9.2).