Reputation: 86
If I wanted to specifically target one of the data elements, e.g point.y with some styling and no other elements, how would I go about doing that?
data: [{
name: 'Administrative Brugere',
y: 4,
subtotal: 7899.99,
color: "#B83D5A"
}]
In case you want to see what I am working on, I'd like to target point.y, when you click one of the pieces, point.y is shown alongside point.subtotal and point.name, point.y needs to be bigger font-size (point.y is the middle one).
Upvotes: 0
Views: 27
Reputation: 86
In my jQuery function as seen in the fiddle, I simply had to put the item I wanted to apply style to in a span, this way I could easily target point.y and nothing else.
var text = point.subtotal + ' DKK' + '<br/><span style="font-size: 42px; margin-top: -10px!important;">' + point.y + '</span><br/>' + point.name;
Upvotes: 1