Xojo Conferences
MBSOct2019CologneDE

« MBS Edition of the Xo… | Home | How to Convert a PDF … »

Track Line with Data Labels Retina


We like to show you this example project included with MBS Xojo ChartDirector Plugin. This example shows several features of ChartDirector and our plugin how to:
  • create a chart, here with lines.
  • use dates for an axis
  • use several data sets on a layer
  • use gradients for background color
  • handle mouse over for tracking
  • how to dynamically draw a layer on top fo the chart
  • how to do 2x resolution for support for HighDPI and Retina screens
  • how to handle fonts and show text on linux
  • how to format a label with custom font and formatting.
Check the example. You may need to enable HiDPI support option in shared build settings. Than you can build the project for Mac, Windows and Linux and it works nice in 32 and 64 bit.

Linux Fonts

For Linux you may want to either change font names to the open source variants instead of Arial or you install ttf-mscorefonts-installer package. Than add a line in app.open:

CDBaseChartMBS.SetFontSearchPath("/usr/share/fonts/truetype/msttcorefonts/")

You can point to any folder containing relevant font files for ChartDirector which you than can refer to by file name.



Paint event

We updated several examples recently to use Paint event instead of drawing directly to the window. The referenced project here uses the paint event to draw the current chart. This chart is rendered in open event and stored in a property called pic. Than when mouse moves, the tracking of the mouse is handled, a new picture is generated and invalidate method is called to let the window redraw.



More coming soon in a XDevMag article.
18 03 19 - 10:07
No comments

  
Remember personal info?

Emoticons / Textile


Notify:
Hide email:

Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.