How To Customize a Flotr2 Radar Chart

150 views Asked by At

http://www.humblesoftware.com/flotr2

I am trying to modify the default font size, weight, and color for the Flotr2 radar chart. I could change this in the flotr2.js file but I want to leave the source file alone.

Currently when I set a larger fontSize in the Flotr.draw call it just spaces out the labels further.

function drawGraph(container, series, ticks)
{
    Flotr.draw(container, series, {
        colors: colors,
        HtmlText: true,
        fontSize: 30,
        radar: {
            show: true
        },
        grid: {
            circular: true,
            minorHorizontalLines: true
        },
        yaxis: {
            min: 0,
            max: 7,
            minorTickFreq: 1,
            showLabels: false
        },
        xaxis: {
            ticks: ticks,
            titleAlign: 'right'
        },
        legend: {
            position: 'ss',
            container: document.getElementById("legendItems")
        }
    });
}

I'm not sure what else to try...

1

There are 1 answers

0
David On BEST ANSWER

Accessing the variables from the window object before drawing the graph seems to work well.

window.Flotr.defaultOptions.fontSize = 8;
window.Flotr.defaultOptions.xaxis.color = '#000000';

Couldn't find a way to change the font weight.