ChartDirectorMBS and ScaleFactor issue

My understanding is that Setting the ScaleFactor for the chart (primarily intended for support of HiDPI/Retina) should scale everything proportionally but it is not explained very well).

This feature can use some polish…

It looks like it is ALMOST working… except for axis labels when font size is not explicitly set… Then at 2X, the axis labels are half the size they should be… The workaround is to always explicitly set label font size (which then will be scaled)… but that is not ideal … If this is fixable I would appreciate a fix!

Also IMO the the Scale factor NEEDS to be in the Chart constructor else you need to write code like this

Dim C as New CDXYChartMBS(theWidth*scale, theHeight*Scale) C.ScaleFactor =Scale

And THAT is not very intuitive!

As you need to do that, I don’t see the point of being able to change the scale factor after creating the object. Also if set in the constructor, that would potentially allow those default values for axis label font size (and perhaps other things) to be adjusted under the hood for scale factor.

BTW in any case when using scalefactor the Resolution of the picture output of MakeChartPicture should set the picture resolution correctly… that way we don’t need to use all of the DrawPicture parameters when drawing in the paint event (or remember to set the picture resolution ourselves)

  • karen

if scale in MBS is like scale for hidpi it refers to pixel density not “make it twice the size”

Basically Christian just takes the Scale factor you pass and just multiples all the size setting sent to the ChartDirector library through his API wrappers.

As far as I can see, looking at the ChartDirector website, the library has no special code to deal with anything but pixels.

  • Karen

Yes. I made it myself last year.
You set
CDBaseChartMBS.scaleFactor before you use ChartDirector and it will apply for all pixel sizes.

Ah, and of course it will not scale in all cases where I forgot to apply the scale factor.
I tested it with over 20 examples and it worked well for me, so if you see a function which misses it, please tell me.

[quote=294080:@Christian Schmitz]Yes. I made it myself last year.
You set
CDBaseChartMBS.scaleFactor before you use ChartDirector and it will apply for all pixel sizes.[/quote]

I did not realize it was a shared property… I don’t think the docs say that, but it seems to me something like that would be better encapsulated in the object (Which is what I assumed)

Thanks,

  • karen

Well, I still hope a newer version of ChartDirector handles it automatically.