youcef92 / flotr

Automatically exported from code.google.com/p/flotr
0 stars 0 forks source link

Prototype: drawText ignores default font size - patch included #143

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open up basic-bar.html, and take a note of the markers' font size
2. Open up flotr.js, and find "drawText:", and then find the following lines:

style = Object.extend({
      size: '10px',
      color: '#000000',
      textAlign: 'left',
      textBaseline: 'bottom',
      weight: 1,
      angle: 0
    }, style);

3. Change size's value to, say, 30px
4. Refresh basic-bar.html, and notice that nothing changes

What is the expected output? What do you see instead?

The font size of the markers should change to size 30 because the call to 
drawText from the marker's plot function doesn't define style.size.

What version of the product are you using? On what operating system?

SVN revision 169.

Please provide any additional information below.

The above problem is caused by the suffix "px", if you take it out, the 
markers' font size will be as expected. However, in my opinion, a better 
solution is to use Flotr.defaultOptions.fontSize.

I fixed measureText as well.

Original issue reported on code.google.com by dennis.s...@gmail.com on 17 Aug 2010 at 11:25

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r171.

Original comment by fabien.menager on 8 Sep 2010 at 5:22