benkeen / d3pie

A configurable pie chart lib and generator built on d3.js
MIT License
370 stars 203 forks source link

Font-family is set to verdana in style attribute #167

Closed charlotte-murray closed 5 years ago

charlotte-murray commented 5 years ago

I've got the following code:

    var pie = new d3pie("my-chart", {
        "header": {
            "title": {
                "text": "My Overview",
                "fontSize": 22,
                "font": "helvetica"
            },
            "subtitle": {
                "text": "My Subtitle",
                "color": "#999999",
                "fontSize": 10,
                "font": "helvetica"
            },
            "titleSubtitlePadding": 12
        },
        "footer": {
            "color": "#999999",
            "fontSize": 11,
            "font": "helvetica",
            "location": "bottom-center"
        },
        "size": {
            "canvasHeight": 500,
            "canvasWidth": $("#my-chart").innerWidth(),
            "pieOuterRadius": "90%"
        },
        "data": {
            "content": data
        },
        "labels": {
            "outer": {
                "format": "label-value1",
                "pieDistance": 32
            },
            "inner": {
                "hideWhenLessThanPercentage": 2
            },
            "mainLabel": {
                "font": "helvetica"
            },
            "percentage": {
                "color": "#ebebeb",
                "font": "helvetica",
                "decimalPlaces": 0
            },
            "value": {
                "color": "#929292",
                "font": "helvetica"
            },
            "lines": {
                "enabled": true,
                "style": "straight",
                "color": "#cccccc"
            },
            "truncation": {
                "enabled": true
            }
        },
        "tooltips": {
            "enabled": true,
            "type": "placeholder",
            "string": "{label}: {value}, {percentage}%",
            "styles": {
                "fadeInSpeed": 260,
                "backgroundOpacity": 0.7
            }
        },
        "effects": {
            "pullOutSegmentOnClick": {
                "effect": "none",
                "speed": 400,
                "size": 8
            }
        }
    });

But when I look at devtools in Chrome the font is coming up as Verdana: image And I've spotted that it's got a font-family style attribute in the tag which is forcing verdana: image

Do you know why this is happening, and how I can change it? The d3pie.js file doesn't mention verdana anywhere in it from a cursory Ctrl+F, so I'm not sure where it's coming from but I wonder if you could point me in the right direction?

charlotte-murray commented 5 years ago

Problem was between screen and chair - my JS was cached in the browser without me realising.