TobiasW
TobiasW

Reputation: 891

How to increase NVD3JS Pie-Chart label size

I try to increase the label size of my nvd3js pie-chart, because it's really tiny. So I've read about doing this like this :

        <svg style="font: normal 28px Impact;"></svg>

or

        <div style="font: normal 28px Impact;">
            <svg></svg>
        </div>

But both ways don't change anything about my label size, have you maybe another solution to do this?

Complete code:

    <nvd3-pie-chart data="exampleData" id="exampleId" width="500" height="500" x="xFunction()" y="yFunction()" showLabels="true" labelType="percent">
        <div style="font: normal 28px Impact;">
            <svg></svg>
        </div>
    </nvd3-pie-chart>

Upvotes: 0

Views: 1084

Answers (1)

jawadhoot
jawadhoot

Reputation: 164

Two ways to do it :

I prefer using CSS

.nv-label text{
    font-size:28px;
}

using JavaScript

d3.select(".nv-label text").style("font-size","28px")

Upvotes: 1

Related Questions