wakr70 / CCU-Historian-HC

Add HighChart to CCU-Historian
GNU General Public License v3.0
10 stars 1 forks source link

Tiny font size for point labels since v7.0 #8

Closed j-wol closed 8 months ago

j-wol commented 10 months ago

Hello, with v7.0 I noticed a much tinier font size for point labels. In version 6.9 they were much bigger. Tested on Linux PC with Firefox and Chrome, on a Windows PC with Firefox and with Safari on a iPad. In all cases the tinier font size. I had already a look into the commit introducing v7.0 and adopted some font sizes I found in files: annotations-advanced.js, annotations-advanced.js.map, annotations-advanced.src.js, indicators-all.js, indicators-all.js.map, indicators-all.src.js, stock-tools.js, stock-tools.js.map, stock-tools.src.js (all in folder h2-highchart/stock-tools/). Unfortunately, changing them had no positive impact. Could you please help?

wakr70 commented 8 months ago

Hi j-wol, what exactly you mean with point labels. Most of the font sizes calculated in script h2-highchart.js function chartSetFontSize() at the end of the script. Also in the settings there is a new parameter font size. If you change it and the point labels size change also, then it should be calculated in chartSetFontSize() ! BR wak

wakr70 commented 8 months ago

Hi j-wol, i have checked where the font size can be set and also some other styles, it is in function defineDataLabels() if you change at the end of the function the coding with following: } else if (window.H2buffer.Labels === 2) { objLabels = { enabled: true, allowOverlap: false, color: null, style: { "color": null, fontSize: Math.round(window.H2buffer.FontSize / 6 * 5).toString() + "px", fontWeight : "", }, formatter: function() { return window.Highcharts.numberFormat(this.y, 1); } }; }

return objLabels;

Then you can play with the size ...

I will include this to my next update ;-) BR Walter

j-wol commented 8 months ago

Hello, thanks for your reply. I didn't tested your code yet, but to visualize what I mean please following screenshot: Screenshot from 2024-03-24 14-47-40 On the left-hand side an old screenshot with CCU Highchart version 6.9 and on the right-hand side the current version 7.1. This much smaller font size for the point labels were introduced with v7.0. The font size parameter in the properties does not affect on the point labels, but only on the text on the legend and diagram axes.

wakr70 commented 8 months ago

should be solved with Version 7.2